From 5219b71bd26bbbbe9e1cd95faf7488003a24e80e Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Fri, 3 Apr 2020 22:15:44 +0200 Subject: [PATCH 01/11] improvement: closing body --- client.go | 5 +++++ writeService.go | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 72139425..fc39df7d 100644 --- a/client.go +++ b/client.go @@ -179,6 +179,11 @@ func (c *client) handleHttpError(r *http.Response) *Error { if r.StatusCode >= 200 && r.StatusCode < 300 { return nil } + defer func() { + // discard body so connection can be reused + _, _ = io.Copy(ioutil.Discard, r.Body) + r.Body.Close() + }() perror := NewError(nil) perror.StatusCode = r.StatusCode diff --git a/writeService.go b/writeService.go index af54a038..612f23b2 100644 --- a/writeService.go +++ b/writeService.go @@ -115,7 +115,13 @@ func (w *writeService) writeBatch(ctx context.Context, batch *batch) error { if w.client.Options().UseGZip() { req.Header.Set("Content-Encoding", "gzip") } - }, nil) + }, func(r *http.Response) error { + // discard body so connection can be reused + //_, _ = io.Copy(ioutil.Discard, r.Body) + //_ = r.Body.Close() + return nil + }) + if perror != nil { if perror.StatusCode == http.StatusTooManyRequests || perror.StatusCode == http.StatusServiceUnavailable { logger.Errorf("Write error: %s\nBatch kept for retrying\n", perror.Error()) @@ -133,8 +139,6 @@ func (w *writeService) writeBatch(ctx context.Context, batch *batch) error { logger.Errorf("Write error: %s\n", perror.Error()) } return perror - } else { - w.lastWriteAttempt = time.Now() } return nil } From 87107a0b5be3ad690d51ff258029d2de53b76d37 Mon Sep 17 00:00:00 2001 From: soudrug Date: Wed, 8 Apr 2020 18:35:26 +0200 Subject: [PATCH 02/11] refactor: moved common http code into internal/http package and introduced http service --- client.go | 162 +++++------------------------ client_test.go | 11 +- error.go => internal/http/error.go | 2 +- internal/http/service.go | 135 ++++++++++++++++++++++++ internal/http/userAgent.go | 4 + query.go | 22 ++-- query_test.go | 4 +- setup.go | 4 +- version.go | 10 ++ write.go | 5 +- writeApiBlocking.go | 5 +- writeApiBlocking_test.go | 47 +++++---- writeService.go | 10 +- write_test.go | 156 +++++++++++++-------------- 14 files changed, 313 insertions(+), 264 deletions(-) rename error.go => internal/http/error.go (97%) create mode 100644 internal/http/service.go create mode 100644 internal/http/userAgent.go diff --git a/client.go b/client.go index fc39df7d..ee8ebfa3 100644 --- a/client.go +++ b/client.go @@ -8,21 +8,15 @@ package influxdb2 import ( "context" - "encoding/json" - "fmt" "io" "io/ioutil" - "mime" - "net" "net/http" "net/url" "path" - "runtime" - "strconv" "sync" - "time" "github.com/influxdata/influxdb-client-go/domain" + ihttp "github.com/influxdata/influxdb-client-go/internal/http" ) // InfluxDBClient provides API to communicate with InfluxDBServer @@ -40,7 +34,7 @@ type InfluxDBClient interface { Close() // Options returns the options associated with client Options() *Options - // ServerUrl returns the url of the server url client talks to + // serverUrl returns the url of the server url client talks to ServerUrl() string // Setup sends request to initialise new InfluxDB server with user, org and bucket, and data retention period // Retention period of zero will result to infinite retention @@ -48,24 +42,17 @@ type InfluxDBClient interface { Setup(ctx context.Context, username, password, org, bucket string, retentionPeriodHours int) (*domain.OnboardingResponse, error) // Ready checks InfluxDB server is running Ready(ctx context.Context) (bool, error) - // Internal method for handling posts - postRequest(ctx context.Context, url string, body io.Reader, requestCallback RequestCallback, responseCallback ResponseCallback) *Error } // client implements InfluxDBClient interface type client struct { - serverUrl string - authorization string - options *Options - writeApis []WriteApi - httpClient *http.Client - lock sync.Mutex + serverUrl string + options *Options + writeApis []WriteApi + lock sync.Mutex + httpService ihttp.Service } -// Http operation callbacks -type RequestCallback func(req *http.Request) -type ResponseCallback func(req *http.Response) error - // NewClient creates InfluxDBClient for connecting to given serverUrl with provided authentication token, with default options // Authentication token can be empty in case of connecting to newly installed InfluxDB server, which has not been set up yet. // In such case Setup will set authentication token @@ -79,20 +66,10 @@ func NewClient(serverUrl string, authToken string) InfluxDBClient { // In such case Setup will set authentication token func NewClientWithOptions(serverUrl string, authToken string, options *Options) InfluxDBClient { client := &client{ - serverUrl: serverUrl, - authorization: "Token " + authToken, - httpClient: &http.Client{ - Timeout: time.Second * 20, - Transport: &http.Transport{ - DialContext: (&net.Dialer{ - Timeout: 5 * time.Second, - }).DialContext, - TLSHandshakeTimeout: 5 * time.Second, - TLSClientConfig: options.TlsConfig(), - }, - }, - options: options, - writeApis: make([]WriteApi, 0, 5), + serverUrl: serverUrl, + options: options, + writeApis: make([]WriteApi, 0, 5), + httpService: ihttp.NewService(serverUrl, "Token "+authToken, options.tlsConfig), } return client } @@ -110,27 +87,28 @@ func (c *client) Ready(ctx context.Context) (bool, error) { return false, err } readyUrl.Path = path.Join(readyUrl.Path, "ready") - req, err := http.NewRequestWithContext(ctx, http.MethodGet, readyUrl.String(), nil) - if err != nil { - return false, err - } - req.Header.Set("User-Agent", userAgent()) - resp, err := c.httpClient.Do(req) - if err != nil { - return false, err + readyRes := false + perror := c.httpService.GetRequest(ctx, readyUrl.String(), nil, func(resp *http.Response) error { + // discard body so connection can be reused + _, _ = io.Copy(ioutil.Discard, resp.Body) + _ = resp.Body.Close() + readyRes = resp.StatusCode == http.StatusOK + return nil + }) + if perror != nil { + return false, perror } - defer resp.Body.Close() - return resp.StatusCode == http.StatusOK, nil + return readyRes, nil } func (c *client) WriteApi(org, bucket string) WriteApi { - w := newWriteApiImpl(org, bucket, c) + w := newWriteApiImpl(org, bucket, c.httpService, c) c.writeApis = append(c.writeApis, w) return w } func (c *client) WriteApiBlocking(org, bucket string) WriteApiBlocking { - w := newWriteApiBlockingImpl(org, bucket, c) + w := newWriteApiBlockingImpl(org, bucket, c.httpService, c) return w } @@ -141,95 +119,5 @@ func (c *client) Close() { } func (c *client) QueryApi(org string) QueryApi { - return &queryApiImpl{ - org: org, - client: c, - } -} - -func (c *client) postRequest(ctx context.Context, url string, body io.Reader, requestCallback RequestCallback, responseCallback ResponseCallback) *Error { - req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, body) - if err != nil { - return NewError(err) - } - req.Header.Set("Authorization", c.authorization) - req.Header.Set("User-Agent", userAgent()) - if requestCallback != nil { - requestCallback(req) - } - resp, err := c.httpClient.Do(req) - if err != nil { - return NewError(err) - } - - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return c.handleHttpError(resp) - } - if responseCallback != nil { - err := responseCallback(resp) - if err != nil { - return NewError(err) - } - } - return nil -} - -func (c *client) handleHttpError(r *http.Response) *Error { - // successful status code range - if r.StatusCode >= 200 && r.StatusCode < 300 { - return nil - } - defer func() { - // discard body so connection can be reused - _, _ = io.Copy(ioutil.Discard, r.Body) - r.Body.Close() - }() - - perror := NewError(nil) - perror.StatusCode = r.StatusCode - if v := r.Header.Get("Retry-After"); v != "" { - r, err := strconv.ParseUint(v, 10, 32) - if err == nil { - perror.RetryAfter = uint(r) - } - } - // json encoded error - ctype, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) - if ctype == "application/json" { - err := json.NewDecoder(r.Body).Decode(perror) - perror.Err = err - return perror - } else { - body, err := ioutil.ReadAll(r.Body) - if err != nil { - perror.Err = err - return perror - } - - perror.Code = r.Status - perror.Message = string(body) - } - - if perror.Code == "" && perror.Message == "" { - switch r.StatusCode { - case http.StatusTooManyRequests: - perror.Code = "too many requests" - perror.Message = "exceeded rate limit" - case http.StatusServiceUnavailable: - perror.Code = "unavailable" - perror.Message = "service temporarily unavailable" - } - } - return perror -} - -// Keeps once created User-Agent string -var userAgentCache string - -// userAgent does lazy user-agent string initialisation -func userAgent() string { - if userAgentCache == "" { - userAgentCache = fmt.Sprintf("influxdb-client-go/%s (%s; %s)", Version, runtime.GOOS, runtime.GOARCH) - } - return userAgentCache + return newQueryApi(org, c.httpService, c) } diff --git a/client_test.go b/client_test.go index 0e35be93..98887487 100644 --- a/client_test.go +++ b/client_test.go @@ -6,6 +6,7 @@ package influxdb2 import ( "context" + http2 "github.com/influxdata/influxdb-client-go/internal/http" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "net/http" @@ -17,7 +18,7 @@ import ( func TestUserAgent(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { time.Sleep(100 * time.Millisecond) - if r.Header.Get("User-Agent") == userAgent() { + if r.Header.Get("User-Agent") == http2.UserAgent { w.WriteHeader(http.StatusOK) } else { w.WriteHeader(http.StatusNotFound) @@ -37,7 +38,7 @@ func TestUserAgent(t *testing.T) { func TestServerError429(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { time.Sleep(100 * time.Millisecond) - w.Header().Set("Retry-After","1") + w.Header().Set("Retry-After", "1") w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusTooManyRequests) w.Write([]byte(`{"code":"too many requests", "message":"exceeded rate limit"}`)) @@ -47,7 +48,7 @@ func TestServerError429(t *testing.T) { c := NewClient(server.URL, "x") err := c.WriteApiBlocking("o", "b").WriteRecord(context.Background(), "a,a=a a=1i") require.NotNil(t, err) - perror, ok := err.(*Error) + perror, ok := err.(*http2.Error) require.True(t, ok) require.NotNil(t, perror) assert.Equal(t, "too many requests", perror.Code) @@ -65,9 +66,9 @@ func TestServerErrorNonJSON(t *testing.T) { c := NewClient(server.URL, "x") err := c.WriteApiBlocking("o", "b").WriteRecord(context.Background(), "a,a=a a=1i") require.NotNil(t, err) - perror, ok := err.(*Error) + perror, ok := err.(*http2.Error) require.True(t, ok) require.NotNil(t, perror) assert.Equal(t, "500 Internal Server Error", perror.Code) assert.Equal(t, "internal server error", perror.Message) -} \ No newline at end of file +} diff --git a/error.go b/internal/http/error.go similarity index 97% rename from error.go rename to internal/http/error.go index 5347918f..925983f0 100644 --- a/error.go +++ b/internal/http/error.go @@ -2,7 +2,7 @@ // Use of this source code is governed by MIT // license that can be found in the LICENSE file. -package influxdb2 +package http import "fmt" diff --git a/internal/http/service.go b/internal/http/service.go new file mode 100644 index 00000000..3524b63a --- /dev/null +++ b/internal/http/service.go @@ -0,0 +1,135 @@ +package http + +import ( + "context" + "crypto/tls" + "encoding/json" + "io" + "io/ioutil" + "mime" + "net" + "net/http" + "strconv" + "time" +) + +type Service interface { + PostRequest(ctx context.Context, url string, body io.Reader, requestCallback RequestCallback, responseCallback ResponseCallback) *Error + GetRequest(ctx context.Context, url string, requestCallback RequestCallback, responseCallback ResponseCallback) *Error + SetAuthorization(authorization string) +} + +type serviceImpl struct { + serverUrl string + authorization string + client *http.Client +} + +// Http operation callbacks +type RequestCallback func(req *http.Request) +type ResponseCallback func(resp *http.Response) error + +func NewService(serverUrl, authorization string, tlsConfig *tls.Config) Service { + return &serviceImpl{ + serverUrl: serverUrl, + authorization: authorization, + client: &http.Client{ + Timeout: time.Second * 20, + Transport: &http.Transport{ + DialContext: (&net.Dialer{ + Timeout: 5 * time.Second, + }).DialContext, + TLSHandshakeTimeout: 5 * time.Second, + TLSClientConfig: tlsConfig, + }, + }, + } +} + +func (s *serviceImpl) SetAuthorization(authorization string) { + s.authorization = authorization +} + +func (s *serviceImpl) PostRequest(ctx context.Context, url string, body io.Reader, requestCallback RequestCallback, responseCallback ResponseCallback) *Error { + return s.httpRequest(ctx, http.MethodPost, url, body, requestCallback, responseCallback) +} + +func (s *serviceImpl) httpRequest(ctx context.Context, method, url string, body io.Reader, requestCallback RequestCallback, responseCallback ResponseCallback) *Error { + req, err := http.NewRequestWithContext(ctx, method, url, body) + if err != nil { + return NewError(err) + } + req.Header.Set("Authorization", s.authorization) + req.Header.Set("User-Agent", UserAgent) + if requestCallback != nil { + requestCallback(req) + } + resp, err := s.client.Do(req) + if err != nil { + return NewError(err) + } + + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return s.handleHttpError(resp) + } + if responseCallback != nil { + err := responseCallback(resp) + if err != nil { + return NewError(err) + } + } + return nil +} + +func (s *serviceImpl) GetRequest(ctx context.Context, url string, requestCallback RequestCallback, responseCallback ResponseCallback) *Error { + return s.httpRequest(ctx, http.MethodGet, url, nil, requestCallback, responseCallback) +} + +func (s *serviceImpl) handleHttpError(r *http.Response) *Error { + // successful status code range + if r.StatusCode >= 200 && r.StatusCode < 300 { + return nil + } + defer func() { + // discard body so connection can be reused + _, _ = io.Copy(ioutil.Discard, r.Body) + _ = r.Body.Close() + }() + + perror := NewError(nil) + perror.StatusCode = r.StatusCode + if v := r.Header.Get("Retry-After"); v != "" { + r, err := strconv.ParseUint(v, 10, 32) + if err == nil { + perror.RetryAfter = uint(r) + } + } + // json encoded error + ctype, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) + if ctype == "application/json" { + err := json.NewDecoder(r.Body).Decode(perror) + perror.Err = err + return perror + } else { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + perror.Err = err + return perror + } + + perror.Code = r.Status + perror.Message = string(body) + } + + if perror.Code == "" && perror.Message == "" { + switch r.StatusCode { + case http.StatusTooManyRequests: + perror.Code = "too many requests" + perror.Message = "exceeded rate limit" + case http.StatusServiceUnavailable: + perror.Code = "unavailable" + perror.Message = "service temporarily unavailable" + } + } + return perror +} diff --git a/internal/http/userAgent.go b/internal/http/userAgent.go new file mode 100644 index 00000000..c3163d76 --- /dev/null +++ b/internal/http/userAgent.go @@ -0,0 +1,4 @@ +package http + +// Keeps once created User-Agent string +var UserAgent string diff --git a/query.go b/query.go index 0b083e9d..4fe4705a 100644 --- a/query.go +++ b/query.go @@ -13,6 +13,7 @@ import ( "encoding/json" "errors" "fmt" + ihttp "github.com/influxdata/influxdb-client-go/internal/http" "io" "io/ioutil" "net/http" @@ -46,12 +47,21 @@ type QueryApi interface { Query(ctx context.Context, query string) (*QueryTableResult, error) } +func newQueryApi(org string, service ihttp.Service, client InfluxDBClient) QueryApi { + return &queryApiImpl{ + org: org, + httpService: service, + client: client, + } +} + // queryApiImpl implements QueryApi interface type queryApiImpl struct { - org string - client InfluxDBClient - url string - lock sync.Mutex + org string + httpService ihttp.Service + client InfluxDBClient + url string + lock sync.Mutex } func (q *queryApiImpl) QueryRaw(ctx context.Context, query string, dialect *domain.Dialect) (string, error) { @@ -66,7 +76,7 @@ func (q *queryApiImpl) QueryRaw(ctx context.Context, query string, dialect *doma return "", err } var body string - perror := q.client.postRequest(ctx, queryUrl, bytes.NewReader(qrJson), func(req *http.Request) { + perror := q.httpService.PostRequest(ctx, queryUrl, bytes.NewReader(qrJson), func(req *http.Request) { req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Encoding", "gzip") }, @@ -114,7 +124,7 @@ func (q *queryApiImpl) Query(ctx context.Context, query string) (*QueryTableResu if err != nil { return nil, err } - perror := q.client.postRequest(ctx, queryUrl, bytes.NewReader(qrJson), func(req *http.Request) { + perror := q.httpService.PostRequest(ctx, queryUrl, bytes.NewReader(qrJson), func(req *http.Request) { req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept-Encoding", "gzip") }, diff --git a/query_test.go b/query_test.go index 6121df92..2336852c 100644 --- a/query_test.go +++ b/query_test.go @@ -407,12 +407,12 @@ func TestQueryRawResult(t *testing.T) { w.Header().Set("Content-Type", "text/csv") w.Header().Set("Content-Encoding", "gzip") w.WriteHeader(http.StatusOK) - w.Write(bytes) + _, _ = w.Write(bytes) } } if err != nil { w.WriteHeader(http.StatusInternalServerError) - w.Write([]byte(err.Error())) + _, _ = w.Write([]byte(err.Error())) } } else { w.WriteHeader(http.StatusNotFound) diff --git a/setup.go b/setup.go index 30dc75de..76a873cb 100644 --- a/setup.go +++ b/setup.go @@ -34,7 +34,7 @@ func (c *client) Setup(ctx context.Context, username, password, org, bucket stri if c.options.LogLevel() > 2 { log.Printf("D! Request:\n%s\n", string(inputData)) } - error := c.postRequest(ctx, c.serverUrl+"/api/v2/setup", bytes.NewReader(inputData), func(req *http.Request) { + error := c.httpService.PostRequest(ctx, c.serverUrl+"/api/v2/setup", bytes.NewReader(inputData), func(req *http.Request) { req.Header.Add("Content-Type", "application/json; charset=utf-8") }, func(resp *http.Response) error { @@ -45,7 +45,7 @@ func (c *client) Setup(ctx context.Context, username, password, org, bucket stri } setupResult = setupResponse if setupResponse.Auth != nil && *setupResponse.Auth.Token != "" { - c.authorization = "Token " + *setupResponse.Auth.Token + c.httpService.SetAuthorization("Token " + *setupResponse.Auth.Token) } return nil }, diff --git a/version.go b/version.go index 6b743438..fb2289f5 100644 --- a/version.go +++ b/version.go @@ -4,6 +4,16 @@ package influxdb2 +import ( + "fmt" + "github.com/influxdata/influxdb-client-go/internal/http" + "runtime" +) + const ( Version = "1.0.0" ) + +func init() { + http.UserAgent = fmt.Sprintf("influxdb-client-go/%s (%s; %s)", Version, runtime.GOOS, runtime.GOARCH) +} diff --git a/write.go b/write.go index f7649b6e..d81b59e1 100644 --- a/write.go +++ b/write.go @@ -6,6 +6,7 @@ package influxdb2 import ( "context" + "github.com/influxdata/influxdb-client-go/internal/http" "strings" "time" ) @@ -47,9 +48,9 @@ type writeBuffInfoReq struct { writeBuffLen int } -func newWriteApiImpl(org string, bucket string, client InfluxDBClient) *writeApiImpl { +func newWriteApiImpl(org string, bucket string, service http.Service, client InfluxDBClient) *writeApiImpl { w := &writeApiImpl{ - service: newWriteService(org, bucket, client), + service: newWriteService(org, bucket, service, client), writeBuffer: make([]string, 0, client.Options().BatchSize()+1), writeCh: make(chan *batch), doneCh: make(chan int), diff --git a/writeApiBlocking.go b/writeApiBlocking.go index ac8d366e..1ace5776 100644 --- a/writeApiBlocking.go +++ b/writeApiBlocking.go @@ -6,6 +6,7 @@ package influxdb2 import ( "context" + "github.com/influxdata/influxdb-client-go/internal/http" "strings" ) @@ -27,8 +28,8 @@ type writeApiBlockingImpl struct { } // creates writeApiBlockingImpl for org and bucket with underlying client -func newWriteApiBlockingImpl(org string, bucket string, client InfluxDBClient) *writeApiBlockingImpl { - return &writeApiBlockingImpl{service: newWriteService(org, bucket, client)} +func newWriteApiBlockingImpl(org string, bucket string, service http.Service, client InfluxDBClient) *writeApiBlockingImpl { + return &writeApiBlockingImpl{service: newWriteService(org, bucket, service, client)} } func (w *writeApiBlockingImpl) write(ctx context.Context, line string) error { diff --git a/writeApiBlocking_test.go b/writeApiBlocking_test.go index c689cb2e..411fa00c 100644 --- a/writeApiBlocking_test.go +++ b/writeApiBlocking_test.go @@ -6,6 +6,7 @@ package influxdb2 import ( "context" + "github.com/influxdata/influxdb-client-go/internal/http" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "sync" @@ -14,57 +15,63 @@ import ( ) func TestWritePoint(t *testing.T) { - client := &testClient{ - options: DefaultOptions(), - t: t, + client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} + service := &testHttpService{ + t: t, + options: client.Options(), + serverUrl: client.ServerUrl(), } client.options.SetBatchSize(5) - writeApi := newWriteApiBlockingImpl("my-org", "my-bucket", client) + writeApi := newWriteApiBlockingImpl("my-org", "my-bucket", service, client) points := genPoints(10) err := writeApi.WritePoint(context.Background(), points...) require.Nil(t, err) - require.Len(t, client.lines, 10) + require.Len(t, service.lines, 10) for i, p := range points { line := p.ToLineProtocol(client.options.Precision()) //cut off last \n char line = line[:len(line)-1] - assert.Equal(t, client.lines[i], line) + assert.Equal(t, service.lines[i], line) } } func TestWriteRecord(t *testing.T) { - client := &testClient{ - options: DefaultOptions(), - t: t, + client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} + service := &testHttpService{ + t: t, + options: client.Options(), + serverUrl: client.ServerUrl(), } client.options.SetBatchSize(5) - writeApi := newWriteApiBlockingImpl("my-org", "my-bucket", client) + writeApi := newWriteApiBlockingImpl("my-org", "my-bucket", service, client) lines := genRecords(10) err := writeApi.WriteRecord(context.Background(), lines...) require.Nil(t, err) - require.Len(t, client.lines, 10) + require.Len(t, service.lines, 10) for i, l := range lines { - assert.Equal(t, l, client.lines[i]) + assert.Equal(t, l, service.lines[i]) } - client.Close() + service.Close() err = writeApi.WriteRecord(context.Background()) require.Nil(t, err) - require.Len(t, client.lines, 0) + require.Len(t, service.lines, 0) - client.replyError = &Error{Code: "invalid", Message: "data"} + service.replyError = &http.Error{Code: "invalid", Message: "data"} err = writeApi.WriteRecord(context.Background(), lines...) require.NotNil(t, err) require.Equal(t, "invalid: data", err.Error()) } func TestWriteContextCancel(t *testing.T) { - client := &testClient{ - options: DefaultOptions(), - t: t, + client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} + service := &testHttpService{ + t: t, + options: client.Options(), + serverUrl: client.ServerUrl(), } client.options.SetBatchSize(5) - writeApi := newWriteApiBlockingImpl("my-org", "my-bucket", client) + writeApi := newWriteApiBlockingImpl("my-org", "my-bucket", service, client) lines := genRecords(10) ctx, cancel := context.WithCancel(context.Background()) var err error @@ -78,5 +85,5 @@ func TestWriteContextCancel(t *testing.T) { cancel() wg.Wait() require.Equal(t, context.Canceled, err) - assert.Len(t, client.lines, 0) + assert.Len(t, service.lines, 0) } diff --git a/writeService.go b/writeService.go index 612f23b2..89901a91 100644 --- a/writeService.go +++ b/writeService.go @@ -7,6 +7,7 @@ package influxdb2 import ( "bytes" "context" + ihttp "github.com/influxdata/influxdb-client-go/internal/http" "io" "net/http" "net/url" @@ -31,20 +32,21 @@ type batch struct { type writeService struct { org string bucket string - client InfluxDBClient + httpService ihttp.Service url string lastWriteAttempt time.Time retryQueue *queue lock sync.Mutex + client InfluxDBClient } -func newWriteService(org string, bucket string, client InfluxDBClient) *writeService { +func newWriteService(org string, bucket string, httpService ihttp.Service, client InfluxDBClient) *writeService { logger.SetDebugLevel(client.Options().LogLevel()) retryBufferLimit := client.Options().RetryBufferLimit() / client.Options().BatchSize() if retryBufferLimit == 0 { retryBufferLimit = 1 } - return &writeService{org: org, bucket: bucket, client: client, retryQueue: newQueue(int(retryBufferLimit))} + return &writeService{org: org, bucket: bucket, httpService: httpService, client: client, retryQueue: newQueue(int(retryBufferLimit))} } func (w *writeService) handleWrite(ctx context.Context, batch *batch) error { @@ -111,7 +113,7 @@ func (w *writeService) writeBatch(ctx context.Context, batch *batch) error { } } w.lastWriteAttempt = time.Now() - perror := w.client.postRequest(ctx, wUrl, body, func(req *http.Request) { + perror := w.httpService.PostRequest(ctx, wUrl, body, func(req *http.Request) { if w.client.Options().UseGZip() { req.Header.Set("Content-Encoding", "gzip") } diff --git a/write_test.go b/write_test.go index 1f0c7a27..5ccfdc34 100644 --- a/write_test.go +++ b/write_test.go @@ -8,7 +8,7 @@ import ( "compress/gzip" "context" "fmt" - "github.com/influxdata/influxdb-client-go/domain" + ihttp "github.com/influxdata/influxdb-client-go/internal/http" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "io" @@ -21,25 +21,18 @@ import ( "time" ) -type testClient struct { +type testHttpService struct { + serverUrl string lines []string options *Options t *testing.T wasGzip bool - requestHandler func(c *testClient, url string, body io.Reader) error - replyError *Error + requestHandler func(c *testHttpService, url string, body io.Reader) error + replyError *ihttp.Error lock sync.Mutex } -func (t *testClient) WriteApiBlocking(string, string) WriteApiBlocking { - return nil -} - -func (t *testClient) WriteApi(string, string) WriteApi { - return nil -} - -func (t *testClient) Close() { +func (t *testHttpService) Close() { t.lock.Lock() if len(t.lines) > 0 { t.lines = t.lines[:0] @@ -50,20 +43,22 @@ func (t *testClient) Close() { t.lock.Unlock() } -func (t *testClient) QueryApi(string) QueryApi { - return nil -} - -func (t *testClient) ReplyError() *Error { +func (t *testHttpService) ReplyError() *ihttp.Error { t.lock.Lock() defer t.lock.Unlock() return t.replyError } -func (t *testClient) postRequest(_ context.Context, url string, body io.Reader, requestCallback RequestCallback, _ ResponseCallback) *Error { +func (t *testHttpService) SetAuthorization(authorization string) { + +} +func (t *testHttpService) GetRequest(_ context.Context, _ string, _ ihttp.RequestCallback, _ ihttp.ResponseCallback) *ihttp.Error { + return nil +} +func (t *testHttpService) PostRequest(_ context.Context, url string, body io.Reader, requestCallback ihttp.RequestCallback, _ ihttp.ResponseCallback) *ihttp.Error { req, err := http.NewRequest("POST", url, nil) if err != nil { - return NewError(err) + return ihttp.NewError(err) } if requestCallback != nil { requestCallback(req) @@ -72,7 +67,7 @@ func (t *testClient) postRequest(_ context.Context, url string, body io.Reader, body, _ = gzip.NewReader(body) t.wasGzip = true } - assert.Equal(t.t, url, fmt.Sprintf("%s/api/v2/write?bucket=my-bucket&org=my-org&precision=ns", t.ServerUrl())) + assert.Equal(t.t, url, fmt.Sprintf("%s/api/v2/write?bucket=my-bucket&org=my-org&precision=ns", t.serverUrl)) if t.ReplyError() != nil { return t.ReplyError() @@ -84,13 +79,13 @@ func (t *testClient) postRequest(_ context.Context, url string, body io.Reader, } if err != nil { - return NewError(err) + return ihttp.NewError(err) } else { return nil } } -func (t *testClient) decodeLines(body io.Reader) error { +func (t *testHttpService) decodeLines(body io.Reader) error { bytes, err := ioutil.ReadAll(body) if err != nil { return err @@ -103,27 +98,12 @@ func (t *testClient) decodeLines(body io.Reader) error { return nil } -func (t *testClient) Lines() []string { +func (t *testHttpService) Lines() []string { t.lock.Lock() defer t.lock.Unlock() return t.lines } -func (t *testClient) Options() *Options { - return t.options -} - -func (t *testClient) ServerUrl() string { - return "http://locahost:8900" -} - -func (t *testClient) Setup(context.Context, string, string, string, string, int) (*domain.OnboardingResponse, error) { - return nil, nil -} -func (t *testClient) Ready(context.Context) (bool, error) { - return true, nil -} - func genPoints(num int) []*Point { points := make([]*Point, num) rand.Seed(321) @@ -168,98 +148,106 @@ func genRecords(num int) []string { } func TestWriteApiImpl_Write(t *testing.T) { - client := &testClient{ - options: DefaultOptions(), - t: t, + client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} + service := &testHttpService{ + t: t, + options: client.Options(), + serverUrl: client.ServerUrl(), } client.options.SetBatchSize(5) - writeApi := newWriteApiImpl("my-org", "my-bucket", client) + writeApi := newWriteApiImpl("my-org", "my-bucket", service, client) points := genPoints(10) for _, p := range points { writeApi.WritePoint(p) } writeApi.Close() - require.Len(t, client.Lines(), 10) + require.Len(t, service.Lines(), 10) for i, p := range points { line := p.ToLineProtocol(client.options.Precision()) //cut off last \n char line = line[:len(line)-1] - assert.Equal(t, client.Lines()[i], line) + assert.Equal(t, service.Lines()[i], line) } } func TestGzipWithFlushing(t *testing.T) { - client := &testClient{ - options: DefaultOptions(), - t: t, + client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} + service := &testHttpService{ + t: t, + options: client.Options(), + serverUrl: client.ServerUrl(), } client.options.SetBatchSize(5).SetUseGZip(true) - writeApi := newWriteApiImpl("my-org", "my-bucket", client) + writeApi := newWriteApiImpl("my-org", "my-bucket", service, client) points := genPoints(5) for _, p := range points { writeApi.WritePoint(p) } time.Sleep(time.Millisecond * 10) - require.Len(t, client.Lines(), 5) - assert.True(t, client.wasGzip) + require.Len(t, service.Lines(), 5) + assert.True(t, service.wasGzip) - client.Close() + service.Close() client.options.SetUseGZip(false) for _, p := range points { writeApi.WritePoint(p) } time.Sleep(time.Millisecond * 10) - require.Len(t, client.Lines(), 5) - assert.False(t, client.wasGzip) + require.Len(t, service.Lines(), 5) + assert.False(t, service.wasGzip) writeApi.Close() } func TestFlushInterval(t *testing.T) { - client := &testClient{ - options: DefaultOptions(), - t: t, + client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} + service := &testHttpService{ + t: t, + options: client.Options(), + serverUrl: client.ServerUrl(), } client.options.SetBatchSize(10).SetFlushInterval(500) - writeApi := newWriteApiImpl("my-org", "my-bucket", client) + writeApi := newWriteApiImpl("my-org", "my-bucket", service, client) points := genPoints(5) for _, p := range points { writeApi.WritePoint(p) } - require.Len(t, client.Lines(), 0) + require.Len(t, service.Lines(), 0) time.Sleep(time.Millisecond * 600) - require.Len(t, client.Lines(), 5) + require.Len(t, service.Lines(), 5) writeApi.Close() - client.Close() + service.Close() client.options.SetFlushInterval(2000) - writeApi = newWriteApiImpl("my-org", "my-bucket", client) + writeApi = newWriteApiImpl("my-org", "my-bucket", service, client) for _, p := range points { writeApi.WritePoint(p) } - require.Len(t, client.Lines(), 0) + require.Len(t, service.Lines(), 0) time.Sleep(time.Millisecond * 2100) - require.Len(t, client.Lines(), 5) + require.Len(t, service.Lines(), 5) writeApi.Close() } func TestRetry(t *testing.T) { - client := &testClient{ - options: DefaultOptions(), - t: t, + client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} + service := &testHttpService{ + t: t, + options: client.Options(), + serverUrl: client.ServerUrl(), } client.options.SetLogLevel(3). SetBatchSize(5). SetRetryInterval(10000) - writeApi := newWriteApiImpl("my-org", "my-bucket", client) + writeApi := newWriteApiImpl("my-org", "my-bucket", service, client) points := genPoints(15) for i := 0; i < 5; i++ { writeApi.WritePoint(points[i]) } writeApi.waitForFlushing() - require.Len(t, client.Lines(), 5) - client.Close() - client.replyError = &Error{ + require.Len(t, service.Lines(), 5) + service.Close() + service.replyError = &ihttp.Error{ StatusCode: 429, RetryAfter: 5, } @@ -267,36 +255,38 @@ func TestRetry(t *testing.T) { writeApi.WritePoint(points[i]) } writeApi.waitForFlushing() - require.Len(t, client.Lines(), 0) - client.Close() + require.Len(t, service.Lines(), 0) + service.Close() for i := 5; i < 10; i++ { writeApi.WritePoint(points[i]) } writeApi.waitForFlushing() - require.Len(t, client.Lines(), 0) + require.Len(t, service.Lines(), 0) time.Sleep(5*time.Second + 50*time.Millisecond) for i := 10; i < 15; i++ { writeApi.WritePoint(points[i]) } writeApi.waitForFlushing() - require.Len(t, client.Lines(), 15) - assert.True(t, strings.HasPrefix(client.Lines()[7], "test,hostname=host_7")) - assert.True(t, strings.HasPrefix(client.Lines()[14], "test,hostname=host_14")) + require.Len(t, service.Lines(), 15) + assert.True(t, strings.HasPrefix(service.Lines()[7], "test,hostname=host_7")) + assert.True(t, strings.HasPrefix(service.Lines()[14], "test,hostname=host_14")) writeApi.Close() } func TestWriteError(t *testing.T) { - client := &testClient{ - options: DefaultOptions(), - t: t, + client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} + service := &testHttpService{ + t: t, + options: client.Options(), + serverUrl: client.ServerUrl(), } client.options.SetLogLevel(3).SetBatchSize(5) - client.replyError = &Error{ + service.replyError = &ihttp.Error{ StatusCode: 400, Code: "write", Message: "error", } - writeApi := newWriteApiImpl("my-org", "my-bucket", client) + writeApi := newWriteApiImpl("my-org", "my-bucket", service, client) errCh := writeApi.Errors() var recErr error var wg sync.WaitGroup @@ -312,6 +302,6 @@ func TestWriteError(t *testing.T) { writeApi.waitForFlushing() wg.Wait() require.NotNil(t, recErr) - + writeApi.Close() client.Close() } From efe422a220e7f437552388a399681d64f3f43562 Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Thu, 16 Apr 2020 18:11:46 +0200 Subject: [PATCH 03/11] refactor: http.service enhanced to serve broader cases --- internal/http/service.go | 39 ++++++++++++++++++++++++++++++++++----- query.go | 10 +++++----- setup.go | 10 +++++++++- writeService.go | 4 ++-- write_test.go | 17 +++++++++++++++++ 5 files changed, 67 insertions(+), 13 deletions(-) diff --git a/internal/http/service.go b/internal/http/service.go index 3524b63a..f3beec55 100644 --- a/internal/http/service.go +++ b/internal/http/service.go @@ -9,6 +9,7 @@ import ( "mime" "net" "net/http" + "net/url" "strconv" "time" ) @@ -16,22 +17,38 @@ import ( type Service interface { PostRequest(ctx context.Context, url string, body io.Reader, requestCallback RequestCallback, responseCallback ResponseCallback) *Error GetRequest(ctx context.Context, url string, requestCallback RequestCallback, responseCallback ResponseCallback) *Error + DoHttpRequest(req *http.Request, requestCallback RequestCallback, responseCallback ResponseCallback) *Error SetAuthorization(authorization string) + Authorization() string + HttpClient() *http.Client + ServerApiUrl() string } type serviceImpl struct { - serverUrl string + serverApiUrl string authorization string client *http.Client } +func (s *serviceImpl) ServerApiUrl() string { + return s.serverApiUrl +} + // Http operation callbacks type RequestCallback func(req *http.Request) type ResponseCallback func(resp *http.Response) error func NewService(serverUrl, authorization string, tlsConfig *tls.Config) Service { + apiUrl, err := url.Parse(serverUrl) + if err == nil { + //apiUrl.Path = path.Join(apiUrl.Path, "/api/v2/") + apiUrl, err = apiUrl.Parse("/api/v2/") + if err == nil { + serverUrl = apiUrl.String() + } + } return &serviceImpl{ - serverUrl: serverUrl, + serverApiUrl: serverUrl, authorization: authorization, client: &http.Client{ Timeout: time.Second * 20, @@ -50,15 +67,27 @@ func (s *serviceImpl) SetAuthorization(authorization string) { s.authorization = authorization } +func (s *serviceImpl) Authorization() string { + return s.authorization +} + +func (s *serviceImpl) HttpClient() *http.Client { + return s.client +} + func (s *serviceImpl) PostRequest(ctx context.Context, url string, body io.Reader, requestCallback RequestCallback, responseCallback ResponseCallback) *Error { - return s.httpRequest(ctx, http.MethodPost, url, body, requestCallback, responseCallback) + return s.doHttpRequestWithUrl(ctx, http.MethodPost, url, body, requestCallback, responseCallback) } -func (s *serviceImpl) httpRequest(ctx context.Context, method, url string, body io.Reader, requestCallback RequestCallback, responseCallback ResponseCallback) *Error { +func (s *serviceImpl) doHttpRequestWithUrl(ctx context.Context, method, url string, body io.Reader, requestCallback RequestCallback, responseCallback ResponseCallback) *Error { req, err := http.NewRequestWithContext(ctx, method, url, body) if err != nil { return NewError(err) } + return s.DoHttpRequest(req, requestCallback, responseCallback) +} + +func (s *serviceImpl) DoHttpRequest(req *http.Request, requestCallback RequestCallback, responseCallback ResponseCallback) *Error { req.Header.Set("Authorization", s.authorization) req.Header.Set("User-Agent", UserAgent) if requestCallback != nil { @@ -82,7 +111,7 @@ func (s *serviceImpl) httpRequest(ctx context.Context, method, url string, body } func (s *serviceImpl) GetRequest(ctx context.Context, url string, requestCallback RequestCallback, responseCallback ResponseCallback) *Error { - return s.httpRequest(ctx, http.MethodGet, url, nil, requestCallback, responseCallback) + return s.doHttpRequestWithUrl(ctx, http.MethodGet, url, nil, requestCallback, responseCallback) } func (s *serviceImpl) handleHttpError(r *http.Response) *Error { diff --git a/query.go b/query.go index 4fe4705a..811b6423 100644 --- a/query.go +++ b/query.go @@ -69,7 +69,7 @@ func (q *queryApiImpl) QueryRaw(ctx context.Context, query string, dialect *doma if err != nil { return "", err } - queryType := "flux" + queryType := domain.QueryTypeFlux qr := domain.Query{Query: query, Type: &queryType, Dialect: dialect} qrJson, err := json.Marshal(qr) if err != nil { @@ -102,7 +102,7 @@ func (q *queryApiImpl) QueryRaw(ctx context.Context, query string, dialect *doma // DefaultDialect return flux query Dialect with full annotations (datatype, group, default), header and comma char as a delimiter func DefaultDialect() *domain.Dialect { - annotations := []string{"datatype", "group", "default"} + annotations := []domain.DialectAnnotations{domain.DialectAnnotationsDatatype, domain.DialectAnnotationsGroup, domain.DialectAnnotationsDefault} delimiter := "," header := true return &domain.Dialect{ @@ -118,7 +118,7 @@ func (q *queryApiImpl) Query(ctx context.Context, query string) (*QueryTableResu if err != nil { return nil, err } - queryType := "flux" + queryType := domain.QueryTypeFlux qr := domain.Query{Query: query, Type: &queryType, Dialect: DefaultDialect()} qrJson, err := json.Marshal(qr) if err != nil { @@ -148,11 +148,11 @@ func (q *queryApiImpl) Query(ctx context.Context, query string) (*QueryTableResu func (q *queryApiImpl) queryUrl() (string, error) { if q.url == "" { - u, err := url.Parse(q.client.ServerUrl()) + u, err := url.Parse(q.httpService.ServerApiUrl()) if err != nil { return "", err } - u.Path = path.Join(u.Path, "/api/v2/query") + u.Path = path.Join(u.Path, "query") params := u.Query() params.Set("org", q.org) diff --git a/setup.go b/setup.go index 76a873cb..9f2a6466 100644 --- a/setup.go +++ b/setup.go @@ -12,6 +12,8 @@ import ( "github.com/influxdata/influxdb-client-go/domain" "log" "net/http" + "net/url" + "path" ) func (c *client) Setup(ctx context.Context, username, password, org, bucket string, retentionPeriodHours int) (*domain.OnboardingResponse, error) { @@ -34,7 +36,13 @@ func (c *client) Setup(ctx context.Context, username, password, org, bucket stri if c.options.LogLevel() > 2 { log.Printf("D! Request:\n%s\n", string(inputData)) } - error := c.httpService.PostRequest(ctx, c.serverUrl+"/api/v2/setup", bytes.NewReader(inputData), func(req *http.Request) { + u, err := url.Parse(c.httpService.ServerApiUrl()) + if err != nil { + return nil, err + } + u.Path = path.Join(u.Path, "setup") + + error := c.httpService.PostRequest(ctx, u.String(), bytes.NewReader(inputData), func(req *http.Request) { req.Header.Add("Content-Type", "application/json; charset=utf-8") }, func(resp *http.Response) error { diff --git a/writeService.go b/writeService.go index 89901a91..cb0e37c9 100644 --- a/writeService.go +++ b/writeService.go @@ -162,11 +162,11 @@ func (w *writeService) encodePoints(points ...*Point) (string, error) { func (w *writeService) writeUrl() (string, error) { if w.url == "" { - u, err := url.Parse(w.client.ServerUrl()) + u, err := url.Parse(w.httpService.ServerApiUrl()) if err != nil { return "", err } - u.Path = path.Join(u.Path, "/api/v2/write") + u.Path = path.Join(u.Path, "write") params := u.Query() params.Set("org", w.org) diff --git a/write_test.go b/write_test.go index 5ccfdc34..1a802ab0 100644 --- a/write_test.go +++ b/write_test.go @@ -23,6 +23,7 @@ import ( type testHttpService struct { serverUrl string + authorization string lines []string options *Options t *testing.T @@ -32,6 +33,18 @@ type testHttpService struct { lock sync.Mutex } +func (t *testHttpService) ServerApiUrl() string { + return t.serverUrl +} + +func (t *testHttpService) Authorization() string { + return t.authorization +} + +func (t *testHttpService) HttpClient() *http.Client { + return nil +} + func (t *testHttpService) Close() { t.lock.Lock() if len(t.lines) > 0 { @@ -55,6 +68,10 @@ func (t *testHttpService) SetAuthorization(authorization string) { func (t *testHttpService) GetRequest(_ context.Context, _ string, _ ihttp.RequestCallback, _ ihttp.ResponseCallback) *ihttp.Error { return nil } +func (t *testHttpService) DoHttpRequest(req *http.Request, requestCallback ihttp.RequestCallback, _ ihttp.ResponseCallback) *ihttp.Error { + return nil +} + func (t *testHttpService) PostRequest(_ context.Context, url string, body io.Reader, requestCallback ihttp.RequestCallback, _ ihttp.ResponseCallback) *ihttp.Error { req, err := http.NewRequest("POST", url, nil) if err != nil { From 794b332531ccfd5b475f36f56956738bb0581a3c Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Thu, 16 Apr 2020 18:13:56 +0200 Subject: [PATCH 04/11] feat: added custom generated API client along with swagger copy and regenerated types --- domain/Readme.md | 17 + domain/client.gen.go | 29205 ++++++++++++++++++ domain/swagger.yml | 10829 +++++++ domain/templates/client-with-responses.tmpl | 86 + domain/templates/client.tmpl | 224 + domain/templates/imports.tmpl | 12 + domain/{types.go => types.gen.go} | 1904 +- go.mod | 1 + go.sum | 56 + 9 files changed, 42031 insertions(+), 303 deletions(-) create mode 100644 domain/Readme.md create mode 100644 domain/client.gen.go create mode 100644 domain/swagger.yml create mode 100644 domain/templates/client-with-responses.tmpl create mode 100644 domain/templates/client.tmpl create mode 100644 domain/templates/imports.tmpl rename domain/{types.go => types.gen.go} (73%) diff --git a/domain/Readme.md b/domain/Readme.md new file mode 100644 index 00000000..455df3cc --- /dev/null +++ b/domain/Readme.md @@ -0,0 +1,17 @@ +# Generated types and API client + +`swagger.yml` is copied from InfluxDB and customized. Must be periodically sync with latest changes + and types and client must be re-generated +## Install oapi generator +`git clone git@github.com:bonitoo-io/oapi-codegen.git` +`cd oapi-codegen` +`go build ./cmd/oapi-codegen/oapi-codegen.go` +## Generate +`cd domain` + +Generate types +`oapi-codegen -generate types -o types.gen.go -package domain swagger.yml` + +Generate client +`oapi-codegen -generate client -o client.gen.go -package domain -templates .\templates swagger.yml` + diff --git a/domain/client.gen.go b/domain/client.gen.go new file mode 100644 index 00000000..937d14d0 --- /dev/null +++ b/domain/client.gen.go @@ -0,0 +1,29205 @@ +// Package domain provides primitives to interact the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT. +package domain + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/deepmap/oapi-codegen/pkg/runtime" + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" + + ihttp "github.com/influxdata/influxdb-client-go/internal/http" +) + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + service ihttp.Service +} + +// Creates a new Client, with reasonable defaults +func NewClient(service ihttp.Service) *Client { + // create a client with sane default values + client := Client{ + service: service, + } + return &client +} + +// The interface specification for the client above. +type ClientInterface interface { + // GetRoutes request + GetRoutes(ctx context.Context, params *GetRoutesParams) (*http.Response, error) + + // GetAuthorizations request + GetAuthorizations(ctx context.Context, params *GetAuthorizationsParams) (*http.Response, error) + + // PostAuthorizations request with any body + PostAuthorizationsWithBody(ctx context.Context, params *PostAuthorizationsParams, contentType string, body io.Reader) (*http.Response, error) + + PostAuthorizations(ctx context.Context, params *PostAuthorizationsParams, body PostAuthorizationsJSONRequestBody) (*http.Response, error) + + // DeleteAuthorizationsID request + DeleteAuthorizationsID(ctx context.Context, authID string, params *DeleteAuthorizationsIDParams) (*http.Response, error) + + // GetAuthorizationsID request + GetAuthorizationsID(ctx context.Context, authID string, params *GetAuthorizationsIDParams) (*http.Response, error) + + // PatchAuthorizationsID request with any body + PatchAuthorizationsIDWithBody(ctx context.Context, authID string, params *PatchAuthorizationsIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchAuthorizationsID(ctx context.Context, authID string, params *PatchAuthorizationsIDParams, body PatchAuthorizationsIDJSONRequestBody) (*http.Response, error) + + // GetBuckets request + GetBuckets(ctx context.Context, params *GetBucketsParams) (*http.Response, error) + + // PostBuckets request with any body + PostBucketsWithBody(ctx context.Context, params *PostBucketsParams, contentType string, body io.Reader) (*http.Response, error) + + PostBuckets(ctx context.Context, params *PostBucketsParams, body PostBucketsJSONRequestBody) (*http.Response, error) + + // DeleteBucketsID request + DeleteBucketsID(ctx context.Context, bucketID string, params *DeleteBucketsIDParams) (*http.Response, error) + + // GetBucketsID request + GetBucketsID(ctx context.Context, bucketID string, params *GetBucketsIDParams) (*http.Response, error) + + // PatchBucketsID request with any body + PatchBucketsIDWithBody(ctx context.Context, bucketID string, params *PatchBucketsIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchBucketsID(ctx context.Context, bucketID string, params *PatchBucketsIDParams, body PatchBucketsIDJSONRequestBody) (*http.Response, error) + + // GetBucketsIDLabels request + GetBucketsIDLabels(ctx context.Context, bucketID string, params *GetBucketsIDLabelsParams) (*http.Response, error) + + // PostBucketsIDLabels request with any body + PostBucketsIDLabelsWithBody(ctx context.Context, bucketID string, params *PostBucketsIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostBucketsIDLabels(ctx context.Context, bucketID string, params *PostBucketsIDLabelsParams, body PostBucketsIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteBucketsIDLabelsID request + DeleteBucketsIDLabelsID(ctx context.Context, bucketID string, labelID string, params *DeleteBucketsIDLabelsIDParams) (*http.Response, error) + + // GetBucketsIDLogs request + GetBucketsIDLogs(ctx context.Context, bucketID string, params *GetBucketsIDLogsParams) (*http.Response, error) + + // GetBucketsIDMembers request + GetBucketsIDMembers(ctx context.Context, bucketID string, params *GetBucketsIDMembersParams) (*http.Response, error) + + // PostBucketsIDMembers request with any body + PostBucketsIDMembersWithBody(ctx context.Context, bucketID string, params *PostBucketsIDMembersParams, contentType string, body io.Reader) (*http.Response, error) + + PostBucketsIDMembers(ctx context.Context, bucketID string, params *PostBucketsIDMembersParams, body PostBucketsIDMembersJSONRequestBody) (*http.Response, error) + + // DeleteBucketsIDMembersID request + DeleteBucketsIDMembersID(ctx context.Context, bucketID string, userID string, params *DeleteBucketsIDMembersIDParams) (*http.Response, error) + + // GetBucketsIDOwners request + GetBucketsIDOwners(ctx context.Context, bucketID string, params *GetBucketsIDOwnersParams) (*http.Response, error) + + // PostBucketsIDOwners request with any body + PostBucketsIDOwnersWithBody(ctx context.Context, bucketID string, params *PostBucketsIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) + + PostBucketsIDOwners(ctx context.Context, bucketID string, params *PostBucketsIDOwnersParams, body PostBucketsIDOwnersJSONRequestBody) (*http.Response, error) + + // DeleteBucketsIDOwnersID request + DeleteBucketsIDOwnersID(ctx context.Context, bucketID string, userID string, params *DeleteBucketsIDOwnersIDParams) (*http.Response, error) + + // GetChecks request + GetChecks(ctx context.Context, params *GetChecksParams) (*http.Response, error) + + // CreateCheck request with any body + CreateCheckWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) + + CreateCheck(ctx context.Context, body CreateCheckJSONRequestBody) (*http.Response, error) + + // DeleteChecksID request + DeleteChecksID(ctx context.Context, checkID string, params *DeleteChecksIDParams) (*http.Response, error) + + // GetChecksID request + GetChecksID(ctx context.Context, checkID string, params *GetChecksIDParams) (*http.Response, error) + + // PatchChecksID request with any body + PatchChecksIDWithBody(ctx context.Context, checkID string, params *PatchChecksIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchChecksID(ctx context.Context, checkID string, params *PatchChecksIDParams, body PatchChecksIDJSONRequestBody) (*http.Response, error) + + // PutChecksID request with any body + PutChecksIDWithBody(ctx context.Context, checkID string, params *PutChecksIDParams, contentType string, body io.Reader) (*http.Response, error) + + PutChecksID(ctx context.Context, checkID string, params *PutChecksIDParams, body PutChecksIDJSONRequestBody) (*http.Response, error) + + // GetChecksIDLabels request + GetChecksIDLabels(ctx context.Context, checkID string, params *GetChecksIDLabelsParams) (*http.Response, error) + + // PostChecksIDLabels request with any body + PostChecksIDLabelsWithBody(ctx context.Context, checkID string, params *PostChecksIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostChecksIDLabels(ctx context.Context, checkID string, params *PostChecksIDLabelsParams, body PostChecksIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteChecksIDLabelsID request + DeleteChecksIDLabelsID(ctx context.Context, checkID string, labelID string, params *DeleteChecksIDLabelsIDParams) (*http.Response, error) + + // GetChecksIDQuery request + GetChecksIDQuery(ctx context.Context, checkID string, params *GetChecksIDQueryParams) (*http.Response, error) + + // GetDashboards request + GetDashboards(ctx context.Context, params *GetDashboardsParams) (*http.Response, error) + + // PostDashboards request with any body + PostDashboardsWithBody(ctx context.Context, params *PostDashboardsParams, contentType string, body io.Reader) (*http.Response, error) + + PostDashboards(ctx context.Context, params *PostDashboardsParams, body PostDashboardsJSONRequestBody) (*http.Response, error) + + // DeleteDashboardsID request + DeleteDashboardsID(ctx context.Context, dashboardID string, params *DeleteDashboardsIDParams) (*http.Response, error) + + // GetDashboardsID request + GetDashboardsID(ctx context.Context, dashboardID string, params *GetDashboardsIDParams) (*http.Response, error) + + // PatchDashboardsID request with any body + PatchDashboardsIDWithBody(ctx context.Context, dashboardID string, params *PatchDashboardsIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchDashboardsID(ctx context.Context, dashboardID string, params *PatchDashboardsIDParams, body PatchDashboardsIDJSONRequestBody) (*http.Response, error) + + // PostDashboardsIDCells request with any body + PostDashboardsIDCellsWithBody(ctx context.Context, dashboardID string, params *PostDashboardsIDCellsParams, contentType string, body io.Reader) (*http.Response, error) + + PostDashboardsIDCells(ctx context.Context, dashboardID string, params *PostDashboardsIDCellsParams, body PostDashboardsIDCellsJSONRequestBody) (*http.Response, error) + + // PutDashboardsIDCells request with any body + PutDashboardsIDCellsWithBody(ctx context.Context, dashboardID string, params *PutDashboardsIDCellsParams, contentType string, body io.Reader) (*http.Response, error) + + PutDashboardsIDCells(ctx context.Context, dashboardID string, params *PutDashboardsIDCellsParams, body PutDashboardsIDCellsJSONRequestBody) (*http.Response, error) + + // DeleteDashboardsIDCellsID request + DeleteDashboardsIDCellsID(ctx context.Context, dashboardID string, cellID string, params *DeleteDashboardsIDCellsIDParams) (*http.Response, error) + + // PatchDashboardsIDCellsID request with any body + PatchDashboardsIDCellsIDWithBody(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchDashboardsIDCellsID(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDParams, body PatchDashboardsIDCellsIDJSONRequestBody) (*http.Response, error) + + // GetDashboardsIDCellsIDView request + GetDashboardsIDCellsIDView(ctx context.Context, dashboardID string, cellID string, params *GetDashboardsIDCellsIDViewParams) (*http.Response, error) + + // PatchDashboardsIDCellsIDView request with any body + PatchDashboardsIDCellsIDViewWithBody(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDViewParams, contentType string, body io.Reader) (*http.Response, error) + + PatchDashboardsIDCellsIDView(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDViewParams, body PatchDashboardsIDCellsIDViewJSONRequestBody) (*http.Response, error) + + // GetDashboardsIDLabels request + GetDashboardsIDLabels(ctx context.Context, dashboardID string, params *GetDashboardsIDLabelsParams) (*http.Response, error) + + // PostDashboardsIDLabels request with any body + PostDashboardsIDLabelsWithBody(ctx context.Context, dashboardID string, params *PostDashboardsIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostDashboardsIDLabels(ctx context.Context, dashboardID string, params *PostDashboardsIDLabelsParams, body PostDashboardsIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteDashboardsIDLabelsID request + DeleteDashboardsIDLabelsID(ctx context.Context, dashboardID string, labelID string, params *DeleteDashboardsIDLabelsIDParams) (*http.Response, error) + + // GetDashboardsIDLogs request + GetDashboardsIDLogs(ctx context.Context, dashboardID string, params *GetDashboardsIDLogsParams) (*http.Response, error) + + // GetDashboardsIDMembers request + GetDashboardsIDMembers(ctx context.Context, dashboardID string, params *GetDashboardsIDMembersParams) (*http.Response, error) + + // PostDashboardsIDMembers request with any body + PostDashboardsIDMembersWithBody(ctx context.Context, dashboardID string, params *PostDashboardsIDMembersParams, contentType string, body io.Reader) (*http.Response, error) + + PostDashboardsIDMembers(ctx context.Context, dashboardID string, params *PostDashboardsIDMembersParams, body PostDashboardsIDMembersJSONRequestBody) (*http.Response, error) + + // DeleteDashboardsIDMembersID request + DeleteDashboardsIDMembersID(ctx context.Context, dashboardID string, userID string, params *DeleteDashboardsIDMembersIDParams) (*http.Response, error) + + // GetDashboardsIDOwners request + GetDashboardsIDOwners(ctx context.Context, dashboardID string, params *GetDashboardsIDOwnersParams) (*http.Response, error) + + // PostDashboardsIDOwners request with any body + PostDashboardsIDOwnersWithBody(ctx context.Context, dashboardID string, params *PostDashboardsIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) + + PostDashboardsIDOwners(ctx context.Context, dashboardID string, params *PostDashboardsIDOwnersParams, body PostDashboardsIDOwnersJSONRequestBody) (*http.Response, error) + + // DeleteDashboardsIDOwnersID request + DeleteDashboardsIDOwnersID(ctx context.Context, dashboardID string, userID string, params *DeleteDashboardsIDOwnersIDParams) (*http.Response, error) + + // PostDelete request with any body + PostDeleteWithBody(ctx context.Context, params *PostDeleteParams, contentType string, body io.Reader) (*http.Response, error) + + PostDelete(ctx context.Context, params *PostDeleteParams, body PostDeleteJSONRequestBody) (*http.Response, error) + + // GetDocumentsTemplates request + GetDocumentsTemplates(ctx context.Context, params *GetDocumentsTemplatesParams) (*http.Response, error) + + // PostDocumentsTemplates request with any body + PostDocumentsTemplatesWithBody(ctx context.Context, params *PostDocumentsTemplatesParams, contentType string, body io.Reader) (*http.Response, error) + + PostDocumentsTemplates(ctx context.Context, params *PostDocumentsTemplatesParams, body PostDocumentsTemplatesJSONRequestBody) (*http.Response, error) + + // DeleteDocumentsTemplatesID request + DeleteDocumentsTemplatesID(ctx context.Context, templateID string, params *DeleteDocumentsTemplatesIDParams) (*http.Response, error) + + // GetDocumentsTemplatesID request + GetDocumentsTemplatesID(ctx context.Context, templateID string, params *GetDocumentsTemplatesIDParams) (*http.Response, error) + + // PutDocumentsTemplatesID request with any body + PutDocumentsTemplatesIDWithBody(ctx context.Context, templateID string, params *PutDocumentsTemplatesIDParams, contentType string, body io.Reader) (*http.Response, error) + + PutDocumentsTemplatesID(ctx context.Context, templateID string, params *PutDocumentsTemplatesIDParams, body PutDocumentsTemplatesIDJSONRequestBody) (*http.Response, error) + + // GetDocumentsTemplatesIDLabels request + GetDocumentsTemplatesIDLabels(ctx context.Context, templateID string, params *GetDocumentsTemplatesIDLabelsParams) (*http.Response, error) + + // PostDocumentsTemplatesIDLabels request with any body + PostDocumentsTemplatesIDLabelsWithBody(ctx context.Context, templateID string, params *PostDocumentsTemplatesIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostDocumentsTemplatesIDLabels(ctx context.Context, templateID string, params *PostDocumentsTemplatesIDLabelsParams, body PostDocumentsTemplatesIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteDocumentsTemplatesIDLabelsID request + DeleteDocumentsTemplatesIDLabelsID(ctx context.Context, templateID string, labelID string, params *DeleteDocumentsTemplatesIDLabelsIDParams) (*http.Response, error) + + // GetHealth request + GetHealth(ctx context.Context, params *GetHealthParams) (*http.Response, error) + + // GetLabels request + GetLabels(ctx context.Context, params *GetLabelsParams) (*http.Response, error) + + // PostLabels request with any body + PostLabelsWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) + + PostLabels(ctx context.Context, body PostLabelsJSONRequestBody) (*http.Response, error) + + // DeleteLabelsID request + DeleteLabelsID(ctx context.Context, labelID string, params *DeleteLabelsIDParams) (*http.Response, error) + + // GetLabelsID request + GetLabelsID(ctx context.Context, labelID string, params *GetLabelsIDParams) (*http.Response, error) + + // PatchLabelsID request with any body + PatchLabelsIDWithBody(ctx context.Context, labelID string, params *PatchLabelsIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchLabelsID(ctx context.Context, labelID string, params *PatchLabelsIDParams, body PatchLabelsIDJSONRequestBody) (*http.Response, error) + + // GetMe request + GetMe(ctx context.Context, params *GetMeParams) (*http.Response, error) + + // PutMePassword request with any body + PutMePasswordWithBody(ctx context.Context, params *PutMePasswordParams, contentType string, body io.Reader) (*http.Response, error) + + PutMePassword(ctx context.Context, params *PutMePasswordParams, body PutMePasswordJSONRequestBody) (*http.Response, error) + + // GetNotificationEndpoints request + GetNotificationEndpoints(ctx context.Context, params *GetNotificationEndpointsParams) (*http.Response, error) + + // CreateNotificationEndpoint request with any body + CreateNotificationEndpointWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) + + CreateNotificationEndpoint(ctx context.Context, body CreateNotificationEndpointJSONRequestBody) (*http.Response, error) + + // DeleteNotificationEndpointsID request + DeleteNotificationEndpointsID(ctx context.Context, endpointID string, params *DeleteNotificationEndpointsIDParams) (*http.Response, error) + + // GetNotificationEndpointsID request + GetNotificationEndpointsID(ctx context.Context, endpointID string, params *GetNotificationEndpointsIDParams) (*http.Response, error) + + // PatchNotificationEndpointsID request with any body + PatchNotificationEndpointsIDWithBody(ctx context.Context, endpointID string, params *PatchNotificationEndpointsIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchNotificationEndpointsID(ctx context.Context, endpointID string, params *PatchNotificationEndpointsIDParams, body PatchNotificationEndpointsIDJSONRequestBody) (*http.Response, error) + + // PutNotificationEndpointsID request with any body + PutNotificationEndpointsIDWithBody(ctx context.Context, endpointID string, params *PutNotificationEndpointsIDParams, contentType string, body io.Reader) (*http.Response, error) + + PutNotificationEndpointsID(ctx context.Context, endpointID string, params *PutNotificationEndpointsIDParams, body PutNotificationEndpointsIDJSONRequestBody) (*http.Response, error) + + // GetNotificationEndpointsIDLabels request + GetNotificationEndpointsIDLabels(ctx context.Context, endpointID string, params *GetNotificationEndpointsIDLabelsParams) (*http.Response, error) + + // PostNotificationEndpointIDLabels request with any body + PostNotificationEndpointIDLabelsWithBody(ctx context.Context, endpointID string, params *PostNotificationEndpointIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostNotificationEndpointIDLabels(ctx context.Context, endpointID string, params *PostNotificationEndpointIDLabelsParams, body PostNotificationEndpointIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteNotificationEndpointsIDLabelsID request + DeleteNotificationEndpointsIDLabelsID(ctx context.Context, endpointID string, labelID string, params *DeleteNotificationEndpointsIDLabelsIDParams) (*http.Response, error) + + // GetNotificationRules request + GetNotificationRules(ctx context.Context, params *GetNotificationRulesParams) (*http.Response, error) + + // CreateNotificationRule request with any body + CreateNotificationRuleWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) + + CreateNotificationRule(ctx context.Context, body CreateNotificationRuleJSONRequestBody) (*http.Response, error) + + // DeleteNotificationRulesID request + DeleteNotificationRulesID(ctx context.Context, ruleID string, params *DeleteNotificationRulesIDParams) (*http.Response, error) + + // GetNotificationRulesID request + GetNotificationRulesID(ctx context.Context, ruleID string, params *GetNotificationRulesIDParams) (*http.Response, error) + + // PatchNotificationRulesID request with any body + PatchNotificationRulesIDWithBody(ctx context.Context, ruleID string, params *PatchNotificationRulesIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchNotificationRulesID(ctx context.Context, ruleID string, params *PatchNotificationRulesIDParams, body PatchNotificationRulesIDJSONRequestBody) (*http.Response, error) + + // PutNotificationRulesID request with any body + PutNotificationRulesIDWithBody(ctx context.Context, ruleID string, params *PutNotificationRulesIDParams, contentType string, body io.Reader) (*http.Response, error) + + PutNotificationRulesID(ctx context.Context, ruleID string, params *PutNotificationRulesIDParams, body PutNotificationRulesIDJSONRequestBody) (*http.Response, error) + + // GetNotificationRulesIDLabels request + GetNotificationRulesIDLabels(ctx context.Context, ruleID string, params *GetNotificationRulesIDLabelsParams) (*http.Response, error) + + // PostNotificationRuleIDLabels request with any body + PostNotificationRuleIDLabelsWithBody(ctx context.Context, ruleID string, params *PostNotificationRuleIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostNotificationRuleIDLabels(ctx context.Context, ruleID string, params *PostNotificationRuleIDLabelsParams, body PostNotificationRuleIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteNotificationRulesIDLabelsID request + DeleteNotificationRulesIDLabelsID(ctx context.Context, ruleID string, labelID string, params *DeleteNotificationRulesIDLabelsIDParams) (*http.Response, error) + + // GetNotificationRulesIDQuery request + GetNotificationRulesIDQuery(ctx context.Context, ruleID string, params *GetNotificationRulesIDQueryParams) (*http.Response, error) + + // GetOrgs request + GetOrgs(ctx context.Context, params *GetOrgsParams) (*http.Response, error) + + // PostOrgs request with any body + PostOrgsWithBody(ctx context.Context, params *PostOrgsParams, contentType string, body io.Reader) (*http.Response, error) + + PostOrgs(ctx context.Context, params *PostOrgsParams, body PostOrgsJSONRequestBody) (*http.Response, error) + + // DeleteOrgsID request + DeleteOrgsID(ctx context.Context, orgID string, params *DeleteOrgsIDParams) (*http.Response, error) + + // GetOrgsID request + GetOrgsID(ctx context.Context, orgID string, params *GetOrgsIDParams) (*http.Response, error) + + // PatchOrgsID request with any body + PatchOrgsIDWithBody(ctx context.Context, orgID string, params *PatchOrgsIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchOrgsID(ctx context.Context, orgID string, params *PatchOrgsIDParams, body PatchOrgsIDJSONRequestBody) (*http.Response, error) + + // GetOrgsIDLabels request + GetOrgsIDLabels(ctx context.Context, orgID string, params *GetOrgsIDLabelsParams) (*http.Response, error) + + // PostOrgsIDLabels request with any body + PostOrgsIDLabelsWithBody(ctx context.Context, orgID string, params *PostOrgsIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostOrgsIDLabels(ctx context.Context, orgID string, params *PostOrgsIDLabelsParams, body PostOrgsIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteOrgsIDLabelsID request + DeleteOrgsIDLabelsID(ctx context.Context, orgID string, labelID string, params *DeleteOrgsIDLabelsIDParams) (*http.Response, error) + + // GetOrgsIDLogs request + GetOrgsIDLogs(ctx context.Context, orgID string, params *GetOrgsIDLogsParams) (*http.Response, error) + + // GetOrgsIDMembers request + GetOrgsIDMembers(ctx context.Context, orgID string, params *GetOrgsIDMembersParams) (*http.Response, error) + + // PostOrgsIDMembers request with any body + PostOrgsIDMembersWithBody(ctx context.Context, orgID string, params *PostOrgsIDMembersParams, contentType string, body io.Reader) (*http.Response, error) + + PostOrgsIDMembers(ctx context.Context, orgID string, params *PostOrgsIDMembersParams, body PostOrgsIDMembersJSONRequestBody) (*http.Response, error) + + // DeleteOrgsIDMembersID request + DeleteOrgsIDMembersID(ctx context.Context, orgID string, userID string, params *DeleteOrgsIDMembersIDParams) (*http.Response, error) + + // GetOrgsIDOwners request + GetOrgsIDOwners(ctx context.Context, orgID string, params *GetOrgsIDOwnersParams) (*http.Response, error) + + // PostOrgsIDOwners request with any body + PostOrgsIDOwnersWithBody(ctx context.Context, orgID string, params *PostOrgsIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) + + PostOrgsIDOwners(ctx context.Context, orgID string, params *PostOrgsIDOwnersParams, body PostOrgsIDOwnersJSONRequestBody) (*http.Response, error) + + // DeleteOrgsIDOwnersID request + DeleteOrgsIDOwnersID(ctx context.Context, orgID string, userID string, params *DeleteOrgsIDOwnersIDParams) (*http.Response, error) + + // GetOrgsIDSecrets request + GetOrgsIDSecrets(ctx context.Context, orgID string, params *GetOrgsIDSecretsParams) (*http.Response, error) + + // PatchOrgsIDSecrets request with any body + PatchOrgsIDSecretsWithBody(ctx context.Context, orgID string, params *PatchOrgsIDSecretsParams, contentType string, body io.Reader) (*http.Response, error) + + PatchOrgsIDSecrets(ctx context.Context, orgID string, params *PatchOrgsIDSecretsParams, body PatchOrgsIDSecretsJSONRequestBody) (*http.Response, error) + + // PostOrgsIDSecrets request with any body + PostOrgsIDSecretsWithBody(ctx context.Context, orgID string, params *PostOrgsIDSecretsParams, contentType string, body io.Reader) (*http.Response, error) + + PostOrgsIDSecrets(ctx context.Context, orgID string, params *PostOrgsIDSecretsParams, body PostOrgsIDSecretsJSONRequestBody) (*http.Response, error) + + // CreatePkg request with any body + CreatePkgWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) + + CreatePkg(ctx context.Context, body CreatePkgJSONRequestBody) (*http.Response, error) + + // ApplyPkg request with any body + ApplyPkgWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) + + ApplyPkg(ctx context.Context, body ApplyPkgJSONRequestBody) (*http.Response, error) + + // PostQuery request with any body + PostQueryWithBody(ctx context.Context, params *PostQueryParams, contentType string, body io.Reader) (*http.Response, error) + + PostQuery(ctx context.Context, params *PostQueryParams, body PostQueryJSONRequestBody) (*http.Response, error) + + // PostQueryAnalyze request with any body + PostQueryAnalyzeWithBody(ctx context.Context, params *PostQueryAnalyzeParams, contentType string, body io.Reader) (*http.Response, error) + + PostQueryAnalyze(ctx context.Context, params *PostQueryAnalyzeParams, body PostQueryAnalyzeJSONRequestBody) (*http.Response, error) + + // PostQueryAst request with any body + PostQueryAstWithBody(ctx context.Context, params *PostQueryAstParams, contentType string, body io.Reader) (*http.Response, error) + + PostQueryAst(ctx context.Context, params *PostQueryAstParams, body PostQueryAstJSONRequestBody) (*http.Response, error) + + // GetQuerySuggestions request + GetQuerySuggestions(ctx context.Context, params *GetQuerySuggestionsParams) (*http.Response, error) + + // GetQuerySuggestionsName request + GetQuerySuggestionsName(ctx context.Context, name string, params *GetQuerySuggestionsNameParams) (*http.Response, error) + + // GetReady request + GetReady(ctx context.Context, params *GetReadyParams) (*http.Response, error) + + // GetScrapers request + GetScrapers(ctx context.Context, params *GetScrapersParams) (*http.Response, error) + + // PostScrapers request with any body + PostScrapersWithBody(ctx context.Context, params *PostScrapersParams, contentType string, body io.Reader) (*http.Response, error) + + PostScrapers(ctx context.Context, params *PostScrapersParams, body PostScrapersJSONRequestBody) (*http.Response, error) + + // DeleteScrapersID request + DeleteScrapersID(ctx context.Context, scraperTargetID string, params *DeleteScrapersIDParams) (*http.Response, error) + + // GetScrapersID request + GetScrapersID(ctx context.Context, scraperTargetID string, params *GetScrapersIDParams) (*http.Response, error) + + // PatchScrapersID request with any body + PatchScrapersIDWithBody(ctx context.Context, scraperTargetID string, params *PatchScrapersIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchScrapersID(ctx context.Context, scraperTargetID string, params *PatchScrapersIDParams, body PatchScrapersIDJSONRequestBody) (*http.Response, error) + + // GetScrapersIDLabels request + GetScrapersIDLabels(ctx context.Context, scraperTargetID string, params *GetScrapersIDLabelsParams) (*http.Response, error) + + // PostScrapersIDLabels request with any body + PostScrapersIDLabelsWithBody(ctx context.Context, scraperTargetID string, params *PostScrapersIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostScrapersIDLabels(ctx context.Context, scraperTargetID string, params *PostScrapersIDLabelsParams, body PostScrapersIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteScrapersIDLabelsID request + DeleteScrapersIDLabelsID(ctx context.Context, scraperTargetID string, labelID string, params *DeleteScrapersIDLabelsIDParams) (*http.Response, error) + + // PatchScrapersIDLabelsID request with any body + PatchScrapersIDLabelsIDWithBody(ctx context.Context, scraperTargetID string, labelID string, params *PatchScrapersIDLabelsIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchScrapersIDLabelsID(ctx context.Context, scraperTargetID string, labelID string, params *PatchScrapersIDLabelsIDParams, body PatchScrapersIDLabelsIDJSONRequestBody) (*http.Response, error) + + // GetScrapersIDMembers request + GetScrapersIDMembers(ctx context.Context, scraperTargetID string, params *GetScrapersIDMembersParams) (*http.Response, error) + + // PostScrapersIDMembers request with any body + PostScrapersIDMembersWithBody(ctx context.Context, scraperTargetID string, params *PostScrapersIDMembersParams, contentType string, body io.Reader) (*http.Response, error) + + PostScrapersIDMembers(ctx context.Context, scraperTargetID string, params *PostScrapersIDMembersParams, body PostScrapersIDMembersJSONRequestBody) (*http.Response, error) + + // DeleteScrapersIDMembersID request + DeleteScrapersIDMembersID(ctx context.Context, scraperTargetID string, userID string, params *DeleteScrapersIDMembersIDParams) (*http.Response, error) + + // GetScrapersIDOwners request + GetScrapersIDOwners(ctx context.Context, scraperTargetID string, params *GetScrapersIDOwnersParams) (*http.Response, error) + + // PostScrapersIDOwners request with any body + PostScrapersIDOwnersWithBody(ctx context.Context, scraperTargetID string, params *PostScrapersIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) + + PostScrapersIDOwners(ctx context.Context, scraperTargetID string, params *PostScrapersIDOwnersParams, body PostScrapersIDOwnersJSONRequestBody) (*http.Response, error) + + // DeleteScrapersIDOwnersID request + DeleteScrapersIDOwnersID(ctx context.Context, scraperTargetID string, userID string, params *DeleteScrapersIDOwnersIDParams) (*http.Response, error) + + // GetSetup request + GetSetup(ctx context.Context, params *GetSetupParams) (*http.Response, error) + + // PostSetup request with any body + PostSetupWithBody(ctx context.Context, params *PostSetupParams, contentType string, body io.Reader) (*http.Response, error) + + PostSetup(ctx context.Context, params *PostSetupParams, body PostSetupJSONRequestBody) (*http.Response, error) + + // PostSignin request + PostSignin(ctx context.Context, params *PostSigninParams) (*http.Response, error) + + // PostSignout request + PostSignout(ctx context.Context, params *PostSignoutParams) (*http.Response, error) + + // GetSources request + GetSources(ctx context.Context, params *GetSourcesParams) (*http.Response, error) + + // PostSources request with any body + PostSourcesWithBody(ctx context.Context, params *PostSourcesParams, contentType string, body io.Reader) (*http.Response, error) + + PostSources(ctx context.Context, params *PostSourcesParams, body PostSourcesJSONRequestBody) (*http.Response, error) + + // DeleteSourcesID request + DeleteSourcesID(ctx context.Context, sourceID string, params *DeleteSourcesIDParams) (*http.Response, error) + + // GetSourcesID request + GetSourcesID(ctx context.Context, sourceID string, params *GetSourcesIDParams) (*http.Response, error) + + // PatchSourcesID request with any body + PatchSourcesIDWithBody(ctx context.Context, sourceID string, params *PatchSourcesIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchSourcesID(ctx context.Context, sourceID string, params *PatchSourcesIDParams, body PatchSourcesIDJSONRequestBody) (*http.Response, error) + + // GetSourcesIDBuckets request + GetSourcesIDBuckets(ctx context.Context, sourceID string, params *GetSourcesIDBucketsParams) (*http.Response, error) + + // GetSourcesIDHealth request + GetSourcesIDHealth(ctx context.Context, sourceID string, params *GetSourcesIDHealthParams) (*http.Response, error) + + // GetTasks request + GetTasks(ctx context.Context, params *GetTasksParams) (*http.Response, error) + + // PostTasks request with any body + PostTasksWithBody(ctx context.Context, params *PostTasksParams, contentType string, body io.Reader) (*http.Response, error) + + PostTasks(ctx context.Context, params *PostTasksParams, body PostTasksJSONRequestBody) (*http.Response, error) + + // DeleteTasksID request + DeleteTasksID(ctx context.Context, taskID string, params *DeleteTasksIDParams) (*http.Response, error) + + // GetTasksID request + GetTasksID(ctx context.Context, taskID string, params *GetTasksIDParams) (*http.Response, error) + + // PatchTasksID request with any body + PatchTasksIDWithBody(ctx context.Context, taskID string, params *PatchTasksIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchTasksID(ctx context.Context, taskID string, params *PatchTasksIDParams, body PatchTasksIDJSONRequestBody) (*http.Response, error) + + // GetTasksIDLabels request + GetTasksIDLabels(ctx context.Context, taskID string, params *GetTasksIDLabelsParams) (*http.Response, error) + + // PostTasksIDLabels request with any body + PostTasksIDLabelsWithBody(ctx context.Context, taskID string, params *PostTasksIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostTasksIDLabels(ctx context.Context, taskID string, params *PostTasksIDLabelsParams, body PostTasksIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteTasksIDLabelsID request + DeleteTasksIDLabelsID(ctx context.Context, taskID string, labelID string, params *DeleteTasksIDLabelsIDParams) (*http.Response, error) + + // GetTasksIDLogs request + GetTasksIDLogs(ctx context.Context, taskID string, params *GetTasksIDLogsParams) (*http.Response, error) + + // GetTasksIDMembers request + GetTasksIDMembers(ctx context.Context, taskID string, params *GetTasksIDMembersParams) (*http.Response, error) + + // PostTasksIDMembers request with any body + PostTasksIDMembersWithBody(ctx context.Context, taskID string, params *PostTasksIDMembersParams, contentType string, body io.Reader) (*http.Response, error) + + PostTasksIDMembers(ctx context.Context, taskID string, params *PostTasksIDMembersParams, body PostTasksIDMembersJSONRequestBody) (*http.Response, error) + + // DeleteTasksIDMembersID request + DeleteTasksIDMembersID(ctx context.Context, taskID string, userID string, params *DeleteTasksIDMembersIDParams) (*http.Response, error) + + // GetTasksIDOwners request + GetTasksIDOwners(ctx context.Context, taskID string, params *GetTasksIDOwnersParams) (*http.Response, error) + + // PostTasksIDOwners request with any body + PostTasksIDOwnersWithBody(ctx context.Context, taskID string, params *PostTasksIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) + + PostTasksIDOwners(ctx context.Context, taskID string, params *PostTasksIDOwnersParams, body PostTasksIDOwnersJSONRequestBody) (*http.Response, error) + + // DeleteTasksIDOwnersID request + DeleteTasksIDOwnersID(ctx context.Context, taskID string, userID string, params *DeleteTasksIDOwnersIDParams) (*http.Response, error) + + // GetTasksIDRuns request + GetTasksIDRuns(ctx context.Context, taskID string, params *GetTasksIDRunsParams) (*http.Response, error) + + // PostTasksIDRuns request with any body + PostTasksIDRunsWithBody(ctx context.Context, taskID string, params *PostTasksIDRunsParams, contentType string, body io.Reader) (*http.Response, error) + + PostTasksIDRuns(ctx context.Context, taskID string, params *PostTasksIDRunsParams, body PostTasksIDRunsJSONRequestBody) (*http.Response, error) + + // DeleteTasksIDRunsID request + DeleteTasksIDRunsID(ctx context.Context, taskID string, runID string, params *DeleteTasksIDRunsIDParams) (*http.Response, error) + + // GetTasksIDRunsID request + GetTasksIDRunsID(ctx context.Context, taskID string, runID string, params *GetTasksIDRunsIDParams) (*http.Response, error) + + // GetTasksIDRunsIDLogs request + GetTasksIDRunsIDLogs(ctx context.Context, taskID string, runID string, params *GetTasksIDRunsIDLogsParams) (*http.Response, error) + + // PostTasksIDRunsIDRetry request + PostTasksIDRunsIDRetry(ctx context.Context, taskID string, runID string, params *PostTasksIDRunsIDRetryParams) (*http.Response, error) + + // GetTelegrafPlugins request + GetTelegrafPlugins(ctx context.Context, params *GetTelegrafPluginsParams) (*http.Response, error) + + // GetTelegrafs request + GetTelegrafs(ctx context.Context, params *GetTelegrafsParams) (*http.Response, error) + + // PostTelegrafs request with any body + PostTelegrafsWithBody(ctx context.Context, params *PostTelegrafsParams, contentType string, body io.Reader) (*http.Response, error) + + PostTelegrafs(ctx context.Context, params *PostTelegrafsParams, body PostTelegrafsJSONRequestBody) (*http.Response, error) + + // DeleteTelegrafsID request + DeleteTelegrafsID(ctx context.Context, telegrafID string, params *DeleteTelegrafsIDParams) (*http.Response, error) + + // GetTelegrafsID request + GetTelegrafsID(ctx context.Context, telegrafID string, params *GetTelegrafsIDParams) (*http.Response, error) + + // PutTelegrafsID request with any body + PutTelegrafsIDWithBody(ctx context.Context, telegrafID string, params *PutTelegrafsIDParams, contentType string, body io.Reader) (*http.Response, error) + + PutTelegrafsID(ctx context.Context, telegrafID string, params *PutTelegrafsIDParams, body PutTelegrafsIDJSONRequestBody) (*http.Response, error) + + // GetTelegrafsIDLabels request + GetTelegrafsIDLabels(ctx context.Context, telegrafID string, params *GetTelegrafsIDLabelsParams) (*http.Response, error) + + // PostTelegrafsIDLabels request with any body + PostTelegrafsIDLabelsWithBody(ctx context.Context, telegrafID string, params *PostTelegrafsIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostTelegrafsIDLabels(ctx context.Context, telegrafID string, params *PostTelegrafsIDLabelsParams, body PostTelegrafsIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteTelegrafsIDLabelsID request + DeleteTelegrafsIDLabelsID(ctx context.Context, telegrafID string, labelID string, params *DeleteTelegrafsIDLabelsIDParams) (*http.Response, error) + + // GetTelegrafsIDMembers request + GetTelegrafsIDMembers(ctx context.Context, telegrafID string, params *GetTelegrafsIDMembersParams) (*http.Response, error) + + // PostTelegrafsIDMembers request with any body + PostTelegrafsIDMembersWithBody(ctx context.Context, telegrafID string, params *PostTelegrafsIDMembersParams, contentType string, body io.Reader) (*http.Response, error) + + PostTelegrafsIDMembers(ctx context.Context, telegrafID string, params *PostTelegrafsIDMembersParams, body PostTelegrafsIDMembersJSONRequestBody) (*http.Response, error) + + // DeleteTelegrafsIDMembersID request + DeleteTelegrafsIDMembersID(ctx context.Context, telegrafID string, userID string, params *DeleteTelegrafsIDMembersIDParams) (*http.Response, error) + + // GetTelegrafsIDOwners request + GetTelegrafsIDOwners(ctx context.Context, telegrafID string, params *GetTelegrafsIDOwnersParams) (*http.Response, error) + + // PostTelegrafsIDOwners request with any body + PostTelegrafsIDOwnersWithBody(ctx context.Context, telegrafID string, params *PostTelegrafsIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) + + PostTelegrafsIDOwners(ctx context.Context, telegrafID string, params *PostTelegrafsIDOwnersParams, body PostTelegrafsIDOwnersJSONRequestBody) (*http.Response, error) + + // DeleteTelegrafsIDOwnersID request + DeleteTelegrafsIDOwnersID(ctx context.Context, telegrafID string, userID string, params *DeleteTelegrafsIDOwnersIDParams) (*http.Response, error) + + // GetUsers request + GetUsers(ctx context.Context, params *GetUsersParams) (*http.Response, error) + + // PostUsers request with any body + PostUsersWithBody(ctx context.Context, params *PostUsersParams, contentType string, body io.Reader) (*http.Response, error) + + PostUsers(ctx context.Context, params *PostUsersParams, body PostUsersJSONRequestBody) (*http.Response, error) + + // DeleteUsersID request + DeleteUsersID(ctx context.Context, userID string, params *DeleteUsersIDParams) (*http.Response, error) + + // GetUsersID request + GetUsersID(ctx context.Context, userID string, params *GetUsersIDParams) (*http.Response, error) + + // PatchUsersID request with any body + PatchUsersIDWithBody(ctx context.Context, userID string, params *PatchUsersIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchUsersID(ctx context.Context, userID string, params *PatchUsersIDParams, body PatchUsersIDJSONRequestBody) (*http.Response, error) + + // GetUsersIDLogs request + GetUsersIDLogs(ctx context.Context, userID string, params *GetUsersIDLogsParams) (*http.Response, error) + + // PutUsersIDPassword request with any body + PutUsersIDPasswordWithBody(ctx context.Context, userID string, params *PutUsersIDPasswordParams, contentType string, body io.Reader) (*http.Response, error) + + PutUsersIDPassword(ctx context.Context, userID string, params *PutUsersIDPasswordParams, body PutUsersIDPasswordJSONRequestBody) (*http.Response, error) + + // GetVariables request + GetVariables(ctx context.Context, params *GetVariablesParams) (*http.Response, error) + + // PostVariables request with any body + PostVariablesWithBody(ctx context.Context, params *PostVariablesParams, contentType string, body io.Reader) (*http.Response, error) + + PostVariables(ctx context.Context, params *PostVariablesParams, body PostVariablesJSONRequestBody) (*http.Response, error) + + // DeleteVariablesID request + DeleteVariablesID(ctx context.Context, variableID string, params *DeleteVariablesIDParams) (*http.Response, error) + + // GetVariablesID request + GetVariablesID(ctx context.Context, variableID string, params *GetVariablesIDParams) (*http.Response, error) + + // PatchVariablesID request with any body + PatchVariablesIDWithBody(ctx context.Context, variableID string, params *PatchVariablesIDParams, contentType string, body io.Reader) (*http.Response, error) + + PatchVariablesID(ctx context.Context, variableID string, params *PatchVariablesIDParams, body PatchVariablesIDJSONRequestBody) (*http.Response, error) + + // PutVariablesID request with any body + PutVariablesIDWithBody(ctx context.Context, variableID string, params *PutVariablesIDParams, contentType string, body io.Reader) (*http.Response, error) + + PutVariablesID(ctx context.Context, variableID string, params *PutVariablesIDParams, body PutVariablesIDJSONRequestBody) (*http.Response, error) + + // GetVariablesIDLabels request + GetVariablesIDLabels(ctx context.Context, variableID string, params *GetVariablesIDLabelsParams) (*http.Response, error) + + // PostVariablesIDLabels request with any body + PostVariablesIDLabelsWithBody(ctx context.Context, variableID string, params *PostVariablesIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) + + PostVariablesIDLabels(ctx context.Context, variableID string, params *PostVariablesIDLabelsParams, body PostVariablesIDLabelsJSONRequestBody) (*http.Response, error) + + // DeleteVariablesIDLabelsID request + DeleteVariablesIDLabelsID(ctx context.Context, variableID string, labelID string, params *DeleteVariablesIDLabelsIDParams) (*http.Response, error) + + // PostWrite request with any body + PostWriteWithBody(ctx context.Context, params *PostWriteParams, contentType string, body io.Reader) (*http.Response, error) +} + +func (c *Client) GetRoutes(ctx context.Context, params *GetRoutesParams) (*http.Response, error) { + req, err := NewGetRoutesRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetAuthorizations(ctx context.Context, params *GetAuthorizationsParams) (*http.Response, error) { + req, err := NewGetAuthorizationsRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostAuthorizationsWithBody(ctx context.Context, params *PostAuthorizationsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostAuthorizationsRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostAuthorizations(ctx context.Context, params *PostAuthorizationsParams, body PostAuthorizationsJSONRequestBody) (*http.Response, error) { + req, err := NewPostAuthorizationsRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteAuthorizationsID(ctx context.Context, authID string, params *DeleteAuthorizationsIDParams) (*http.Response, error) { + req, err := NewDeleteAuthorizationsIDRequest(c.service.ServerApiUrl(), authID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetAuthorizationsID(ctx context.Context, authID string, params *GetAuthorizationsIDParams) (*http.Response, error) { + req, err := NewGetAuthorizationsIDRequest(c.service.ServerApiUrl(), authID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchAuthorizationsIDWithBody(ctx context.Context, authID string, params *PatchAuthorizationsIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchAuthorizationsIDRequestWithBody(c.service.ServerApiUrl(), authID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchAuthorizationsID(ctx context.Context, authID string, params *PatchAuthorizationsIDParams, body PatchAuthorizationsIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchAuthorizationsIDRequest(c.service.ServerApiUrl(), authID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetBuckets(ctx context.Context, params *GetBucketsParams) (*http.Response, error) { + req, err := NewGetBucketsRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostBucketsWithBody(ctx context.Context, params *PostBucketsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostBucketsRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostBuckets(ctx context.Context, params *PostBucketsParams, body PostBucketsJSONRequestBody) (*http.Response, error) { + req, err := NewPostBucketsRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteBucketsID(ctx context.Context, bucketID string, params *DeleteBucketsIDParams) (*http.Response, error) { + req, err := NewDeleteBucketsIDRequest(c.service.ServerApiUrl(), bucketID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetBucketsID(ctx context.Context, bucketID string, params *GetBucketsIDParams) (*http.Response, error) { + req, err := NewGetBucketsIDRequest(c.service.ServerApiUrl(), bucketID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchBucketsIDWithBody(ctx context.Context, bucketID string, params *PatchBucketsIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchBucketsIDRequestWithBody(c.service.ServerApiUrl(), bucketID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchBucketsID(ctx context.Context, bucketID string, params *PatchBucketsIDParams, body PatchBucketsIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchBucketsIDRequest(c.service.ServerApiUrl(), bucketID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetBucketsIDLabels(ctx context.Context, bucketID string, params *GetBucketsIDLabelsParams) (*http.Response, error) { + req, err := NewGetBucketsIDLabelsRequest(c.service.ServerApiUrl(), bucketID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostBucketsIDLabelsWithBody(ctx context.Context, bucketID string, params *PostBucketsIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostBucketsIDLabelsRequestWithBody(c.service.ServerApiUrl(), bucketID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostBucketsIDLabels(ctx context.Context, bucketID string, params *PostBucketsIDLabelsParams, body PostBucketsIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostBucketsIDLabelsRequest(c.service.ServerApiUrl(), bucketID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteBucketsIDLabelsID(ctx context.Context, bucketID string, labelID string, params *DeleteBucketsIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteBucketsIDLabelsIDRequest(c.service.ServerApiUrl(), bucketID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetBucketsIDLogs(ctx context.Context, bucketID string, params *GetBucketsIDLogsParams) (*http.Response, error) { + req, err := NewGetBucketsIDLogsRequest(c.service.ServerApiUrl(), bucketID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetBucketsIDMembers(ctx context.Context, bucketID string, params *GetBucketsIDMembersParams) (*http.Response, error) { + req, err := NewGetBucketsIDMembersRequest(c.service.ServerApiUrl(), bucketID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostBucketsIDMembersWithBody(ctx context.Context, bucketID string, params *PostBucketsIDMembersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostBucketsIDMembersRequestWithBody(c.service.ServerApiUrl(), bucketID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostBucketsIDMembers(ctx context.Context, bucketID string, params *PostBucketsIDMembersParams, body PostBucketsIDMembersJSONRequestBody) (*http.Response, error) { + req, err := NewPostBucketsIDMembersRequest(c.service.ServerApiUrl(), bucketID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteBucketsIDMembersID(ctx context.Context, bucketID string, userID string, params *DeleteBucketsIDMembersIDParams) (*http.Response, error) { + req, err := NewDeleteBucketsIDMembersIDRequest(c.service.ServerApiUrl(), bucketID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetBucketsIDOwners(ctx context.Context, bucketID string, params *GetBucketsIDOwnersParams) (*http.Response, error) { + req, err := NewGetBucketsIDOwnersRequest(c.service.ServerApiUrl(), bucketID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostBucketsIDOwnersWithBody(ctx context.Context, bucketID string, params *PostBucketsIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostBucketsIDOwnersRequestWithBody(c.service.ServerApiUrl(), bucketID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostBucketsIDOwners(ctx context.Context, bucketID string, params *PostBucketsIDOwnersParams, body PostBucketsIDOwnersJSONRequestBody) (*http.Response, error) { + req, err := NewPostBucketsIDOwnersRequest(c.service.ServerApiUrl(), bucketID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteBucketsIDOwnersID(ctx context.Context, bucketID string, userID string, params *DeleteBucketsIDOwnersIDParams) (*http.Response, error) { + req, err := NewDeleteBucketsIDOwnersIDRequest(c.service.ServerApiUrl(), bucketID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetChecks(ctx context.Context, params *GetChecksParams) (*http.Response, error) { + req, err := NewGetChecksRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) CreateCheckWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewCreateCheckRequestWithBody(c.service.ServerApiUrl(), contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) CreateCheck(ctx context.Context, body CreateCheckJSONRequestBody) (*http.Response, error) { + req, err := NewCreateCheckRequest(c.service.ServerApiUrl(), body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteChecksID(ctx context.Context, checkID string, params *DeleteChecksIDParams) (*http.Response, error) { + req, err := NewDeleteChecksIDRequest(c.service.ServerApiUrl(), checkID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetChecksID(ctx context.Context, checkID string, params *GetChecksIDParams) (*http.Response, error) { + req, err := NewGetChecksIDRequest(c.service.ServerApiUrl(), checkID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchChecksIDWithBody(ctx context.Context, checkID string, params *PatchChecksIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchChecksIDRequestWithBody(c.service.ServerApiUrl(), checkID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchChecksID(ctx context.Context, checkID string, params *PatchChecksIDParams, body PatchChecksIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchChecksIDRequest(c.service.ServerApiUrl(), checkID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutChecksIDWithBody(ctx context.Context, checkID string, params *PutChecksIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPutChecksIDRequestWithBody(c.service.ServerApiUrl(), checkID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutChecksID(ctx context.Context, checkID string, params *PutChecksIDParams, body PutChecksIDJSONRequestBody) (*http.Response, error) { + req, err := NewPutChecksIDRequest(c.service.ServerApiUrl(), checkID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetChecksIDLabels(ctx context.Context, checkID string, params *GetChecksIDLabelsParams) (*http.Response, error) { + req, err := NewGetChecksIDLabelsRequest(c.service.ServerApiUrl(), checkID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostChecksIDLabelsWithBody(ctx context.Context, checkID string, params *PostChecksIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostChecksIDLabelsRequestWithBody(c.service.ServerApiUrl(), checkID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostChecksIDLabels(ctx context.Context, checkID string, params *PostChecksIDLabelsParams, body PostChecksIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostChecksIDLabelsRequest(c.service.ServerApiUrl(), checkID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteChecksIDLabelsID(ctx context.Context, checkID string, labelID string, params *DeleteChecksIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteChecksIDLabelsIDRequest(c.service.ServerApiUrl(), checkID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetChecksIDQuery(ctx context.Context, checkID string, params *GetChecksIDQueryParams) (*http.Response, error) { + req, err := NewGetChecksIDQueryRequest(c.service.ServerApiUrl(), checkID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetDashboards(ctx context.Context, params *GetDashboardsParams) (*http.Response, error) { + req, err := NewGetDashboardsRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDashboardsWithBody(ctx context.Context, params *PostDashboardsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostDashboardsRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDashboards(ctx context.Context, params *PostDashboardsParams, body PostDashboardsJSONRequestBody) (*http.Response, error) { + req, err := NewPostDashboardsRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteDashboardsID(ctx context.Context, dashboardID string, params *DeleteDashboardsIDParams) (*http.Response, error) { + req, err := NewDeleteDashboardsIDRequest(c.service.ServerApiUrl(), dashboardID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetDashboardsID(ctx context.Context, dashboardID string, params *GetDashboardsIDParams) (*http.Response, error) { + req, err := NewGetDashboardsIDRequest(c.service.ServerApiUrl(), dashboardID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchDashboardsIDWithBody(ctx context.Context, dashboardID string, params *PatchDashboardsIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchDashboardsIDRequestWithBody(c.service.ServerApiUrl(), dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchDashboardsID(ctx context.Context, dashboardID string, params *PatchDashboardsIDParams, body PatchDashboardsIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchDashboardsIDRequest(c.service.ServerApiUrl(), dashboardID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDashboardsIDCellsWithBody(ctx context.Context, dashboardID string, params *PostDashboardsIDCellsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostDashboardsIDCellsRequestWithBody(c.service.ServerApiUrl(), dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDashboardsIDCells(ctx context.Context, dashboardID string, params *PostDashboardsIDCellsParams, body PostDashboardsIDCellsJSONRequestBody) (*http.Response, error) { + req, err := NewPostDashboardsIDCellsRequest(c.service.ServerApiUrl(), dashboardID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutDashboardsIDCellsWithBody(ctx context.Context, dashboardID string, params *PutDashboardsIDCellsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPutDashboardsIDCellsRequestWithBody(c.service.ServerApiUrl(), dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutDashboardsIDCells(ctx context.Context, dashboardID string, params *PutDashboardsIDCellsParams, body PutDashboardsIDCellsJSONRequestBody) (*http.Response, error) { + req, err := NewPutDashboardsIDCellsRequest(c.service.ServerApiUrl(), dashboardID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteDashboardsIDCellsID(ctx context.Context, dashboardID string, cellID string, params *DeleteDashboardsIDCellsIDParams) (*http.Response, error) { + req, err := NewDeleteDashboardsIDCellsIDRequest(c.service.ServerApiUrl(), dashboardID, cellID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchDashboardsIDCellsIDWithBody(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchDashboardsIDCellsIDRequestWithBody(c.service.ServerApiUrl(), dashboardID, cellID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchDashboardsIDCellsID(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDParams, body PatchDashboardsIDCellsIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchDashboardsIDCellsIDRequest(c.service.ServerApiUrl(), dashboardID, cellID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetDashboardsIDCellsIDView(ctx context.Context, dashboardID string, cellID string, params *GetDashboardsIDCellsIDViewParams) (*http.Response, error) { + req, err := NewGetDashboardsIDCellsIDViewRequest(c.service.ServerApiUrl(), dashboardID, cellID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchDashboardsIDCellsIDViewWithBody(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDViewParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchDashboardsIDCellsIDViewRequestWithBody(c.service.ServerApiUrl(), dashboardID, cellID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchDashboardsIDCellsIDView(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDViewParams, body PatchDashboardsIDCellsIDViewJSONRequestBody) (*http.Response, error) { + req, err := NewPatchDashboardsIDCellsIDViewRequest(c.service.ServerApiUrl(), dashboardID, cellID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetDashboardsIDLabels(ctx context.Context, dashboardID string, params *GetDashboardsIDLabelsParams) (*http.Response, error) { + req, err := NewGetDashboardsIDLabelsRequest(c.service.ServerApiUrl(), dashboardID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDashboardsIDLabelsWithBody(ctx context.Context, dashboardID string, params *PostDashboardsIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostDashboardsIDLabelsRequestWithBody(c.service.ServerApiUrl(), dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDashboardsIDLabels(ctx context.Context, dashboardID string, params *PostDashboardsIDLabelsParams, body PostDashboardsIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostDashboardsIDLabelsRequest(c.service.ServerApiUrl(), dashboardID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteDashboardsIDLabelsID(ctx context.Context, dashboardID string, labelID string, params *DeleteDashboardsIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteDashboardsIDLabelsIDRequest(c.service.ServerApiUrl(), dashboardID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetDashboardsIDLogs(ctx context.Context, dashboardID string, params *GetDashboardsIDLogsParams) (*http.Response, error) { + req, err := NewGetDashboardsIDLogsRequest(c.service.ServerApiUrl(), dashboardID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetDashboardsIDMembers(ctx context.Context, dashboardID string, params *GetDashboardsIDMembersParams) (*http.Response, error) { + req, err := NewGetDashboardsIDMembersRequest(c.service.ServerApiUrl(), dashboardID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDashboardsIDMembersWithBody(ctx context.Context, dashboardID string, params *PostDashboardsIDMembersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostDashboardsIDMembersRequestWithBody(c.service.ServerApiUrl(), dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDashboardsIDMembers(ctx context.Context, dashboardID string, params *PostDashboardsIDMembersParams, body PostDashboardsIDMembersJSONRequestBody) (*http.Response, error) { + req, err := NewPostDashboardsIDMembersRequest(c.service.ServerApiUrl(), dashboardID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteDashboardsIDMembersID(ctx context.Context, dashboardID string, userID string, params *DeleteDashboardsIDMembersIDParams) (*http.Response, error) { + req, err := NewDeleteDashboardsIDMembersIDRequest(c.service.ServerApiUrl(), dashboardID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetDashboardsIDOwners(ctx context.Context, dashboardID string, params *GetDashboardsIDOwnersParams) (*http.Response, error) { + req, err := NewGetDashboardsIDOwnersRequest(c.service.ServerApiUrl(), dashboardID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDashboardsIDOwnersWithBody(ctx context.Context, dashboardID string, params *PostDashboardsIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostDashboardsIDOwnersRequestWithBody(c.service.ServerApiUrl(), dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDashboardsIDOwners(ctx context.Context, dashboardID string, params *PostDashboardsIDOwnersParams, body PostDashboardsIDOwnersJSONRequestBody) (*http.Response, error) { + req, err := NewPostDashboardsIDOwnersRequest(c.service.ServerApiUrl(), dashboardID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteDashboardsIDOwnersID(ctx context.Context, dashboardID string, userID string, params *DeleteDashboardsIDOwnersIDParams) (*http.Response, error) { + req, err := NewDeleteDashboardsIDOwnersIDRequest(c.service.ServerApiUrl(), dashboardID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDeleteWithBody(ctx context.Context, params *PostDeleteParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostDeleteRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDelete(ctx context.Context, params *PostDeleteParams, body PostDeleteJSONRequestBody) (*http.Response, error) { + req, err := NewPostDeleteRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetDocumentsTemplates(ctx context.Context, params *GetDocumentsTemplatesParams) (*http.Response, error) { + req, err := NewGetDocumentsTemplatesRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDocumentsTemplatesWithBody(ctx context.Context, params *PostDocumentsTemplatesParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostDocumentsTemplatesRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDocumentsTemplates(ctx context.Context, params *PostDocumentsTemplatesParams, body PostDocumentsTemplatesJSONRequestBody) (*http.Response, error) { + req, err := NewPostDocumentsTemplatesRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteDocumentsTemplatesID(ctx context.Context, templateID string, params *DeleteDocumentsTemplatesIDParams) (*http.Response, error) { + req, err := NewDeleteDocumentsTemplatesIDRequest(c.service.ServerApiUrl(), templateID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetDocumentsTemplatesID(ctx context.Context, templateID string, params *GetDocumentsTemplatesIDParams) (*http.Response, error) { + req, err := NewGetDocumentsTemplatesIDRequest(c.service.ServerApiUrl(), templateID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutDocumentsTemplatesIDWithBody(ctx context.Context, templateID string, params *PutDocumentsTemplatesIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPutDocumentsTemplatesIDRequestWithBody(c.service.ServerApiUrl(), templateID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutDocumentsTemplatesID(ctx context.Context, templateID string, params *PutDocumentsTemplatesIDParams, body PutDocumentsTemplatesIDJSONRequestBody) (*http.Response, error) { + req, err := NewPutDocumentsTemplatesIDRequest(c.service.ServerApiUrl(), templateID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetDocumentsTemplatesIDLabels(ctx context.Context, templateID string, params *GetDocumentsTemplatesIDLabelsParams) (*http.Response, error) { + req, err := NewGetDocumentsTemplatesIDLabelsRequest(c.service.ServerApiUrl(), templateID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDocumentsTemplatesIDLabelsWithBody(ctx context.Context, templateID string, params *PostDocumentsTemplatesIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostDocumentsTemplatesIDLabelsRequestWithBody(c.service.ServerApiUrl(), templateID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostDocumentsTemplatesIDLabels(ctx context.Context, templateID string, params *PostDocumentsTemplatesIDLabelsParams, body PostDocumentsTemplatesIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostDocumentsTemplatesIDLabelsRequest(c.service.ServerApiUrl(), templateID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteDocumentsTemplatesIDLabelsID(ctx context.Context, templateID string, labelID string, params *DeleteDocumentsTemplatesIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteDocumentsTemplatesIDLabelsIDRequest(c.service.ServerApiUrl(), templateID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetHealth(ctx context.Context, params *GetHealthParams) (*http.Response, error) { + req, err := NewGetHealthRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetLabels(ctx context.Context, params *GetLabelsParams) (*http.Response, error) { + req, err := NewGetLabelsRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostLabelsWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostLabelsRequestWithBody(c.service.ServerApiUrl(), contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostLabels(ctx context.Context, body PostLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostLabelsRequest(c.service.ServerApiUrl(), body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteLabelsID(ctx context.Context, labelID string, params *DeleteLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteLabelsIDRequest(c.service.ServerApiUrl(), labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetLabelsID(ctx context.Context, labelID string, params *GetLabelsIDParams) (*http.Response, error) { + req, err := NewGetLabelsIDRequest(c.service.ServerApiUrl(), labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchLabelsIDWithBody(ctx context.Context, labelID string, params *PatchLabelsIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchLabelsIDRequestWithBody(c.service.ServerApiUrl(), labelID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchLabelsID(ctx context.Context, labelID string, params *PatchLabelsIDParams, body PatchLabelsIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchLabelsIDRequest(c.service.ServerApiUrl(), labelID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetMe(ctx context.Context, params *GetMeParams) (*http.Response, error) { + req, err := NewGetMeRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutMePasswordWithBody(ctx context.Context, params *PutMePasswordParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPutMePasswordRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutMePassword(ctx context.Context, params *PutMePasswordParams, body PutMePasswordJSONRequestBody) (*http.Response, error) { + req, err := NewPutMePasswordRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetNotificationEndpoints(ctx context.Context, params *GetNotificationEndpointsParams) (*http.Response, error) { + req, err := NewGetNotificationEndpointsRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) CreateNotificationEndpointWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewCreateNotificationEndpointRequestWithBody(c.service.ServerApiUrl(), contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) CreateNotificationEndpoint(ctx context.Context, body CreateNotificationEndpointJSONRequestBody) (*http.Response, error) { + req, err := NewCreateNotificationEndpointRequest(c.service.ServerApiUrl(), body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteNotificationEndpointsID(ctx context.Context, endpointID string, params *DeleteNotificationEndpointsIDParams) (*http.Response, error) { + req, err := NewDeleteNotificationEndpointsIDRequest(c.service.ServerApiUrl(), endpointID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetNotificationEndpointsID(ctx context.Context, endpointID string, params *GetNotificationEndpointsIDParams) (*http.Response, error) { + req, err := NewGetNotificationEndpointsIDRequest(c.service.ServerApiUrl(), endpointID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchNotificationEndpointsIDWithBody(ctx context.Context, endpointID string, params *PatchNotificationEndpointsIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchNotificationEndpointsIDRequestWithBody(c.service.ServerApiUrl(), endpointID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchNotificationEndpointsID(ctx context.Context, endpointID string, params *PatchNotificationEndpointsIDParams, body PatchNotificationEndpointsIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchNotificationEndpointsIDRequest(c.service.ServerApiUrl(), endpointID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutNotificationEndpointsIDWithBody(ctx context.Context, endpointID string, params *PutNotificationEndpointsIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPutNotificationEndpointsIDRequestWithBody(c.service.ServerApiUrl(), endpointID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutNotificationEndpointsID(ctx context.Context, endpointID string, params *PutNotificationEndpointsIDParams, body PutNotificationEndpointsIDJSONRequestBody) (*http.Response, error) { + req, err := NewPutNotificationEndpointsIDRequest(c.service.ServerApiUrl(), endpointID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetNotificationEndpointsIDLabels(ctx context.Context, endpointID string, params *GetNotificationEndpointsIDLabelsParams) (*http.Response, error) { + req, err := NewGetNotificationEndpointsIDLabelsRequest(c.service.ServerApiUrl(), endpointID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostNotificationEndpointIDLabelsWithBody(ctx context.Context, endpointID string, params *PostNotificationEndpointIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostNotificationEndpointIDLabelsRequestWithBody(c.service.ServerApiUrl(), endpointID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostNotificationEndpointIDLabels(ctx context.Context, endpointID string, params *PostNotificationEndpointIDLabelsParams, body PostNotificationEndpointIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostNotificationEndpointIDLabelsRequest(c.service.ServerApiUrl(), endpointID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteNotificationEndpointsIDLabelsID(ctx context.Context, endpointID string, labelID string, params *DeleteNotificationEndpointsIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteNotificationEndpointsIDLabelsIDRequest(c.service.ServerApiUrl(), endpointID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetNotificationRules(ctx context.Context, params *GetNotificationRulesParams) (*http.Response, error) { + req, err := NewGetNotificationRulesRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) CreateNotificationRuleWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewCreateNotificationRuleRequestWithBody(c.service.ServerApiUrl(), contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) CreateNotificationRule(ctx context.Context, body CreateNotificationRuleJSONRequestBody) (*http.Response, error) { + req, err := NewCreateNotificationRuleRequest(c.service.ServerApiUrl(), body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteNotificationRulesID(ctx context.Context, ruleID string, params *DeleteNotificationRulesIDParams) (*http.Response, error) { + req, err := NewDeleteNotificationRulesIDRequest(c.service.ServerApiUrl(), ruleID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetNotificationRulesID(ctx context.Context, ruleID string, params *GetNotificationRulesIDParams) (*http.Response, error) { + req, err := NewGetNotificationRulesIDRequest(c.service.ServerApiUrl(), ruleID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchNotificationRulesIDWithBody(ctx context.Context, ruleID string, params *PatchNotificationRulesIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchNotificationRulesIDRequestWithBody(c.service.ServerApiUrl(), ruleID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchNotificationRulesID(ctx context.Context, ruleID string, params *PatchNotificationRulesIDParams, body PatchNotificationRulesIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchNotificationRulesIDRequest(c.service.ServerApiUrl(), ruleID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutNotificationRulesIDWithBody(ctx context.Context, ruleID string, params *PutNotificationRulesIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPutNotificationRulesIDRequestWithBody(c.service.ServerApiUrl(), ruleID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutNotificationRulesID(ctx context.Context, ruleID string, params *PutNotificationRulesIDParams, body PutNotificationRulesIDJSONRequestBody) (*http.Response, error) { + req, err := NewPutNotificationRulesIDRequest(c.service.ServerApiUrl(), ruleID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetNotificationRulesIDLabels(ctx context.Context, ruleID string, params *GetNotificationRulesIDLabelsParams) (*http.Response, error) { + req, err := NewGetNotificationRulesIDLabelsRequest(c.service.ServerApiUrl(), ruleID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostNotificationRuleIDLabelsWithBody(ctx context.Context, ruleID string, params *PostNotificationRuleIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostNotificationRuleIDLabelsRequestWithBody(c.service.ServerApiUrl(), ruleID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostNotificationRuleIDLabels(ctx context.Context, ruleID string, params *PostNotificationRuleIDLabelsParams, body PostNotificationRuleIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostNotificationRuleIDLabelsRequest(c.service.ServerApiUrl(), ruleID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteNotificationRulesIDLabelsID(ctx context.Context, ruleID string, labelID string, params *DeleteNotificationRulesIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteNotificationRulesIDLabelsIDRequest(c.service.ServerApiUrl(), ruleID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetNotificationRulesIDQuery(ctx context.Context, ruleID string, params *GetNotificationRulesIDQueryParams) (*http.Response, error) { + req, err := NewGetNotificationRulesIDQueryRequest(c.service.ServerApiUrl(), ruleID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetOrgs(ctx context.Context, params *GetOrgsParams) (*http.Response, error) { + req, err := NewGetOrgsRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostOrgsWithBody(ctx context.Context, params *PostOrgsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostOrgsRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostOrgs(ctx context.Context, params *PostOrgsParams, body PostOrgsJSONRequestBody) (*http.Response, error) { + req, err := NewPostOrgsRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteOrgsID(ctx context.Context, orgID string, params *DeleteOrgsIDParams) (*http.Response, error) { + req, err := NewDeleteOrgsIDRequest(c.service.ServerApiUrl(), orgID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetOrgsID(ctx context.Context, orgID string, params *GetOrgsIDParams) (*http.Response, error) { + req, err := NewGetOrgsIDRequest(c.service.ServerApiUrl(), orgID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchOrgsIDWithBody(ctx context.Context, orgID string, params *PatchOrgsIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchOrgsIDRequestWithBody(c.service.ServerApiUrl(), orgID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchOrgsID(ctx context.Context, orgID string, params *PatchOrgsIDParams, body PatchOrgsIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchOrgsIDRequest(c.service.ServerApiUrl(), orgID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetOrgsIDLabels(ctx context.Context, orgID string, params *GetOrgsIDLabelsParams) (*http.Response, error) { + req, err := NewGetOrgsIDLabelsRequest(c.service.ServerApiUrl(), orgID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostOrgsIDLabelsWithBody(ctx context.Context, orgID string, params *PostOrgsIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostOrgsIDLabelsRequestWithBody(c.service.ServerApiUrl(), orgID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostOrgsIDLabels(ctx context.Context, orgID string, params *PostOrgsIDLabelsParams, body PostOrgsIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostOrgsIDLabelsRequest(c.service.ServerApiUrl(), orgID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteOrgsIDLabelsID(ctx context.Context, orgID string, labelID string, params *DeleteOrgsIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteOrgsIDLabelsIDRequest(c.service.ServerApiUrl(), orgID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetOrgsIDLogs(ctx context.Context, orgID string, params *GetOrgsIDLogsParams) (*http.Response, error) { + req, err := NewGetOrgsIDLogsRequest(c.service.ServerApiUrl(), orgID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetOrgsIDMembers(ctx context.Context, orgID string, params *GetOrgsIDMembersParams) (*http.Response, error) { + req, err := NewGetOrgsIDMembersRequest(c.service.ServerApiUrl(), orgID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostOrgsIDMembersWithBody(ctx context.Context, orgID string, params *PostOrgsIDMembersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostOrgsIDMembersRequestWithBody(c.service.ServerApiUrl(), orgID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostOrgsIDMembers(ctx context.Context, orgID string, params *PostOrgsIDMembersParams, body PostOrgsIDMembersJSONRequestBody) (*http.Response, error) { + req, err := NewPostOrgsIDMembersRequest(c.service.ServerApiUrl(), orgID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteOrgsIDMembersID(ctx context.Context, orgID string, userID string, params *DeleteOrgsIDMembersIDParams) (*http.Response, error) { + req, err := NewDeleteOrgsIDMembersIDRequest(c.service.ServerApiUrl(), orgID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetOrgsIDOwners(ctx context.Context, orgID string, params *GetOrgsIDOwnersParams) (*http.Response, error) { + req, err := NewGetOrgsIDOwnersRequest(c.service.ServerApiUrl(), orgID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostOrgsIDOwnersWithBody(ctx context.Context, orgID string, params *PostOrgsIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostOrgsIDOwnersRequestWithBody(c.service.ServerApiUrl(), orgID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostOrgsIDOwners(ctx context.Context, orgID string, params *PostOrgsIDOwnersParams, body PostOrgsIDOwnersJSONRequestBody) (*http.Response, error) { + req, err := NewPostOrgsIDOwnersRequest(c.service.ServerApiUrl(), orgID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteOrgsIDOwnersID(ctx context.Context, orgID string, userID string, params *DeleteOrgsIDOwnersIDParams) (*http.Response, error) { + req, err := NewDeleteOrgsIDOwnersIDRequest(c.service.ServerApiUrl(), orgID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetOrgsIDSecrets(ctx context.Context, orgID string, params *GetOrgsIDSecretsParams) (*http.Response, error) { + req, err := NewGetOrgsIDSecretsRequest(c.service.ServerApiUrl(), orgID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchOrgsIDSecretsWithBody(ctx context.Context, orgID string, params *PatchOrgsIDSecretsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchOrgsIDSecretsRequestWithBody(c.service.ServerApiUrl(), orgID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchOrgsIDSecrets(ctx context.Context, orgID string, params *PatchOrgsIDSecretsParams, body PatchOrgsIDSecretsJSONRequestBody) (*http.Response, error) { + req, err := NewPatchOrgsIDSecretsRequest(c.service.ServerApiUrl(), orgID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostOrgsIDSecretsWithBody(ctx context.Context, orgID string, params *PostOrgsIDSecretsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostOrgsIDSecretsRequestWithBody(c.service.ServerApiUrl(), orgID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostOrgsIDSecrets(ctx context.Context, orgID string, params *PostOrgsIDSecretsParams, body PostOrgsIDSecretsJSONRequestBody) (*http.Response, error) { + req, err := NewPostOrgsIDSecretsRequest(c.service.ServerApiUrl(), orgID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) CreatePkgWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewCreatePkgRequestWithBody(c.service.ServerApiUrl(), contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) CreatePkg(ctx context.Context, body CreatePkgJSONRequestBody) (*http.Response, error) { + req, err := NewCreatePkgRequest(c.service.ServerApiUrl(), body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) ApplyPkgWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewApplyPkgRequestWithBody(c.service.ServerApiUrl(), contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) ApplyPkg(ctx context.Context, body ApplyPkgJSONRequestBody) (*http.Response, error) { + req, err := NewApplyPkgRequest(c.service.ServerApiUrl(), body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostQueryWithBody(ctx context.Context, params *PostQueryParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostQueryRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostQuery(ctx context.Context, params *PostQueryParams, body PostQueryJSONRequestBody) (*http.Response, error) { + req, err := NewPostQueryRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostQueryAnalyzeWithBody(ctx context.Context, params *PostQueryAnalyzeParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostQueryAnalyzeRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostQueryAnalyze(ctx context.Context, params *PostQueryAnalyzeParams, body PostQueryAnalyzeJSONRequestBody) (*http.Response, error) { + req, err := NewPostQueryAnalyzeRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostQueryAstWithBody(ctx context.Context, params *PostQueryAstParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostQueryAstRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostQueryAst(ctx context.Context, params *PostQueryAstParams, body PostQueryAstJSONRequestBody) (*http.Response, error) { + req, err := NewPostQueryAstRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetQuerySuggestions(ctx context.Context, params *GetQuerySuggestionsParams) (*http.Response, error) { + req, err := NewGetQuerySuggestionsRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetQuerySuggestionsName(ctx context.Context, name string, params *GetQuerySuggestionsNameParams) (*http.Response, error) { + req, err := NewGetQuerySuggestionsNameRequest(c.service.ServerApiUrl(), name, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetReady(ctx context.Context, params *GetReadyParams) (*http.Response, error) { + req, err := NewGetReadyRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetScrapers(ctx context.Context, params *GetScrapersParams) (*http.Response, error) { + req, err := NewGetScrapersRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostScrapersWithBody(ctx context.Context, params *PostScrapersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostScrapersRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostScrapers(ctx context.Context, params *PostScrapersParams, body PostScrapersJSONRequestBody) (*http.Response, error) { + req, err := NewPostScrapersRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteScrapersID(ctx context.Context, scraperTargetID string, params *DeleteScrapersIDParams) (*http.Response, error) { + req, err := NewDeleteScrapersIDRequest(c.service.ServerApiUrl(), scraperTargetID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetScrapersID(ctx context.Context, scraperTargetID string, params *GetScrapersIDParams) (*http.Response, error) { + req, err := NewGetScrapersIDRequest(c.service.ServerApiUrl(), scraperTargetID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchScrapersIDWithBody(ctx context.Context, scraperTargetID string, params *PatchScrapersIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchScrapersIDRequestWithBody(c.service.ServerApiUrl(), scraperTargetID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchScrapersID(ctx context.Context, scraperTargetID string, params *PatchScrapersIDParams, body PatchScrapersIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchScrapersIDRequest(c.service.ServerApiUrl(), scraperTargetID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetScrapersIDLabels(ctx context.Context, scraperTargetID string, params *GetScrapersIDLabelsParams) (*http.Response, error) { + req, err := NewGetScrapersIDLabelsRequest(c.service.ServerApiUrl(), scraperTargetID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostScrapersIDLabelsWithBody(ctx context.Context, scraperTargetID string, params *PostScrapersIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostScrapersIDLabelsRequestWithBody(c.service.ServerApiUrl(), scraperTargetID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostScrapersIDLabels(ctx context.Context, scraperTargetID string, params *PostScrapersIDLabelsParams, body PostScrapersIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostScrapersIDLabelsRequest(c.service.ServerApiUrl(), scraperTargetID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteScrapersIDLabelsID(ctx context.Context, scraperTargetID string, labelID string, params *DeleteScrapersIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteScrapersIDLabelsIDRequest(c.service.ServerApiUrl(), scraperTargetID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchScrapersIDLabelsIDWithBody(ctx context.Context, scraperTargetID string, labelID string, params *PatchScrapersIDLabelsIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchScrapersIDLabelsIDRequestWithBody(c.service.ServerApiUrl(), scraperTargetID, labelID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchScrapersIDLabelsID(ctx context.Context, scraperTargetID string, labelID string, params *PatchScrapersIDLabelsIDParams, body PatchScrapersIDLabelsIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchScrapersIDLabelsIDRequest(c.service.ServerApiUrl(), scraperTargetID, labelID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetScrapersIDMembers(ctx context.Context, scraperTargetID string, params *GetScrapersIDMembersParams) (*http.Response, error) { + req, err := NewGetScrapersIDMembersRequest(c.service.ServerApiUrl(), scraperTargetID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostScrapersIDMembersWithBody(ctx context.Context, scraperTargetID string, params *PostScrapersIDMembersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostScrapersIDMembersRequestWithBody(c.service.ServerApiUrl(), scraperTargetID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostScrapersIDMembers(ctx context.Context, scraperTargetID string, params *PostScrapersIDMembersParams, body PostScrapersIDMembersJSONRequestBody) (*http.Response, error) { + req, err := NewPostScrapersIDMembersRequest(c.service.ServerApiUrl(), scraperTargetID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteScrapersIDMembersID(ctx context.Context, scraperTargetID string, userID string, params *DeleteScrapersIDMembersIDParams) (*http.Response, error) { + req, err := NewDeleteScrapersIDMembersIDRequest(c.service.ServerApiUrl(), scraperTargetID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetScrapersIDOwners(ctx context.Context, scraperTargetID string, params *GetScrapersIDOwnersParams) (*http.Response, error) { + req, err := NewGetScrapersIDOwnersRequest(c.service.ServerApiUrl(), scraperTargetID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostScrapersIDOwnersWithBody(ctx context.Context, scraperTargetID string, params *PostScrapersIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostScrapersIDOwnersRequestWithBody(c.service.ServerApiUrl(), scraperTargetID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostScrapersIDOwners(ctx context.Context, scraperTargetID string, params *PostScrapersIDOwnersParams, body PostScrapersIDOwnersJSONRequestBody) (*http.Response, error) { + req, err := NewPostScrapersIDOwnersRequest(c.service.ServerApiUrl(), scraperTargetID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteScrapersIDOwnersID(ctx context.Context, scraperTargetID string, userID string, params *DeleteScrapersIDOwnersIDParams) (*http.Response, error) { + req, err := NewDeleteScrapersIDOwnersIDRequest(c.service.ServerApiUrl(), scraperTargetID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetSetup(ctx context.Context, params *GetSetupParams) (*http.Response, error) { + req, err := NewGetSetupRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostSetupWithBody(ctx context.Context, params *PostSetupParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostSetupRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostSetup(ctx context.Context, params *PostSetupParams, body PostSetupJSONRequestBody) (*http.Response, error) { + req, err := NewPostSetupRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostSignin(ctx context.Context, params *PostSigninParams) (*http.Response, error) { + req, err := NewPostSigninRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostSignout(ctx context.Context, params *PostSignoutParams) (*http.Response, error) { + req, err := NewPostSignoutRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetSources(ctx context.Context, params *GetSourcesParams) (*http.Response, error) { + req, err := NewGetSourcesRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostSourcesWithBody(ctx context.Context, params *PostSourcesParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostSourcesRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostSources(ctx context.Context, params *PostSourcesParams, body PostSourcesJSONRequestBody) (*http.Response, error) { + req, err := NewPostSourcesRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteSourcesID(ctx context.Context, sourceID string, params *DeleteSourcesIDParams) (*http.Response, error) { + req, err := NewDeleteSourcesIDRequest(c.service.ServerApiUrl(), sourceID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetSourcesID(ctx context.Context, sourceID string, params *GetSourcesIDParams) (*http.Response, error) { + req, err := NewGetSourcesIDRequest(c.service.ServerApiUrl(), sourceID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchSourcesIDWithBody(ctx context.Context, sourceID string, params *PatchSourcesIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchSourcesIDRequestWithBody(c.service.ServerApiUrl(), sourceID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchSourcesID(ctx context.Context, sourceID string, params *PatchSourcesIDParams, body PatchSourcesIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchSourcesIDRequest(c.service.ServerApiUrl(), sourceID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetSourcesIDBuckets(ctx context.Context, sourceID string, params *GetSourcesIDBucketsParams) (*http.Response, error) { + req, err := NewGetSourcesIDBucketsRequest(c.service.ServerApiUrl(), sourceID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetSourcesIDHealth(ctx context.Context, sourceID string, params *GetSourcesIDHealthParams) (*http.Response, error) { + req, err := NewGetSourcesIDHealthRequest(c.service.ServerApiUrl(), sourceID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTasks(ctx context.Context, params *GetTasksParams) (*http.Response, error) { + req, err := NewGetTasksRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasksWithBody(ctx context.Context, params *PostTasksParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostTasksRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasks(ctx context.Context, params *PostTasksParams, body PostTasksJSONRequestBody) (*http.Response, error) { + req, err := NewPostTasksRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteTasksID(ctx context.Context, taskID string, params *DeleteTasksIDParams) (*http.Response, error) { + req, err := NewDeleteTasksIDRequest(c.service.ServerApiUrl(), taskID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTasksID(ctx context.Context, taskID string, params *GetTasksIDParams) (*http.Response, error) { + req, err := NewGetTasksIDRequest(c.service.ServerApiUrl(), taskID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchTasksIDWithBody(ctx context.Context, taskID string, params *PatchTasksIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchTasksIDRequestWithBody(c.service.ServerApiUrl(), taskID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchTasksID(ctx context.Context, taskID string, params *PatchTasksIDParams, body PatchTasksIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchTasksIDRequest(c.service.ServerApiUrl(), taskID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTasksIDLabels(ctx context.Context, taskID string, params *GetTasksIDLabelsParams) (*http.Response, error) { + req, err := NewGetTasksIDLabelsRequest(c.service.ServerApiUrl(), taskID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasksIDLabelsWithBody(ctx context.Context, taskID string, params *PostTasksIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostTasksIDLabelsRequestWithBody(c.service.ServerApiUrl(), taskID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasksIDLabels(ctx context.Context, taskID string, params *PostTasksIDLabelsParams, body PostTasksIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostTasksIDLabelsRequest(c.service.ServerApiUrl(), taskID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteTasksIDLabelsID(ctx context.Context, taskID string, labelID string, params *DeleteTasksIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteTasksIDLabelsIDRequest(c.service.ServerApiUrl(), taskID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTasksIDLogs(ctx context.Context, taskID string, params *GetTasksIDLogsParams) (*http.Response, error) { + req, err := NewGetTasksIDLogsRequest(c.service.ServerApiUrl(), taskID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTasksIDMembers(ctx context.Context, taskID string, params *GetTasksIDMembersParams) (*http.Response, error) { + req, err := NewGetTasksIDMembersRequest(c.service.ServerApiUrl(), taskID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasksIDMembersWithBody(ctx context.Context, taskID string, params *PostTasksIDMembersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostTasksIDMembersRequestWithBody(c.service.ServerApiUrl(), taskID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasksIDMembers(ctx context.Context, taskID string, params *PostTasksIDMembersParams, body PostTasksIDMembersJSONRequestBody) (*http.Response, error) { + req, err := NewPostTasksIDMembersRequest(c.service.ServerApiUrl(), taskID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteTasksIDMembersID(ctx context.Context, taskID string, userID string, params *DeleteTasksIDMembersIDParams) (*http.Response, error) { + req, err := NewDeleteTasksIDMembersIDRequest(c.service.ServerApiUrl(), taskID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTasksIDOwners(ctx context.Context, taskID string, params *GetTasksIDOwnersParams) (*http.Response, error) { + req, err := NewGetTasksIDOwnersRequest(c.service.ServerApiUrl(), taskID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasksIDOwnersWithBody(ctx context.Context, taskID string, params *PostTasksIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostTasksIDOwnersRequestWithBody(c.service.ServerApiUrl(), taskID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasksIDOwners(ctx context.Context, taskID string, params *PostTasksIDOwnersParams, body PostTasksIDOwnersJSONRequestBody) (*http.Response, error) { + req, err := NewPostTasksIDOwnersRequest(c.service.ServerApiUrl(), taskID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteTasksIDOwnersID(ctx context.Context, taskID string, userID string, params *DeleteTasksIDOwnersIDParams) (*http.Response, error) { + req, err := NewDeleteTasksIDOwnersIDRequest(c.service.ServerApiUrl(), taskID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTasksIDRuns(ctx context.Context, taskID string, params *GetTasksIDRunsParams) (*http.Response, error) { + req, err := NewGetTasksIDRunsRequest(c.service.ServerApiUrl(), taskID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasksIDRunsWithBody(ctx context.Context, taskID string, params *PostTasksIDRunsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostTasksIDRunsRequestWithBody(c.service.ServerApiUrl(), taskID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasksIDRuns(ctx context.Context, taskID string, params *PostTasksIDRunsParams, body PostTasksIDRunsJSONRequestBody) (*http.Response, error) { + req, err := NewPostTasksIDRunsRequest(c.service.ServerApiUrl(), taskID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteTasksIDRunsID(ctx context.Context, taskID string, runID string, params *DeleteTasksIDRunsIDParams) (*http.Response, error) { + req, err := NewDeleteTasksIDRunsIDRequest(c.service.ServerApiUrl(), taskID, runID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTasksIDRunsID(ctx context.Context, taskID string, runID string, params *GetTasksIDRunsIDParams) (*http.Response, error) { + req, err := NewGetTasksIDRunsIDRequest(c.service.ServerApiUrl(), taskID, runID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTasksIDRunsIDLogs(ctx context.Context, taskID string, runID string, params *GetTasksIDRunsIDLogsParams) (*http.Response, error) { + req, err := NewGetTasksIDRunsIDLogsRequest(c.service.ServerApiUrl(), taskID, runID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTasksIDRunsIDRetry(ctx context.Context, taskID string, runID string, params *PostTasksIDRunsIDRetryParams) (*http.Response, error) { + req, err := NewPostTasksIDRunsIDRetryRequest(c.service.ServerApiUrl(), taskID, runID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTelegrafPlugins(ctx context.Context, params *GetTelegrafPluginsParams) (*http.Response, error) { + req, err := NewGetTelegrafPluginsRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTelegrafs(ctx context.Context, params *GetTelegrafsParams) (*http.Response, error) { + req, err := NewGetTelegrafsRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTelegrafsWithBody(ctx context.Context, params *PostTelegrafsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostTelegrafsRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTelegrafs(ctx context.Context, params *PostTelegrafsParams, body PostTelegrafsJSONRequestBody) (*http.Response, error) { + req, err := NewPostTelegrafsRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteTelegrafsID(ctx context.Context, telegrafID string, params *DeleteTelegrafsIDParams) (*http.Response, error) { + req, err := NewDeleteTelegrafsIDRequest(c.service.ServerApiUrl(), telegrafID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTelegrafsID(ctx context.Context, telegrafID string, params *GetTelegrafsIDParams) (*http.Response, error) { + req, err := NewGetTelegrafsIDRequest(c.service.ServerApiUrl(), telegrafID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutTelegrafsIDWithBody(ctx context.Context, telegrafID string, params *PutTelegrafsIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPutTelegrafsIDRequestWithBody(c.service.ServerApiUrl(), telegrafID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutTelegrafsID(ctx context.Context, telegrafID string, params *PutTelegrafsIDParams, body PutTelegrafsIDJSONRequestBody) (*http.Response, error) { + req, err := NewPutTelegrafsIDRequest(c.service.ServerApiUrl(), telegrafID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTelegrafsIDLabels(ctx context.Context, telegrafID string, params *GetTelegrafsIDLabelsParams) (*http.Response, error) { + req, err := NewGetTelegrafsIDLabelsRequest(c.service.ServerApiUrl(), telegrafID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTelegrafsIDLabelsWithBody(ctx context.Context, telegrafID string, params *PostTelegrafsIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostTelegrafsIDLabelsRequestWithBody(c.service.ServerApiUrl(), telegrafID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTelegrafsIDLabels(ctx context.Context, telegrafID string, params *PostTelegrafsIDLabelsParams, body PostTelegrafsIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostTelegrafsIDLabelsRequest(c.service.ServerApiUrl(), telegrafID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteTelegrafsIDLabelsID(ctx context.Context, telegrafID string, labelID string, params *DeleteTelegrafsIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteTelegrafsIDLabelsIDRequest(c.service.ServerApiUrl(), telegrafID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTelegrafsIDMembers(ctx context.Context, telegrafID string, params *GetTelegrafsIDMembersParams) (*http.Response, error) { + req, err := NewGetTelegrafsIDMembersRequest(c.service.ServerApiUrl(), telegrafID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTelegrafsIDMembersWithBody(ctx context.Context, telegrafID string, params *PostTelegrafsIDMembersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostTelegrafsIDMembersRequestWithBody(c.service.ServerApiUrl(), telegrafID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTelegrafsIDMembers(ctx context.Context, telegrafID string, params *PostTelegrafsIDMembersParams, body PostTelegrafsIDMembersJSONRequestBody) (*http.Response, error) { + req, err := NewPostTelegrafsIDMembersRequest(c.service.ServerApiUrl(), telegrafID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteTelegrafsIDMembersID(ctx context.Context, telegrafID string, userID string, params *DeleteTelegrafsIDMembersIDParams) (*http.Response, error) { + req, err := NewDeleteTelegrafsIDMembersIDRequest(c.service.ServerApiUrl(), telegrafID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetTelegrafsIDOwners(ctx context.Context, telegrafID string, params *GetTelegrafsIDOwnersParams) (*http.Response, error) { + req, err := NewGetTelegrafsIDOwnersRequest(c.service.ServerApiUrl(), telegrafID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTelegrafsIDOwnersWithBody(ctx context.Context, telegrafID string, params *PostTelegrafsIDOwnersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostTelegrafsIDOwnersRequestWithBody(c.service.ServerApiUrl(), telegrafID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostTelegrafsIDOwners(ctx context.Context, telegrafID string, params *PostTelegrafsIDOwnersParams, body PostTelegrafsIDOwnersJSONRequestBody) (*http.Response, error) { + req, err := NewPostTelegrafsIDOwnersRequest(c.service.ServerApiUrl(), telegrafID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteTelegrafsIDOwnersID(ctx context.Context, telegrafID string, userID string, params *DeleteTelegrafsIDOwnersIDParams) (*http.Response, error) { + req, err := NewDeleteTelegrafsIDOwnersIDRequest(c.service.ServerApiUrl(), telegrafID, userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetUsers(ctx context.Context, params *GetUsersParams) (*http.Response, error) { + req, err := NewGetUsersRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostUsersWithBody(ctx context.Context, params *PostUsersParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostUsersRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostUsers(ctx context.Context, params *PostUsersParams, body PostUsersJSONRequestBody) (*http.Response, error) { + req, err := NewPostUsersRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteUsersID(ctx context.Context, userID string, params *DeleteUsersIDParams) (*http.Response, error) { + req, err := NewDeleteUsersIDRequest(c.service.ServerApiUrl(), userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetUsersID(ctx context.Context, userID string, params *GetUsersIDParams) (*http.Response, error) { + req, err := NewGetUsersIDRequest(c.service.ServerApiUrl(), userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchUsersIDWithBody(ctx context.Context, userID string, params *PatchUsersIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchUsersIDRequestWithBody(c.service.ServerApiUrl(), userID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchUsersID(ctx context.Context, userID string, params *PatchUsersIDParams, body PatchUsersIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchUsersIDRequest(c.service.ServerApiUrl(), userID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetUsersIDLogs(ctx context.Context, userID string, params *GetUsersIDLogsParams) (*http.Response, error) { + req, err := NewGetUsersIDLogsRequest(c.service.ServerApiUrl(), userID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutUsersIDPasswordWithBody(ctx context.Context, userID string, params *PutUsersIDPasswordParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPutUsersIDPasswordRequestWithBody(c.service.ServerApiUrl(), userID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutUsersIDPassword(ctx context.Context, userID string, params *PutUsersIDPasswordParams, body PutUsersIDPasswordJSONRequestBody) (*http.Response, error) { + req, err := NewPutUsersIDPasswordRequest(c.service.ServerApiUrl(), userID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetVariables(ctx context.Context, params *GetVariablesParams) (*http.Response, error) { + req, err := NewGetVariablesRequest(c.service.ServerApiUrl(), params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostVariablesWithBody(ctx context.Context, params *PostVariablesParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostVariablesRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostVariables(ctx context.Context, params *PostVariablesParams, body PostVariablesJSONRequestBody) (*http.Response, error) { + req, err := NewPostVariablesRequest(c.service.ServerApiUrl(), params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteVariablesID(ctx context.Context, variableID string, params *DeleteVariablesIDParams) (*http.Response, error) { + req, err := NewDeleteVariablesIDRequest(c.service.ServerApiUrl(), variableID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetVariablesID(ctx context.Context, variableID string, params *GetVariablesIDParams) (*http.Response, error) { + req, err := NewGetVariablesIDRequest(c.service.ServerApiUrl(), variableID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchVariablesIDWithBody(ctx context.Context, variableID string, params *PatchVariablesIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPatchVariablesIDRequestWithBody(c.service.ServerApiUrl(), variableID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PatchVariablesID(ctx context.Context, variableID string, params *PatchVariablesIDParams, body PatchVariablesIDJSONRequestBody) (*http.Response, error) { + req, err := NewPatchVariablesIDRequest(c.service.ServerApiUrl(), variableID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutVariablesIDWithBody(ctx context.Context, variableID string, params *PutVariablesIDParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPutVariablesIDRequestWithBody(c.service.ServerApiUrl(), variableID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PutVariablesID(ctx context.Context, variableID string, params *PutVariablesIDParams, body PutVariablesIDJSONRequestBody) (*http.Response, error) { + req, err := NewPutVariablesIDRequest(c.service.ServerApiUrl(), variableID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) GetVariablesIDLabels(ctx context.Context, variableID string, params *GetVariablesIDLabelsParams) (*http.Response, error) { + req, err := NewGetVariablesIDLabelsRequest(c.service.ServerApiUrl(), variableID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostVariablesIDLabelsWithBody(ctx context.Context, variableID string, params *PostVariablesIDLabelsParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostVariablesIDLabelsRequestWithBody(c.service.ServerApiUrl(), variableID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostVariablesIDLabels(ctx context.Context, variableID string, params *PostVariablesIDLabelsParams, body PostVariablesIDLabelsJSONRequestBody) (*http.Response, error) { + req, err := NewPostVariablesIDLabelsRequest(c.service.ServerApiUrl(), variableID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) DeleteVariablesIDLabelsID(ctx context.Context, variableID string, labelID string, params *DeleteVariablesIDLabelsIDParams) (*http.Response, error) { + req, err := NewDeleteVariablesIDLabelsIDRequest(c.service.ServerApiUrl(), variableID, labelID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +func (c *Client) PostWriteWithBody(ctx context.Context, params *PostWriteParams, contentType string, body io.Reader) (*http.Response, error) { + req, err := NewPostWriteRequestWithBody(c.service.ServerApiUrl(), params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +// NewGetRoutesRequest generates requests for GetRoutes +func NewGetRoutesRequest(server string, params *GetRoutesParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetAuthorizationsRequest generates requests for GetAuthorizations +func NewGetAuthorizationsRequest(server string, params *GetAuthorizationsParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/authorizations") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.UserID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "userID", *params.UserID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.User != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "user", *params.User); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostAuthorizationsRequest calls the generic PostAuthorizations builder with application/json body +func NewPostAuthorizationsRequest(server string, params *PostAuthorizationsParams, body PostAuthorizationsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostAuthorizationsRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostAuthorizationsRequestWithBody generates requests for PostAuthorizations with any type of body +func NewPostAuthorizationsRequestWithBody(server string, params *PostAuthorizationsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/authorizations") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteAuthorizationsIDRequest generates requests for DeleteAuthorizationsID +func NewDeleteAuthorizationsIDRequest(server string, authID string, params *DeleteAuthorizationsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "authID", authID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/authorizations/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetAuthorizationsIDRequest generates requests for GetAuthorizationsID +func NewGetAuthorizationsIDRequest(server string, authID string, params *GetAuthorizationsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "authID", authID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/authorizations/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchAuthorizationsIDRequest calls the generic PatchAuthorizationsID builder with application/json body +func NewPatchAuthorizationsIDRequest(server string, authID string, params *PatchAuthorizationsIDParams, body PatchAuthorizationsIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchAuthorizationsIDRequestWithBody(server, authID, params, "application/json", bodyReader) +} + +// NewPatchAuthorizationsIDRequestWithBody generates requests for PatchAuthorizationsID with any type of body +func NewPatchAuthorizationsIDRequestWithBody(server string, authID string, params *PatchAuthorizationsIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "authID", authID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/authorizations/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetBucketsRequest generates requests for GetBuckets +func NewGetBucketsRequest(server string, params *GetBucketsParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "offset", *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "limit", *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Name != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "name", *params.Name); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostBucketsRequest calls the generic PostBuckets builder with application/json body +func NewPostBucketsRequest(server string, params *PostBucketsParams, body PostBucketsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostBucketsRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostBucketsRequestWithBody generates requests for PostBuckets with any type of body +func NewPostBucketsRequestWithBody(server string, params *PostBucketsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteBucketsIDRequest generates requests for DeleteBucketsID +func NewDeleteBucketsIDRequest(server string, bucketID string, params *DeleteBucketsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetBucketsIDRequest generates requests for GetBucketsID +func NewGetBucketsIDRequest(server string, bucketID string, params *GetBucketsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchBucketsIDRequest calls the generic PatchBucketsID builder with application/json body +func NewPatchBucketsIDRequest(server string, bucketID string, params *PatchBucketsIDParams, body PatchBucketsIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchBucketsIDRequestWithBody(server, bucketID, params, "application/json", bodyReader) +} + +// NewPatchBucketsIDRequestWithBody generates requests for PatchBucketsID with any type of body +func NewPatchBucketsIDRequestWithBody(server string, bucketID string, params *PatchBucketsIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetBucketsIDLabelsRequest generates requests for GetBucketsIDLabels +func NewGetBucketsIDLabelsRequest(server string, bucketID string, params *GetBucketsIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostBucketsIDLabelsRequest calls the generic PostBucketsIDLabels builder with application/json body +func NewPostBucketsIDLabelsRequest(server string, bucketID string, params *PostBucketsIDLabelsParams, body PostBucketsIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostBucketsIDLabelsRequestWithBody(server, bucketID, params, "application/json", bodyReader) +} + +// NewPostBucketsIDLabelsRequestWithBody generates requests for PostBucketsIDLabels with any type of body +func NewPostBucketsIDLabelsRequestWithBody(server string, bucketID string, params *PostBucketsIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteBucketsIDLabelsIDRequest generates requests for DeleteBucketsIDLabelsID +func NewDeleteBucketsIDLabelsIDRequest(server string, bucketID string, labelID string, params *DeleteBucketsIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetBucketsIDLogsRequest generates requests for GetBucketsIDLogs +func NewGetBucketsIDLogsRequest(server string, bucketID string, params *GetBucketsIDLogsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s/logs", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "offset", *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "limit", *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetBucketsIDMembersRequest generates requests for GetBucketsIDMembers +func NewGetBucketsIDMembersRequest(server string, bucketID string, params *GetBucketsIDMembersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostBucketsIDMembersRequest calls the generic PostBucketsIDMembers builder with application/json body +func NewPostBucketsIDMembersRequest(server string, bucketID string, params *PostBucketsIDMembersParams, body PostBucketsIDMembersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostBucketsIDMembersRequestWithBody(server, bucketID, params, "application/json", bodyReader) +} + +// NewPostBucketsIDMembersRequestWithBody generates requests for PostBucketsIDMembers with any type of body +func NewPostBucketsIDMembersRequestWithBody(server string, bucketID string, params *PostBucketsIDMembersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteBucketsIDMembersIDRequest generates requests for DeleteBucketsIDMembersID +func NewDeleteBucketsIDMembersIDRequest(server string, bucketID string, userID string, params *DeleteBucketsIDMembersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s/members/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetBucketsIDOwnersRequest generates requests for GetBucketsIDOwners +func NewGetBucketsIDOwnersRequest(server string, bucketID string, params *GetBucketsIDOwnersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostBucketsIDOwnersRequest calls the generic PostBucketsIDOwners builder with application/json body +func NewPostBucketsIDOwnersRequest(server string, bucketID string, params *PostBucketsIDOwnersParams, body PostBucketsIDOwnersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostBucketsIDOwnersRequestWithBody(server, bucketID, params, "application/json", bodyReader) +} + +// NewPostBucketsIDOwnersRequestWithBody generates requests for PostBucketsIDOwners with any type of body +func NewPostBucketsIDOwnersRequestWithBody(server string, bucketID string, params *PostBucketsIDOwnersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteBucketsIDOwnersIDRequest generates requests for DeleteBucketsIDOwnersID +func NewDeleteBucketsIDOwnersIDRequest(server string, bucketID string, userID string, params *DeleteBucketsIDOwnersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "bucketID", bucketID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/buckets/%s/owners/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetChecksRequest generates requests for GetChecks +func NewGetChecksRequest(server string, params *GetChecksParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/checks") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "offset", *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "limit", *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewCreateCheckRequest calls the generic CreateCheck builder with application/json body +func NewCreateCheckRequest(server string, body CreateCheckJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateCheckRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateCheckRequestWithBody generates requests for CreateCheck with any type of body +func NewCreateCheckRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/checks") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteChecksIDRequest generates requests for DeleteChecksID +func NewDeleteChecksIDRequest(server string, checkID string, params *DeleteChecksIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "checkID", checkID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/checks/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetChecksIDRequest generates requests for GetChecksID +func NewGetChecksIDRequest(server string, checkID string, params *GetChecksIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "checkID", checkID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/checks/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchChecksIDRequest calls the generic PatchChecksID builder with application/json body +func NewPatchChecksIDRequest(server string, checkID string, params *PatchChecksIDParams, body PatchChecksIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchChecksIDRequestWithBody(server, checkID, params, "application/json", bodyReader) +} + +// NewPatchChecksIDRequestWithBody generates requests for PatchChecksID with any type of body +func NewPatchChecksIDRequestWithBody(server string, checkID string, params *PatchChecksIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "checkID", checkID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/checks/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPutChecksIDRequest calls the generic PutChecksID builder with application/json body +func NewPutChecksIDRequest(server string, checkID string, params *PutChecksIDParams, body PutChecksIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutChecksIDRequestWithBody(server, checkID, params, "application/json", bodyReader) +} + +// NewPutChecksIDRequestWithBody generates requests for PutChecksID with any type of body +func NewPutChecksIDRequestWithBody(server string, checkID string, params *PutChecksIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "checkID", checkID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/checks/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetChecksIDLabelsRequest generates requests for GetChecksIDLabels +func NewGetChecksIDLabelsRequest(server string, checkID string, params *GetChecksIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "checkID", checkID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/checks/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostChecksIDLabelsRequest calls the generic PostChecksIDLabels builder with application/json body +func NewPostChecksIDLabelsRequest(server string, checkID string, params *PostChecksIDLabelsParams, body PostChecksIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostChecksIDLabelsRequestWithBody(server, checkID, params, "application/json", bodyReader) +} + +// NewPostChecksIDLabelsRequestWithBody generates requests for PostChecksIDLabels with any type of body +func NewPostChecksIDLabelsRequestWithBody(server string, checkID string, params *PostChecksIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "checkID", checkID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/checks/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteChecksIDLabelsIDRequest generates requests for DeleteChecksIDLabelsID +func NewDeleteChecksIDLabelsIDRequest(server string, checkID string, labelID string, params *DeleteChecksIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "checkID", checkID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/checks/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetChecksIDQueryRequest generates requests for GetChecksIDQuery +func NewGetChecksIDQueryRequest(server string, checkID string, params *GetChecksIDQueryParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "checkID", checkID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/checks/%s/query", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetDashboardsRequest generates requests for GetDashboards +func NewGetDashboardsRequest(server string, params *GetDashboardsParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Owner != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "owner", *params.Owner); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SortBy != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "sortBy", *params.SortBy); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Id != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "id", *params.Id); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostDashboardsRequest calls the generic PostDashboards builder with application/json body +func NewPostDashboardsRequest(server string, params *PostDashboardsParams, body PostDashboardsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostDashboardsRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostDashboardsRequestWithBody generates requests for PostDashboards with any type of body +func NewPostDashboardsRequestWithBody(server string, params *PostDashboardsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteDashboardsIDRequest generates requests for DeleteDashboardsID +func NewDeleteDashboardsIDRequest(server string, dashboardID string, params *DeleteDashboardsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetDashboardsIDRequest generates requests for GetDashboardsID +func NewGetDashboardsIDRequest(server string, dashboardID string, params *GetDashboardsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Include != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "include", *params.Include); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchDashboardsIDRequest calls the generic PatchDashboardsID builder with application/json body +func NewPatchDashboardsIDRequest(server string, dashboardID string, params *PatchDashboardsIDParams, body PatchDashboardsIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchDashboardsIDRequestWithBody(server, dashboardID, params, "application/json", bodyReader) +} + +// NewPatchDashboardsIDRequestWithBody generates requests for PatchDashboardsID with any type of body +func NewPatchDashboardsIDRequestWithBody(server string, dashboardID string, params *PatchDashboardsIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPostDashboardsIDCellsRequest calls the generic PostDashboardsIDCells builder with application/json body +func NewPostDashboardsIDCellsRequest(server string, dashboardID string, params *PostDashboardsIDCellsParams, body PostDashboardsIDCellsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostDashboardsIDCellsRequestWithBody(server, dashboardID, params, "application/json", bodyReader) +} + +// NewPostDashboardsIDCellsRequestWithBody generates requests for PostDashboardsIDCells with any type of body +func NewPostDashboardsIDCellsRequestWithBody(server string, dashboardID string, params *PostDashboardsIDCellsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/cells", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPutDashboardsIDCellsRequest calls the generic PutDashboardsIDCells builder with application/json body +func NewPutDashboardsIDCellsRequest(server string, dashboardID string, params *PutDashboardsIDCellsParams, body PutDashboardsIDCellsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutDashboardsIDCellsRequestWithBody(server, dashboardID, params, "application/json", bodyReader) +} + +// NewPutDashboardsIDCellsRequestWithBody generates requests for PutDashboardsIDCells with any type of body +func NewPutDashboardsIDCellsRequestWithBody(server string, dashboardID string, params *PutDashboardsIDCellsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/cells", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteDashboardsIDCellsIDRequest generates requests for DeleteDashboardsIDCellsID +func NewDeleteDashboardsIDCellsIDRequest(server string, dashboardID string, cellID string, params *DeleteDashboardsIDCellsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "cellID", cellID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/cells/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchDashboardsIDCellsIDRequest calls the generic PatchDashboardsIDCellsID builder with application/json body +func NewPatchDashboardsIDCellsIDRequest(server string, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDParams, body PatchDashboardsIDCellsIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchDashboardsIDCellsIDRequestWithBody(server, dashboardID, cellID, params, "application/json", bodyReader) +} + +// NewPatchDashboardsIDCellsIDRequestWithBody generates requests for PatchDashboardsIDCellsID with any type of body +func NewPatchDashboardsIDCellsIDRequestWithBody(server string, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "cellID", cellID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/cells/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetDashboardsIDCellsIDViewRequest generates requests for GetDashboardsIDCellsIDView +func NewGetDashboardsIDCellsIDViewRequest(server string, dashboardID string, cellID string, params *GetDashboardsIDCellsIDViewParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "cellID", cellID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/cells/%s/view", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchDashboardsIDCellsIDViewRequest calls the generic PatchDashboardsIDCellsIDView builder with application/json body +func NewPatchDashboardsIDCellsIDViewRequest(server string, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDViewParams, body PatchDashboardsIDCellsIDViewJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchDashboardsIDCellsIDViewRequestWithBody(server, dashboardID, cellID, params, "application/json", bodyReader) +} + +// NewPatchDashboardsIDCellsIDViewRequestWithBody generates requests for PatchDashboardsIDCellsIDView with any type of body +func NewPatchDashboardsIDCellsIDViewRequestWithBody(server string, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDViewParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "cellID", cellID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/cells/%s/view", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetDashboardsIDLabelsRequest generates requests for GetDashboardsIDLabels +func NewGetDashboardsIDLabelsRequest(server string, dashboardID string, params *GetDashboardsIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostDashboardsIDLabelsRequest calls the generic PostDashboardsIDLabels builder with application/json body +func NewPostDashboardsIDLabelsRequest(server string, dashboardID string, params *PostDashboardsIDLabelsParams, body PostDashboardsIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostDashboardsIDLabelsRequestWithBody(server, dashboardID, params, "application/json", bodyReader) +} + +// NewPostDashboardsIDLabelsRequestWithBody generates requests for PostDashboardsIDLabels with any type of body +func NewPostDashboardsIDLabelsRequestWithBody(server string, dashboardID string, params *PostDashboardsIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteDashboardsIDLabelsIDRequest generates requests for DeleteDashboardsIDLabelsID +func NewDeleteDashboardsIDLabelsIDRequest(server string, dashboardID string, labelID string, params *DeleteDashboardsIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetDashboardsIDLogsRequest generates requests for GetDashboardsIDLogs +func NewGetDashboardsIDLogsRequest(server string, dashboardID string, params *GetDashboardsIDLogsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/logs", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "offset", *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "limit", *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetDashboardsIDMembersRequest generates requests for GetDashboardsIDMembers +func NewGetDashboardsIDMembersRequest(server string, dashboardID string, params *GetDashboardsIDMembersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostDashboardsIDMembersRequest calls the generic PostDashboardsIDMembers builder with application/json body +func NewPostDashboardsIDMembersRequest(server string, dashboardID string, params *PostDashboardsIDMembersParams, body PostDashboardsIDMembersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostDashboardsIDMembersRequestWithBody(server, dashboardID, params, "application/json", bodyReader) +} + +// NewPostDashboardsIDMembersRequestWithBody generates requests for PostDashboardsIDMembers with any type of body +func NewPostDashboardsIDMembersRequestWithBody(server string, dashboardID string, params *PostDashboardsIDMembersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteDashboardsIDMembersIDRequest generates requests for DeleteDashboardsIDMembersID +func NewDeleteDashboardsIDMembersIDRequest(server string, dashboardID string, userID string, params *DeleteDashboardsIDMembersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/members/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetDashboardsIDOwnersRequest generates requests for GetDashboardsIDOwners +func NewGetDashboardsIDOwnersRequest(server string, dashboardID string, params *GetDashboardsIDOwnersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostDashboardsIDOwnersRequest calls the generic PostDashboardsIDOwners builder with application/json body +func NewPostDashboardsIDOwnersRequest(server string, dashboardID string, params *PostDashboardsIDOwnersParams, body PostDashboardsIDOwnersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostDashboardsIDOwnersRequestWithBody(server, dashboardID, params, "application/json", bodyReader) +} + +// NewPostDashboardsIDOwnersRequestWithBody generates requests for PostDashboardsIDOwners with any type of body +func NewPostDashboardsIDOwnersRequestWithBody(server string, dashboardID string, params *PostDashboardsIDOwnersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteDashboardsIDOwnersIDRequest generates requests for DeleteDashboardsIDOwnersID +func NewDeleteDashboardsIDOwnersIDRequest(server string, dashboardID string, userID string, params *DeleteDashboardsIDOwnersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "dashboardID", dashboardID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/dashboards/%s/owners/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostDeleteRequest calls the generic PostDelete builder with application/json body +func NewPostDeleteRequest(server string, params *PostDeleteParams, body PostDeleteJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostDeleteRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostDeleteRequestWithBody generates requests for PostDelete with any type of body +func NewPostDeleteRequestWithBody(server string, params *PostDeleteParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/delete") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Bucket != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "bucket", *params.Bucket); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BucketID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "bucketID", *params.BucketID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetDocumentsTemplatesRequest generates requests for GetDocumentsTemplates +func NewGetDocumentsTemplatesRequest(server string, params *GetDocumentsTemplatesParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/documents/templates") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostDocumentsTemplatesRequest calls the generic PostDocumentsTemplates builder with application/json body +func NewPostDocumentsTemplatesRequest(server string, params *PostDocumentsTemplatesParams, body PostDocumentsTemplatesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostDocumentsTemplatesRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostDocumentsTemplatesRequestWithBody generates requests for PostDocumentsTemplates with any type of body +func NewPostDocumentsTemplatesRequestWithBody(server string, params *PostDocumentsTemplatesParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/documents/templates") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteDocumentsTemplatesIDRequest generates requests for DeleteDocumentsTemplatesID +func NewDeleteDocumentsTemplatesIDRequest(server string, templateID string, params *DeleteDocumentsTemplatesIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "templateID", templateID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/documents/templates/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetDocumentsTemplatesIDRequest generates requests for GetDocumentsTemplatesID +func NewGetDocumentsTemplatesIDRequest(server string, templateID string, params *GetDocumentsTemplatesIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "templateID", templateID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/documents/templates/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPutDocumentsTemplatesIDRequest calls the generic PutDocumentsTemplatesID builder with application/json body +func NewPutDocumentsTemplatesIDRequest(server string, templateID string, params *PutDocumentsTemplatesIDParams, body PutDocumentsTemplatesIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutDocumentsTemplatesIDRequestWithBody(server, templateID, params, "application/json", bodyReader) +} + +// NewPutDocumentsTemplatesIDRequestWithBody generates requests for PutDocumentsTemplatesID with any type of body +func NewPutDocumentsTemplatesIDRequestWithBody(server string, templateID string, params *PutDocumentsTemplatesIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "templateID", templateID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/documents/templates/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetDocumentsTemplatesIDLabelsRequest generates requests for GetDocumentsTemplatesIDLabels +func NewGetDocumentsTemplatesIDLabelsRequest(server string, templateID string, params *GetDocumentsTemplatesIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "templateID", templateID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/documents/templates/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostDocumentsTemplatesIDLabelsRequest calls the generic PostDocumentsTemplatesIDLabels builder with application/json body +func NewPostDocumentsTemplatesIDLabelsRequest(server string, templateID string, params *PostDocumentsTemplatesIDLabelsParams, body PostDocumentsTemplatesIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostDocumentsTemplatesIDLabelsRequestWithBody(server, templateID, params, "application/json", bodyReader) +} + +// NewPostDocumentsTemplatesIDLabelsRequestWithBody generates requests for PostDocumentsTemplatesIDLabels with any type of body +func NewPostDocumentsTemplatesIDLabelsRequestWithBody(server string, templateID string, params *PostDocumentsTemplatesIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "templateID", templateID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/documents/templates/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteDocumentsTemplatesIDLabelsIDRequest generates requests for DeleteDocumentsTemplatesIDLabelsID +func NewDeleteDocumentsTemplatesIDLabelsIDRequest(server string, templateID string, labelID string, params *DeleteDocumentsTemplatesIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "templateID", templateID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/documents/templates/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetHealthRequest generates requests for GetHealth +func NewGetHealthRequest(server string, params *GetHealthParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/health") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetLabelsRequest generates requests for GetLabels +func NewGetLabelsRequest(server string, params *GetLabelsParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/labels") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostLabelsRequest calls the generic PostLabels builder with application/json body +func NewPostLabelsRequest(server string, body PostLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostLabelsRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostLabelsRequestWithBody generates requests for PostLabels with any type of body +func NewPostLabelsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/labels") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteLabelsIDRequest generates requests for DeleteLabelsID +func NewDeleteLabelsIDRequest(server string, labelID string, params *DeleteLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/labels/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetLabelsIDRequest generates requests for GetLabelsID +func NewGetLabelsIDRequest(server string, labelID string, params *GetLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/labels/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchLabelsIDRequest calls the generic PatchLabelsID builder with application/json body +func NewPatchLabelsIDRequest(server string, labelID string, params *PatchLabelsIDParams, body PatchLabelsIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchLabelsIDRequestWithBody(server, labelID, params, "application/json", bodyReader) +} + +// NewPatchLabelsIDRequestWithBody generates requests for PatchLabelsID with any type of body +func NewPatchLabelsIDRequestWithBody(server string, labelID string, params *PatchLabelsIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/labels/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetMeRequest generates requests for GetMe +func NewGetMeRequest(server string, params *GetMeParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/me") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPutMePasswordRequest calls the generic PutMePassword builder with application/json body +func NewPutMePasswordRequest(server string, params *PutMePasswordParams, body PutMePasswordJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutMePasswordRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPutMePasswordRequestWithBody generates requests for PutMePassword with any type of body +func NewPutMePasswordRequestWithBody(server string, params *PutMePasswordParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/me/password") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetNotificationEndpointsRequest generates requests for GetNotificationEndpoints +func NewGetNotificationEndpointsRequest(server string, params *GetNotificationEndpointsParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationEndpoints") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "offset", *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "limit", *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewCreateNotificationEndpointRequest calls the generic CreateNotificationEndpoint builder with application/json body +func NewCreateNotificationEndpointRequest(server string, body CreateNotificationEndpointJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateNotificationEndpointRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateNotificationEndpointRequestWithBody generates requests for CreateNotificationEndpoint with any type of body +func NewCreateNotificationEndpointRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationEndpoints") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteNotificationEndpointsIDRequest generates requests for DeleteNotificationEndpointsID +func NewDeleteNotificationEndpointsIDRequest(server string, endpointID string, params *DeleteNotificationEndpointsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "endpointID", endpointID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationEndpoints/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetNotificationEndpointsIDRequest generates requests for GetNotificationEndpointsID +func NewGetNotificationEndpointsIDRequest(server string, endpointID string, params *GetNotificationEndpointsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "endpointID", endpointID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationEndpoints/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchNotificationEndpointsIDRequest calls the generic PatchNotificationEndpointsID builder with application/json body +func NewPatchNotificationEndpointsIDRequest(server string, endpointID string, params *PatchNotificationEndpointsIDParams, body PatchNotificationEndpointsIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchNotificationEndpointsIDRequestWithBody(server, endpointID, params, "application/json", bodyReader) +} + +// NewPatchNotificationEndpointsIDRequestWithBody generates requests for PatchNotificationEndpointsID with any type of body +func NewPatchNotificationEndpointsIDRequestWithBody(server string, endpointID string, params *PatchNotificationEndpointsIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "endpointID", endpointID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationEndpoints/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPutNotificationEndpointsIDRequest calls the generic PutNotificationEndpointsID builder with application/json body +func NewPutNotificationEndpointsIDRequest(server string, endpointID string, params *PutNotificationEndpointsIDParams, body PutNotificationEndpointsIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutNotificationEndpointsIDRequestWithBody(server, endpointID, params, "application/json", bodyReader) +} + +// NewPutNotificationEndpointsIDRequestWithBody generates requests for PutNotificationEndpointsID with any type of body +func NewPutNotificationEndpointsIDRequestWithBody(server string, endpointID string, params *PutNotificationEndpointsIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "endpointID", endpointID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationEndpoints/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetNotificationEndpointsIDLabelsRequest generates requests for GetNotificationEndpointsIDLabels +func NewGetNotificationEndpointsIDLabelsRequest(server string, endpointID string, params *GetNotificationEndpointsIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "endpointID", endpointID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationEndpoints/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostNotificationEndpointIDLabelsRequest calls the generic PostNotificationEndpointIDLabels builder with application/json body +func NewPostNotificationEndpointIDLabelsRequest(server string, endpointID string, params *PostNotificationEndpointIDLabelsParams, body PostNotificationEndpointIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostNotificationEndpointIDLabelsRequestWithBody(server, endpointID, params, "application/json", bodyReader) +} + +// NewPostNotificationEndpointIDLabelsRequestWithBody generates requests for PostNotificationEndpointIDLabels with any type of body +func NewPostNotificationEndpointIDLabelsRequestWithBody(server string, endpointID string, params *PostNotificationEndpointIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "endpointID", endpointID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationEndpoints/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteNotificationEndpointsIDLabelsIDRequest generates requests for DeleteNotificationEndpointsIDLabelsID +func NewDeleteNotificationEndpointsIDLabelsIDRequest(server string, endpointID string, labelID string, params *DeleteNotificationEndpointsIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "endpointID", endpointID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationEndpoints/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetNotificationRulesRequest generates requests for GetNotificationRules +func NewGetNotificationRulesRequest(server string, params *GetNotificationRulesParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationRules") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "offset", *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "limit", *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.CheckID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "checkID", *params.CheckID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Tag != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "tag", *params.Tag); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewCreateNotificationRuleRequest calls the generic CreateNotificationRule builder with application/json body +func NewCreateNotificationRuleRequest(server string, body CreateNotificationRuleJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateNotificationRuleRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateNotificationRuleRequestWithBody generates requests for CreateNotificationRule with any type of body +func NewCreateNotificationRuleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationRules") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteNotificationRulesIDRequest generates requests for DeleteNotificationRulesID +func NewDeleteNotificationRulesIDRequest(server string, ruleID string, params *DeleteNotificationRulesIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "ruleID", ruleID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationRules/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetNotificationRulesIDRequest generates requests for GetNotificationRulesID +func NewGetNotificationRulesIDRequest(server string, ruleID string, params *GetNotificationRulesIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "ruleID", ruleID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationRules/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchNotificationRulesIDRequest calls the generic PatchNotificationRulesID builder with application/json body +func NewPatchNotificationRulesIDRequest(server string, ruleID string, params *PatchNotificationRulesIDParams, body PatchNotificationRulesIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchNotificationRulesIDRequestWithBody(server, ruleID, params, "application/json", bodyReader) +} + +// NewPatchNotificationRulesIDRequestWithBody generates requests for PatchNotificationRulesID with any type of body +func NewPatchNotificationRulesIDRequestWithBody(server string, ruleID string, params *PatchNotificationRulesIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "ruleID", ruleID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationRules/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPutNotificationRulesIDRequest calls the generic PutNotificationRulesID builder with application/json body +func NewPutNotificationRulesIDRequest(server string, ruleID string, params *PutNotificationRulesIDParams, body PutNotificationRulesIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutNotificationRulesIDRequestWithBody(server, ruleID, params, "application/json", bodyReader) +} + +// NewPutNotificationRulesIDRequestWithBody generates requests for PutNotificationRulesID with any type of body +func NewPutNotificationRulesIDRequestWithBody(server string, ruleID string, params *PutNotificationRulesIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "ruleID", ruleID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationRules/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetNotificationRulesIDLabelsRequest generates requests for GetNotificationRulesIDLabels +func NewGetNotificationRulesIDLabelsRequest(server string, ruleID string, params *GetNotificationRulesIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "ruleID", ruleID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationRules/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostNotificationRuleIDLabelsRequest calls the generic PostNotificationRuleIDLabels builder with application/json body +func NewPostNotificationRuleIDLabelsRequest(server string, ruleID string, params *PostNotificationRuleIDLabelsParams, body PostNotificationRuleIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostNotificationRuleIDLabelsRequestWithBody(server, ruleID, params, "application/json", bodyReader) +} + +// NewPostNotificationRuleIDLabelsRequestWithBody generates requests for PostNotificationRuleIDLabels with any type of body +func NewPostNotificationRuleIDLabelsRequestWithBody(server string, ruleID string, params *PostNotificationRuleIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "ruleID", ruleID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationRules/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteNotificationRulesIDLabelsIDRequest generates requests for DeleteNotificationRulesIDLabelsID +func NewDeleteNotificationRulesIDLabelsIDRequest(server string, ruleID string, labelID string, params *DeleteNotificationRulesIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "ruleID", ruleID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationRules/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetNotificationRulesIDQueryRequest generates requests for GetNotificationRulesIDQuery +func NewGetNotificationRulesIDQueryRequest(server string, ruleID string, params *GetNotificationRulesIDQueryParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "ruleID", ruleID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/notificationRules/%s/query", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetOrgsRequest generates requests for GetOrgs +func NewGetOrgsRequest(server string, params *GetOrgsParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostOrgsRequest calls the generic PostOrgs builder with application/json body +func NewPostOrgsRequest(server string, params *PostOrgsParams, body PostOrgsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostOrgsRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostOrgsRequestWithBody generates requests for PostOrgs with any type of body +func NewPostOrgsRequestWithBody(server string, params *PostOrgsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteOrgsIDRequest generates requests for DeleteOrgsID +func NewDeleteOrgsIDRequest(server string, orgID string, params *DeleteOrgsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetOrgsIDRequest generates requests for GetOrgsID +func NewGetOrgsIDRequest(server string, orgID string, params *GetOrgsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchOrgsIDRequest calls the generic PatchOrgsID builder with application/json body +func NewPatchOrgsIDRequest(server string, orgID string, params *PatchOrgsIDParams, body PatchOrgsIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchOrgsIDRequestWithBody(server, orgID, params, "application/json", bodyReader) +} + +// NewPatchOrgsIDRequestWithBody generates requests for PatchOrgsID with any type of body +func NewPatchOrgsIDRequestWithBody(server string, orgID string, params *PatchOrgsIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetOrgsIDLabelsRequest generates requests for GetOrgsIDLabels +func NewGetOrgsIDLabelsRequest(server string, orgID string, params *GetOrgsIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostOrgsIDLabelsRequest calls the generic PostOrgsIDLabels builder with application/json body +func NewPostOrgsIDLabelsRequest(server string, orgID string, params *PostOrgsIDLabelsParams, body PostOrgsIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostOrgsIDLabelsRequestWithBody(server, orgID, params, "application/json", bodyReader) +} + +// NewPostOrgsIDLabelsRequestWithBody generates requests for PostOrgsIDLabels with any type of body +func NewPostOrgsIDLabelsRequestWithBody(server string, orgID string, params *PostOrgsIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteOrgsIDLabelsIDRequest generates requests for DeleteOrgsIDLabelsID +func NewDeleteOrgsIDLabelsIDRequest(server string, orgID string, labelID string, params *DeleteOrgsIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetOrgsIDLogsRequest generates requests for GetOrgsIDLogs +func NewGetOrgsIDLogsRequest(server string, orgID string, params *GetOrgsIDLogsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/logs", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "offset", *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "limit", *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetOrgsIDMembersRequest generates requests for GetOrgsIDMembers +func NewGetOrgsIDMembersRequest(server string, orgID string, params *GetOrgsIDMembersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostOrgsIDMembersRequest calls the generic PostOrgsIDMembers builder with application/json body +func NewPostOrgsIDMembersRequest(server string, orgID string, params *PostOrgsIDMembersParams, body PostOrgsIDMembersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostOrgsIDMembersRequestWithBody(server, orgID, params, "application/json", bodyReader) +} + +// NewPostOrgsIDMembersRequestWithBody generates requests for PostOrgsIDMembers with any type of body +func NewPostOrgsIDMembersRequestWithBody(server string, orgID string, params *PostOrgsIDMembersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteOrgsIDMembersIDRequest generates requests for DeleteOrgsIDMembersID +func NewDeleteOrgsIDMembersIDRequest(server string, orgID string, userID string, params *DeleteOrgsIDMembersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/members/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetOrgsIDOwnersRequest generates requests for GetOrgsIDOwners +func NewGetOrgsIDOwnersRequest(server string, orgID string, params *GetOrgsIDOwnersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostOrgsIDOwnersRequest calls the generic PostOrgsIDOwners builder with application/json body +func NewPostOrgsIDOwnersRequest(server string, orgID string, params *PostOrgsIDOwnersParams, body PostOrgsIDOwnersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostOrgsIDOwnersRequestWithBody(server, orgID, params, "application/json", bodyReader) +} + +// NewPostOrgsIDOwnersRequestWithBody generates requests for PostOrgsIDOwners with any type of body +func NewPostOrgsIDOwnersRequestWithBody(server string, orgID string, params *PostOrgsIDOwnersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteOrgsIDOwnersIDRequest generates requests for DeleteOrgsIDOwnersID +func NewDeleteOrgsIDOwnersIDRequest(server string, orgID string, userID string, params *DeleteOrgsIDOwnersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/owners/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetOrgsIDSecretsRequest generates requests for GetOrgsIDSecrets +func NewGetOrgsIDSecretsRequest(server string, orgID string, params *GetOrgsIDSecretsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/secrets", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchOrgsIDSecretsRequest calls the generic PatchOrgsIDSecrets builder with application/json body +func NewPatchOrgsIDSecretsRequest(server string, orgID string, params *PatchOrgsIDSecretsParams, body PatchOrgsIDSecretsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchOrgsIDSecretsRequestWithBody(server, orgID, params, "application/json", bodyReader) +} + +// NewPatchOrgsIDSecretsRequestWithBody generates requests for PatchOrgsIDSecrets with any type of body +func NewPatchOrgsIDSecretsRequestWithBody(server string, orgID string, params *PatchOrgsIDSecretsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/secrets", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPostOrgsIDSecretsRequest calls the generic PostOrgsIDSecrets builder with application/json body +func NewPostOrgsIDSecretsRequest(server string, orgID string, params *PostOrgsIDSecretsParams, body PostOrgsIDSecretsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostOrgsIDSecretsRequestWithBody(server, orgID, params, "application/json", bodyReader) +} + +// NewPostOrgsIDSecretsRequestWithBody generates requests for PostOrgsIDSecrets with any type of body +func NewPostOrgsIDSecretsRequestWithBody(server string, orgID string, params *PostOrgsIDSecretsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "orgID", orgID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/orgs/%s/secrets/delete", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewCreatePkgRequest calls the generic CreatePkg builder with application/json body +func NewCreatePkgRequest(server string, body CreatePkgJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreatePkgRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreatePkgRequestWithBody generates requests for CreatePkg with any type of body +func NewCreatePkgRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/packages") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewApplyPkgRequest calls the generic ApplyPkg builder with application/json body +func NewApplyPkgRequest(server string, body ApplyPkgJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewApplyPkgRequestWithBody(server, "application/json", bodyReader) +} + +// NewApplyPkgRequestWithBody generates requests for ApplyPkg with any type of body +func NewApplyPkgRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/packages/apply") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPostQueryRequest calls the generic PostQuery builder with application/json body +func NewPostQueryRequest(server string, params *PostQueryParams, body PostQueryJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostQueryRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostQueryRequestWithBody generates requests for PostQuery with any type of body +func NewPostQueryRequestWithBody(server string, params *PostQueryParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/query") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + if params.AcceptEncoding != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParam("simple", false, "Accept-Encoding", *params.AcceptEncoding) + if err != nil { + return nil, err + } + + req.Header.Add("Accept-Encoding", headerParam1) + } + + if params.ContentType != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParam("simple", false, "Content-Type", *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", headerParam2) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPostQueryAnalyzeRequest calls the generic PostQueryAnalyze builder with application/json body +func NewPostQueryAnalyzeRequest(server string, params *PostQueryAnalyzeParams, body PostQueryAnalyzeJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostQueryAnalyzeRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostQueryAnalyzeRequestWithBody generates requests for PostQueryAnalyze with any type of body +func NewPostQueryAnalyzeRequestWithBody(server string, params *PostQueryAnalyzeParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/query/analyze") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + if params.ContentType != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParam("simple", false, "Content-Type", *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", headerParam1) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPostQueryAstRequest calls the generic PostQueryAst builder with application/json body +func NewPostQueryAstRequest(server string, params *PostQueryAstParams, body PostQueryAstJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostQueryAstRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostQueryAstRequestWithBody generates requests for PostQueryAst with any type of body +func NewPostQueryAstRequestWithBody(server string, params *PostQueryAstParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/query/ast") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + if params.ContentType != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParam("simple", false, "Content-Type", *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", headerParam1) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetQuerySuggestionsRequest generates requests for GetQuerySuggestions +func NewGetQuerySuggestionsRequest(server string, params *GetQuerySuggestionsParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/query/suggestions") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetQuerySuggestionsNameRequest generates requests for GetQuerySuggestionsName +func NewGetQuerySuggestionsNameRequest(server string, name string, params *GetQuerySuggestionsNameParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "name", name) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/query/suggestions/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetReadyRequest generates requests for GetReady +func NewGetReadyRequest(server string, params *GetReadyParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/ready") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetScrapersRequest generates requests for GetScrapers +func NewGetScrapersRequest(server string, params *GetScrapersParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Name != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "name", *params.Name); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Id != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "id", *params.Id); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostScrapersRequest calls the generic PostScrapers builder with application/json body +func NewPostScrapersRequest(server string, params *PostScrapersParams, body PostScrapersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostScrapersRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostScrapersRequestWithBody generates requests for PostScrapers with any type of body +func NewPostScrapersRequestWithBody(server string, params *PostScrapersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteScrapersIDRequest generates requests for DeleteScrapersID +func NewDeleteScrapersIDRequest(server string, scraperTargetID string, params *DeleteScrapersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetScrapersIDRequest generates requests for GetScrapersID +func NewGetScrapersIDRequest(server string, scraperTargetID string, params *GetScrapersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchScrapersIDRequest calls the generic PatchScrapersID builder with application/json body +func NewPatchScrapersIDRequest(server string, scraperTargetID string, params *PatchScrapersIDParams, body PatchScrapersIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchScrapersIDRequestWithBody(server, scraperTargetID, params, "application/json", bodyReader) +} + +// NewPatchScrapersIDRequestWithBody generates requests for PatchScrapersID with any type of body +func NewPatchScrapersIDRequestWithBody(server string, scraperTargetID string, params *PatchScrapersIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetScrapersIDLabelsRequest generates requests for GetScrapersIDLabels +func NewGetScrapersIDLabelsRequest(server string, scraperTargetID string, params *GetScrapersIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostScrapersIDLabelsRequest calls the generic PostScrapersIDLabels builder with application/json body +func NewPostScrapersIDLabelsRequest(server string, scraperTargetID string, params *PostScrapersIDLabelsParams, body PostScrapersIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostScrapersIDLabelsRequestWithBody(server, scraperTargetID, params, "application/json", bodyReader) +} + +// NewPostScrapersIDLabelsRequestWithBody generates requests for PostScrapersIDLabels with any type of body +func NewPostScrapersIDLabelsRequestWithBody(server string, scraperTargetID string, params *PostScrapersIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteScrapersIDLabelsIDRequest generates requests for DeleteScrapersIDLabelsID +func NewDeleteScrapersIDLabelsIDRequest(server string, scraperTargetID string, labelID string, params *DeleteScrapersIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchScrapersIDLabelsIDRequest calls the generic PatchScrapersIDLabelsID builder with application/json body +func NewPatchScrapersIDLabelsIDRequest(server string, scraperTargetID string, labelID string, params *PatchScrapersIDLabelsIDParams, body PatchScrapersIDLabelsIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchScrapersIDLabelsIDRequestWithBody(server, scraperTargetID, labelID, params, "application/json", bodyReader) +} + +// NewPatchScrapersIDLabelsIDRequestWithBody generates requests for PatchScrapersIDLabelsID with any type of body +func NewPatchScrapersIDLabelsIDRequestWithBody(server string, scraperTargetID string, labelID string, params *PatchScrapersIDLabelsIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetScrapersIDMembersRequest generates requests for GetScrapersIDMembers +func NewGetScrapersIDMembersRequest(server string, scraperTargetID string, params *GetScrapersIDMembersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostScrapersIDMembersRequest calls the generic PostScrapersIDMembers builder with application/json body +func NewPostScrapersIDMembersRequest(server string, scraperTargetID string, params *PostScrapersIDMembersParams, body PostScrapersIDMembersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostScrapersIDMembersRequestWithBody(server, scraperTargetID, params, "application/json", bodyReader) +} + +// NewPostScrapersIDMembersRequestWithBody generates requests for PostScrapersIDMembers with any type of body +func NewPostScrapersIDMembersRequestWithBody(server string, scraperTargetID string, params *PostScrapersIDMembersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteScrapersIDMembersIDRequest generates requests for DeleteScrapersIDMembersID +func NewDeleteScrapersIDMembersIDRequest(server string, scraperTargetID string, userID string, params *DeleteScrapersIDMembersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s/members/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetScrapersIDOwnersRequest generates requests for GetScrapersIDOwners +func NewGetScrapersIDOwnersRequest(server string, scraperTargetID string, params *GetScrapersIDOwnersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostScrapersIDOwnersRequest calls the generic PostScrapersIDOwners builder with application/json body +func NewPostScrapersIDOwnersRequest(server string, scraperTargetID string, params *PostScrapersIDOwnersParams, body PostScrapersIDOwnersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostScrapersIDOwnersRequestWithBody(server, scraperTargetID, params, "application/json", bodyReader) +} + +// NewPostScrapersIDOwnersRequestWithBody generates requests for PostScrapersIDOwners with any type of body +func NewPostScrapersIDOwnersRequestWithBody(server string, scraperTargetID string, params *PostScrapersIDOwnersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteScrapersIDOwnersIDRequest generates requests for DeleteScrapersIDOwnersID +func NewDeleteScrapersIDOwnersIDRequest(server string, scraperTargetID string, userID string, params *DeleteScrapersIDOwnersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "scraperTargetID", scraperTargetID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/scrapers/%s/owners/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetSetupRequest generates requests for GetSetup +func NewGetSetupRequest(server string, params *GetSetupParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/setup") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostSetupRequest calls the generic PostSetup builder with application/json body +func NewPostSetupRequest(server string, params *PostSetupParams, body PostSetupJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSetupRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostSetupRequestWithBody generates requests for PostSetup with any type of body +func NewPostSetupRequestWithBody(server string, params *PostSetupParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/setup") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPostSigninRequest generates requests for PostSignin +func NewPostSigninRequest(server string, params *PostSigninParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/signin") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostSignoutRequest generates requests for PostSignout +func NewPostSignoutRequest(server string, params *PostSignoutParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/signout") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetSourcesRequest generates requests for GetSources +func NewGetSourcesRequest(server string, params *GetSourcesParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/sources") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostSourcesRequest calls the generic PostSources builder with application/json body +func NewPostSourcesRequest(server string, params *PostSourcesParams, body PostSourcesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSourcesRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostSourcesRequestWithBody generates requests for PostSources with any type of body +func NewPostSourcesRequestWithBody(server string, params *PostSourcesParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/sources") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteSourcesIDRequest generates requests for DeleteSourcesID +func NewDeleteSourcesIDRequest(server string, sourceID string, params *DeleteSourcesIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "sourceID", sourceID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/sources/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetSourcesIDRequest generates requests for GetSourcesID +func NewGetSourcesIDRequest(server string, sourceID string, params *GetSourcesIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "sourceID", sourceID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/sources/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchSourcesIDRequest calls the generic PatchSourcesID builder with application/json body +func NewPatchSourcesIDRequest(server string, sourceID string, params *PatchSourcesIDParams, body PatchSourcesIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchSourcesIDRequestWithBody(server, sourceID, params, "application/json", bodyReader) +} + +// NewPatchSourcesIDRequestWithBody generates requests for PatchSourcesID with any type of body +func NewPatchSourcesIDRequestWithBody(server string, sourceID string, params *PatchSourcesIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "sourceID", sourceID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/sources/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetSourcesIDBucketsRequest generates requests for GetSourcesIDBuckets +func NewGetSourcesIDBucketsRequest(server string, sourceID string, params *GetSourcesIDBucketsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "sourceID", sourceID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/sources/%s/buckets", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetSourcesIDHealthRequest generates requests for GetSourcesIDHealth +func NewGetSourcesIDHealthRequest(server string, sourceID string, params *GetSourcesIDHealthParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "sourceID", sourceID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/sources/%s/health", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTasksRequest generates requests for GetTasks +func NewGetTasksRequest(server string, params *GetTasksParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Name != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "name", *params.Name); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.After != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "after", *params.After); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.User != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "user", *params.User); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Status != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "status", *params.Status); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "limit", *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostTasksRequest calls the generic PostTasks builder with application/json body +func NewPostTasksRequest(server string, params *PostTasksParams, body PostTasksJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostTasksRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostTasksRequestWithBody generates requests for PostTasks with any type of body +func NewPostTasksRequestWithBody(server string, params *PostTasksParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteTasksIDRequest generates requests for DeleteTasksID +func NewDeleteTasksIDRequest(server string, taskID string, params *DeleteTasksIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTasksIDRequest generates requests for GetTasksID +func NewGetTasksIDRequest(server string, taskID string, params *GetTasksIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchTasksIDRequest calls the generic PatchTasksID builder with application/json body +func NewPatchTasksIDRequest(server string, taskID string, params *PatchTasksIDParams, body PatchTasksIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchTasksIDRequestWithBody(server, taskID, params, "application/json", bodyReader) +} + +// NewPatchTasksIDRequestWithBody generates requests for PatchTasksID with any type of body +func NewPatchTasksIDRequestWithBody(server string, taskID string, params *PatchTasksIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetTasksIDLabelsRequest generates requests for GetTasksIDLabels +func NewGetTasksIDLabelsRequest(server string, taskID string, params *GetTasksIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostTasksIDLabelsRequest calls the generic PostTasksIDLabels builder with application/json body +func NewPostTasksIDLabelsRequest(server string, taskID string, params *PostTasksIDLabelsParams, body PostTasksIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostTasksIDLabelsRequestWithBody(server, taskID, params, "application/json", bodyReader) +} + +// NewPostTasksIDLabelsRequestWithBody generates requests for PostTasksIDLabels with any type of body +func NewPostTasksIDLabelsRequestWithBody(server string, taskID string, params *PostTasksIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteTasksIDLabelsIDRequest generates requests for DeleteTasksIDLabelsID +func NewDeleteTasksIDLabelsIDRequest(server string, taskID string, labelID string, params *DeleteTasksIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTasksIDLogsRequest generates requests for GetTasksIDLogs +func NewGetTasksIDLogsRequest(server string, taskID string, params *GetTasksIDLogsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/logs", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTasksIDMembersRequest generates requests for GetTasksIDMembers +func NewGetTasksIDMembersRequest(server string, taskID string, params *GetTasksIDMembersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostTasksIDMembersRequest calls the generic PostTasksIDMembers builder with application/json body +func NewPostTasksIDMembersRequest(server string, taskID string, params *PostTasksIDMembersParams, body PostTasksIDMembersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostTasksIDMembersRequestWithBody(server, taskID, params, "application/json", bodyReader) +} + +// NewPostTasksIDMembersRequestWithBody generates requests for PostTasksIDMembers with any type of body +func NewPostTasksIDMembersRequestWithBody(server string, taskID string, params *PostTasksIDMembersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteTasksIDMembersIDRequest generates requests for DeleteTasksIDMembersID +func NewDeleteTasksIDMembersIDRequest(server string, taskID string, userID string, params *DeleteTasksIDMembersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/members/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTasksIDOwnersRequest generates requests for GetTasksIDOwners +func NewGetTasksIDOwnersRequest(server string, taskID string, params *GetTasksIDOwnersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostTasksIDOwnersRequest calls the generic PostTasksIDOwners builder with application/json body +func NewPostTasksIDOwnersRequest(server string, taskID string, params *PostTasksIDOwnersParams, body PostTasksIDOwnersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostTasksIDOwnersRequestWithBody(server, taskID, params, "application/json", bodyReader) +} + +// NewPostTasksIDOwnersRequestWithBody generates requests for PostTasksIDOwners with any type of body +func NewPostTasksIDOwnersRequestWithBody(server string, taskID string, params *PostTasksIDOwnersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteTasksIDOwnersIDRequest generates requests for DeleteTasksIDOwnersID +func NewDeleteTasksIDOwnersIDRequest(server string, taskID string, userID string, params *DeleteTasksIDOwnersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/owners/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTasksIDRunsRequest generates requests for GetTasksIDRuns +func NewGetTasksIDRunsRequest(server string, taskID string, params *GetTasksIDRunsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/runs", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.After != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "after", *params.After); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "limit", *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.AfterTime != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "afterTime", *params.AfterTime); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BeforeTime != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "beforeTime", *params.BeforeTime); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostTasksIDRunsRequest calls the generic PostTasksIDRuns builder with application/json body +func NewPostTasksIDRunsRequest(server string, taskID string, params *PostTasksIDRunsParams, body PostTasksIDRunsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostTasksIDRunsRequestWithBody(server, taskID, params, "application/json", bodyReader) +} + +// NewPostTasksIDRunsRequestWithBody generates requests for PostTasksIDRuns with any type of body +func NewPostTasksIDRunsRequestWithBody(server string, taskID string, params *PostTasksIDRunsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/runs", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteTasksIDRunsIDRequest generates requests for DeleteTasksIDRunsID +func NewDeleteTasksIDRunsIDRequest(server string, taskID string, runID string, params *DeleteTasksIDRunsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "runID", runID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/runs/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTasksIDRunsIDRequest generates requests for GetTasksIDRunsID +func NewGetTasksIDRunsIDRequest(server string, taskID string, runID string, params *GetTasksIDRunsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "runID", runID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/runs/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTasksIDRunsIDLogsRequest generates requests for GetTasksIDRunsIDLogs +func NewGetTasksIDRunsIDLogsRequest(server string, taskID string, runID string, params *GetTasksIDRunsIDLogsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "runID", runID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/runs/%s/logs", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostTasksIDRunsIDRetryRequest generates requests for PostTasksIDRunsIDRetry +func NewPostTasksIDRunsIDRetryRequest(server string, taskID string, runID string, params *PostTasksIDRunsIDRetryParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "taskID", taskID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "runID", runID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/tasks/%s/runs/%s/retry", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTelegrafPluginsRequest generates requests for GetTelegrafPlugins +func NewGetTelegrafPluginsRequest(server string, params *GetTelegrafPluginsParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegraf/plugins") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Type != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "type", *params.Type); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTelegrafsRequest generates requests for GetTelegrafs +func NewGetTelegrafsRequest(server string, params *GetTelegrafsParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostTelegrafsRequest calls the generic PostTelegrafs builder with application/json body +func NewPostTelegrafsRequest(server string, params *PostTelegrafsParams, body PostTelegrafsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostTelegrafsRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostTelegrafsRequestWithBody generates requests for PostTelegrafs with any type of body +func NewPostTelegrafsRequestWithBody(server string, params *PostTelegrafsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteTelegrafsIDRequest generates requests for DeleteTelegrafsID +func NewDeleteTelegrafsIDRequest(server string, telegrafID string, params *DeleteTelegrafsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTelegrafsIDRequest generates requests for GetTelegrafsID +func NewGetTelegrafsIDRequest(server string, telegrafID string, params *GetTelegrafsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParam("simple", false, "Accept", *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Add("Accept", headerParam1) + } + + return req, nil +} + +// NewPutTelegrafsIDRequest calls the generic PutTelegrafsID builder with application/json body +func NewPutTelegrafsIDRequest(server string, telegrafID string, params *PutTelegrafsIDParams, body PutTelegrafsIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutTelegrafsIDRequestWithBody(server, telegrafID, params, "application/json", bodyReader) +} + +// NewPutTelegrafsIDRequestWithBody generates requests for PutTelegrafsID with any type of body +func NewPutTelegrafsIDRequestWithBody(server string, telegrafID string, params *PutTelegrafsIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetTelegrafsIDLabelsRequest generates requests for GetTelegrafsIDLabels +func NewGetTelegrafsIDLabelsRequest(server string, telegrafID string, params *GetTelegrafsIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostTelegrafsIDLabelsRequest calls the generic PostTelegrafsIDLabels builder with application/json body +func NewPostTelegrafsIDLabelsRequest(server string, telegrafID string, params *PostTelegrafsIDLabelsParams, body PostTelegrafsIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostTelegrafsIDLabelsRequestWithBody(server, telegrafID, params, "application/json", bodyReader) +} + +// NewPostTelegrafsIDLabelsRequestWithBody generates requests for PostTelegrafsIDLabels with any type of body +func NewPostTelegrafsIDLabelsRequestWithBody(server string, telegrafID string, params *PostTelegrafsIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteTelegrafsIDLabelsIDRequest generates requests for DeleteTelegrafsIDLabelsID +func NewDeleteTelegrafsIDLabelsIDRequest(server string, telegrafID string, labelID string, params *DeleteTelegrafsIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTelegrafsIDMembersRequest generates requests for GetTelegrafsIDMembers +func NewGetTelegrafsIDMembersRequest(server string, telegrafID string, params *GetTelegrafsIDMembersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostTelegrafsIDMembersRequest calls the generic PostTelegrafsIDMembers builder with application/json body +func NewPostTelegrafsIDMembersRequest(server string, telegrafID string, params *PostTelegrafsIDMembersParams, body PostTelegrafsIDMembersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostTelegrafsIDMembersRequestWithBody(server, telegrafID, params, "application/json", bodyReader) +} + +// NewPostTelegrafsIDMembersRequestWithBody generates requests for PostTelegrafsIDMembers with any type of body +func NewPostTelegrafsIDMembersRequestWithBody(server string, telegrafID string, params *PostTelegrafsIDMembersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s/members", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteTelegrafsIDMembersIDRequest generates requests for DeleteTelegrafsIDMembersID +func NewDeleteTelegrafsIDMembersIDRequest(server string, telegrafID string, userID string, params *DeleteTelegrafsIDMembersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s/members/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetTelegrafsIDOwnersRequest generates requests for GetTelegrafsIDOwners +func NewGetTelegrafsIDOwnersRequest(server string, telegrafID string, params *GetTelegrafsIDOwnersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostTelegrafsIDOwnersRequest calls the generic PostTelegrafsIDOwners builder with application/json body +func NewPostTelegrafsIDOwnersRequest(server string, telegrafID string, params *PostTelegrafsIDOwnersParams, body PostTelegrafsIDOwnersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostTelegrafsIDOwnersRequestWithBody(server, telegrafID, params, "application/json", bodyReader) +} + +// NewPostTelegrafsIDOwnersRequestWithBody generates requests for PostTelegrafsIDOwners with any type of body +func NewPostTelegrafsIDOwnersRequestWithBody(server string, telegrafID string, params *PostTelegrafsIDOwnersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s/owners", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteTelegrafsIDOwnersIDRequest generates requests for DeleteTelegrafsIDOwnersID +func NewDeleteTelegrafsIDOwnersIDRequest(server string, telegrafID string, userID string, params *DeleteTelegrafsIDOwnersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "telegrafID", telegrafID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/telegrafs/%s/owners/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetUsersRequest generates requests for GetUsers +func NewGetUsersRequest(server string, params *GetUsersParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/users") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostUsersRequest calls the generic PostUsers builder with application/json body +func NewPostUsersRequest(server string, params *PostUsersParams, body PostUsersJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostUsersRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostUsersRequestWithBody generates requests for PostUsers with any type of body +func NewPostUsersRequestWithBody(server string, params *PostUsersParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/users") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteUsersIDRequest generates requests for DeleteUsersID +func NewDeleteUsersIDRequest(server string, userID string, params *DeleteUsersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/users/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetUsersIDRequest generates requests for GetUsersID +func NewGetUsersIDRequest(server string, userID string, params *GetUsersIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/users/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchUsersIDRequest calls the generic PatchUsersID builder with application/json body +func NewPatchUsersIDRequest(server string, userID string, params *PatchUsersIDParams, body PatchUsersIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchUsersIDRequestWithBody(server, userID, params, "application/json", bodyReader) +} + +// NewPatchUsersIDRequestWithBody generates requests for PatchUsersID with any type of body +func NewPatchUsersIDRequestWithBody(server string, userID string, params *PatchUsersIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/users/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetUsersIDLogsRequest generates requests for GetUsersIDLogs +func NewGetUsersIDLogsRequest(server string, userID string, params *GetUsersIDLogsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/users/%s/logs", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "offset", *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "limit", *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPutUsersIDPasswordRequest calls the generic PutUsersIDPassword builder with application/json body +func NewPutUsersIDPasswordRequest(server string, userID string, params *PutUsersIDPasswordParams, body PutUsersIDPasswordJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutUsersIDPasswordRequestWithBody(server, userID, params, "application/json", bodyReader) +} + +// NewPutUsersIDPasswordRequestWithBody generates requests for PutUsersIDPassword with any type of body +func NewPutUsersIDPasswordRequestWithBody(server string, userID string, params *PutUsersIDPasswordParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "userID", userID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/users/%s/password", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetVariablesRequest generates requests for GetVariables +func NewGetVariablesRequest(server string, params *GetVariablesParams) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/variables") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if params.Org != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "org", *params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostVariablesRequest calls the generic PostVariables builder with application/json body +func NewPostVariablesRequest(server string, params *PostVariablesParams, body PostVariablesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostVariablesRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostVariablesRequestWithBody generates requests for PostVariables with any type of body +func NewPostVariablesRequestWithBody(server string, params *PostVariablesParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/variables") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteVariablesIDRequest generates requests for DeleteVariablesID +func NewDeleteVariablesIDRequest(server string, variableID string, params *DeleteVariablesIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "variableID", variableID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/variables/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewGetVariablesIDRequest generates requests for GetVariablesID +func NewGetVariablesIDRequest(server string, variableID string, params *GetVariablesIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "variableID", variableID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/variables/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPatchVariablesIDRequest calls the generic PatchVariablesID builder with application/json body +func NewPatchVariablesIDRequest(server string, variableID string, params *PatchVariablesIDParams, body PatchVariablesIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPatchVariablesIDRequestWithBody(server, variableID, params, "application/json", bodyReader) +} + +// NewPatchVariablesIDRequestWithBody generates requests for PatchVariablesID with any type of body +func NewPatchVariablesIDRequestWithBody(server string, variableID string, params *PatchVariablesIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "variableID", variableID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/variables/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewPutVariablesIDRequest calls the generic PutVariablesID builder with application/json body +func NewPutVariablesIDRequest(server string, variableID string, params *PutVariablesIDParams, body PutVariablesIDJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutVariablesIDRequestWithBody(server, variableID, params, "application/json", bodyReader) +} + +// NewPutVariablesIDRequestWithBody generates requests for PutVariablesID with any type of body +func NewPutVariablesIDRequestWithBody(server string, variableID string, params *PutVariablesIDParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "variableID", variableID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/variables/%s", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewGetVariablesIDLabelsRequest generates requests for GetVariablesIDLabels +func NewGetVariablesIDLabelsRequest(server string, variableID string, params *GetVariablesIDLabelsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "variableID", variableID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/variables/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostVariablesIDLabelsRequest calls the generic PostVariablesIDLabels builder with application/json body +func NewPostVariablesIDLabelsRequest(server string, variableID string, params *PostVariablesIDLabelsParams, body PostVariablesIDLabelsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostVariablesIDLabelsRequestWithBody(server, variableID, params, "application/json", bodyReader) +} + +// NewPostVariablesIDLabelsRequestWithBody generates requests for PostVariablesIDLabels with any type of body +func NewPostVariablesIDLabelsRequestWithBody(server string, variableID string, params *PostVariablesIDLabelsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "variableID", variableID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/variables/%s/labels", pathParam0) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewDeleteVariablesIDLabelsIDRequest generates requests for DeleteVariablesIDLabelsID +func NewDeleteVariablesIDLabelsIDRequest(server string, variableID string, labelID string, params *DeleteVariablesIDLabelsIDParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParam("simple", false, "variableID", variableID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParam("simple", false, "labelID", labelID) + if err != nil { + return nil, err + } + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/variables/%s/labels/%s", pathParam0, pathParam1) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryUrl.String(), nil) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + return req, nil +} + +// NewPostWriteRequestWithBody generates requests for PostWrite with any type of body +func NewPostWriteRequestWithBody(server string, params *PostWriteParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("/write") + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } + + queryValues := queryUrl.Query() + + if queryFrag, err := runtime.StyleParam("form", true, "org", params.Org); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.OrgID != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "orgID", *params.OrgID); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if queryFrag, err := runtime.StyleParam("form", true, "bucket", params.Bucket); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + if params.Precision != nil { + + if queryFrag, err := runtime.StyleParam("form", true, "precision", *params.Precision); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryUrl.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("POST", queryUrl.String(), body) + if err != nil { + return nil, err + } + + if params.ZapTraceSpan != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParam("simple", false, "Zap-Trace-Span", *params.ZapTraceSpan) + if err != nil { + return nil, err + } + + req.Header.Add("Zap-Trace-Span", headerParam0) + } + + if params.ContentEncoding != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParam("simple", false, "Content-Encoding", *params.ContentEncoding) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Encoding", headerParam1) + } + + if params.ContentType != nil { + var headerParam2 string + + headerParam2, err = runtime.StyleParam("simple", false, "Content-Type", *params.ContentType) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", headerParam2) + } + + if params.ContentLength != nil { + var headerParam3 string + + headerParam3, err = runtime.StyleParam("simple", false, "Content-Length", *params.ContentLength) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Length", headerParam3) + } + + if params.Accept != nil { + var headerParam4 string + + headerParam4, err = runtime.StyleParam("simple", false, "Accept", *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Add("Accept", headerParam4) + } + + req.Header.Add("Content-Type", contentType) + return req, nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(service ihttp.Service) *ClientWithResponses { + client := NewClient(service) + return &ClientWithResponses{client} +} + +type getRoutesResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Routes +} + +// Status returns HTTPResponse.Status +func (r getRoutesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getRoutesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getAuthorizationsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Authorizations + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getAuthorizationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getAuthorizationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postAuthorizationsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Authorization + JSON400 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postAuthorizationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postAuthorizationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteAuthorizationsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteAuthorizationsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteAuthorizationsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getAuthorizationsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Authorization + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getAuthorizationsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getAuthorizationsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchAuthorizationsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Authorization + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchAuthorizationsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchAuthorizationsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getBucketsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Buckets + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getBucketsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getBucketsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postBucketsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Bucket + JSON422 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postBucketsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postBucketsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteBucketsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteBucketsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteBucketsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getBucketsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Bucket + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getBucketsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getBucketsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchBucketsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Bucket + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchBucketsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchBucketsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getBucketsIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getBucketsIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getBucketsIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postBucketsIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postBucketsIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postBucketsIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteBucketsIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteBucketsIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteBucketsIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getBucketsIDLogsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *OperationLogs + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getBucketsIDLogsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getBucketsIDLogsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getBucketsIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceMembers + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getBucketsIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getBucketsIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postBucketsIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceMember + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postBucketsIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postBucketsIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteBucketsIDMembersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteBucketsIDMembersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteBucketsIDMembersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getBucketsIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceOwners + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getBucketsIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getBucketsIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postBucketsIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceOwner + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postBucketsIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postBucketsIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteBucketsIDOwnersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteBucketsIDOwnersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteBucketsIDOwnersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getChecksResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Checks + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getChecksResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getChecksResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type createCheckResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Check + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r createCheckResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r createCheckResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteChecksIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteChecksIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteChecksIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getChecksIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Check + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getChecksIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getChecksIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchChecksIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Check + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchChecksIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchChecksIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type putChecksIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Check + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r putChecksIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r putChecksIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getChecksIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getChecksIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getChecksIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postChecksIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postChecksIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postChecksIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteChecksIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteChecksIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteChecksIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getChecksIDQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *FluxResponse + JSON400 *Error + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getChecksIDQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getChecksIDQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getDashboardsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Dashboards + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getDashboardsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getDashboardsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postDashboardsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *interface{} + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postDashboardsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postDashboardsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteDashboardsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteDashboardsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteDashboardsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getDashboardsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *interface{} + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getDashboardsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getDashboardsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchDashboardsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Dashboard + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchDashboardsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchDashboardsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postDashboardsIDCellsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Cell + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postDashboardsIDCellsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postDashboardsIDCellsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type putDashboardsIDCellsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Dashboard + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r putDashboardsIDCellsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r putDashboardsIDCellsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteDashboardsIDCellsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteDashboardsIDCellsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteDashboardsIDCellsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchDashboardsIDCellsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Cell + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchDashboardsIDCellsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchDashboardsIDCellsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getDashboardsIDCellsIDViewResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *View + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getDashboardsIDCellsIDViewResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getDashboardsIDCellsIDViewResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchDashboardsIDCellsIDViewResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *View + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchDashboardsIDCellsIDViewResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchDashboardsIDCellsIDViewResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getDashboardsIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getDashboardsIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getDashboardsIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postDashboardsIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postDashboardsIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postDashboardsIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteDashboardsIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteDashboardsIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteDashboardsIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getDashboardsIDLogsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *OperationLogs + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getDashboardsIDLogsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getDashboardsIDLogsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getDashboardsIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceMembers + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getDashboardsIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getDashboardsIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postDashboardsIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceMember + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postDashboardsIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postDashboardsIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteDashboardsIDMembersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteDashboardsIDMembersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteDashboardsIDMembersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getDashboardsIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceOwners + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getDashboardsIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getDashboardsIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postDashboardsIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceOwner + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postDashboardsIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postDashboardsIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteDashboardsIDOwnersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteDashboardsIDOwnersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteDashboardsIDOwnersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postDeleteResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON403 *Error + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postDeleteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postDeleteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getDocumentsTemplatesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Documents + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getDocumentsTemplatesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getDocumentsTemplatesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postDocumentsTemplatesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Document + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postDocumentsTemplatesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postDocumentsTemplatesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteDocumentsTemplatesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteDocumentsTemplatesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteDocumentsTemplatesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getDocumentsTemplatesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Document + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getDocumentsTemplatesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getDocumentsTemplatesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type putDocumentsTemplatesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Document + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r putDocumentsTemplatesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r putDocumentsTemplatesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getDocumentsTemplatesIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getDocumentsTemplatesIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getDocumentsTemplatesIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postDocumentsTemplatesIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postDocumentsTemplatesIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postDocumentsTemplatesIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteDocumentsTemplatesIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteDocumentsTemplatesIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteDocumentsTemplatesIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getHealthResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *HealthCheck + JSON503 *HealthCheck + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getHealthResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getHealthResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelResponse + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getMeResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *User + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getMeResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getMeResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type putMePasswordResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r putMePasswordResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r putMePasswordResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getNotificationEndpointsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NotificationEndpoints + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getNotificationEndpointsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getNotificationEndpointsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type createNotificationEndpointResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *NotificationEndpoint + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r createNotificationEndpointResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r createNotificationEndpointResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteNotificationEndpointsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteNotificationEndpointsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteNotificationEndpointsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getNotificationEndpointsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NotificationEndpoint + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getNotificationEndpointsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getNotificationEndpointsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchNotificationEndpointsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NotificationEndpoint + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchNotificationEndpointsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchNotificationEndpointsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type putNotificationEndpointsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NotificationEndpoint + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r putNotificationEndpointsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r putNotificationEndpointsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getNotificationEndpointsIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getNotificationEndpointsIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getNotificationEndpointsIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postNotificationEndpointIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postNotificationEndpointIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postNotificationEndpointIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteNotificationEndpointsIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteNotificationEndpointsIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteNotificationEndpointsIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getNotificationRulesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NotificationRules + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getNotificationRulesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getNotificationRulesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type createNotificationRuleResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *NotificationRule + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r createNotificationRuleResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r createNotificationRuleResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteNotificationRulesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteNotificationRulesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteNotificationRulesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getNotificationRulesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NotificationRule + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getNotificationRulesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getNotificationRulesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchNotificationRulesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NotificationRule + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchNotificationRulesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchNotificationRulesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type putNotificationRulesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NotificationRule + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r putNotificationRulesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r putNotificationRulesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getNotificationRulesIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getNotificationRulesIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getNotificationRulesIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postNotificationRuleIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postNotificationRuleIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postNotificationRuleIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteNotificationRulesIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteNotificationRulesIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteNotificationRulesIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getNotificationRulesIDQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *FluxResponse + JSON400 *Error + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getNotificationRulesIDQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getNotificationRulesIDQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getOrgsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Organizations + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getOrgsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getOrgsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postOrgsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Organization + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postOrgsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postOrgsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteOrgsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteOrgsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteOrgsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getOrgsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Organization + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getOrgsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getOrgsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchOrgsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Organization + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchOrgsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchOrgsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getOrgsIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getOrgsIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getOrgsIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postOrgsIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postOrgsIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postOrgsIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteOrgsIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteOrgsIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteOrgsIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getOrgsIDLogsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *OperationLogs + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getOrgsIDLogsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getOrgsIDLogsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getOrgsIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceMembers + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getOrgsIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getOrgsIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postOrgsIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceMember + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postOrgsIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postOrgsIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteOrgsIDMembersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteOrgsIDMembersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteOrgsIDMembersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getOrgsIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceOwners + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getOrgsIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getOrgsIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postOrgsIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceOwner + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postOrgsIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postOrgsIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteOrgsIDOwnersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteOrgsIDOwnersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteOrgsIDOwnersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getOrgsIDSecretsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SecretKeysResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getOrgsIDSecretsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getOrgsIDSecretsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchOrgsIDSecretsResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchOrgsIDSecretsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchOrgsIDSecretsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postOrgsIDSecretsResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postOrgsIDSecretsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postOrgsIDSecretsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type createPkgResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Pkg + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r createPkgResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r createPkgResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type applyPkgResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PkgSummary + JSON201 *PkgSummary + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r applyPkgResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r applyPkgResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postQueryAnalyzeResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *AnalyzeQueryResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postQueryAnalyzeResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postQueryAnalyzeResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postQueryAstResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ASTResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postQueryAstResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postQueryAstResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getQuerySuggestionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *FluxSuggestions + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getQuerySuggestionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getQuerySuggestionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getQuerySuggestionsNameResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *FluxSuggestion + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getQuerySuggestionsNameResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getQuerySuggestionsNameResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getReadyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Ready + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getReadyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getReadyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getScrapersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ScraperTargetResponses +} + +// Status returns HTTPResponse.Status +func (r getScrapersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getScrapersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postScrapersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ScraperTargetResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postScrapersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postScrapersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteScrapersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteScrapersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteScrapersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getScrapersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ScraperTargetResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getScrapersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getScrapersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchScrapersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ScraperTargetResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchScrapersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchScrapersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getScrapersIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getScrapersIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getScrapersIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postScrapersIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postScrapersIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postScrapersIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteScrapersIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteScrapersIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteScrapersIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchScrapersIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchScrapersIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchScrapersIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getScrapersIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceMembers + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getScrapersIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getScrapersIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postScrapersIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceMember + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postScrapersIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postScrapersIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteScrapersIDMembersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteScrapersIDMembersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteScrapersIDMembersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getScrapersIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceOwners + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getScrapersIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getScrapersIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postScrapersIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceOwner + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postScrapersIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postScrapersIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteScrapersIDOwnersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteScrapersIDOwnersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteScrapersIDOwnersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getSetupResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *IsOnboarding +} + +// Status returns HTTPResponse.Status +func (r getSetupResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getSetupResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postSetupResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *OnboardingResponse +} + +// Status returns HTTPResponse.Status +func (r postSetupResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postSetupResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postSigninResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Error + JSON403 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postSigninResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postSigninResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postSignoutResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postSignoutResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postSignoutResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getSourcesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Sources + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getSourcesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getSourcesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postSourcesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Source + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postSourcesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postSourcesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteSourcesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteSourcesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteSourcesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getSourcesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Source + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getSourcesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getSourcesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchSourcesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Source + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchSourcesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchSourcesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getSourcesIDBucketsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Buckets + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getSourcesIDBucketsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getSourcesIDBucketsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getSourcesIDHealthResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *HealthCheck + JSON503 *HealthCheck + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getSourcesIDHealthResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getSourcesIDHealthResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTasksResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Tasks + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTasksResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTasksResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postTasksResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Task + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postTasksResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postTasksResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteTasksIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteTasksIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteTasksIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTasksIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Task + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTasksIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTasksIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchTasksIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Task + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchTasksIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchTasksIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTasksIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTasksIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTasksIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postTasksIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postTasksIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postTasksIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteTasksIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteTasksIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteTasksIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTasksIDLogsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Logs + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTasksIDLogsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTasksIDLogsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTasksIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceMembers + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTasksIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTasksIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postTasksIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceMember + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postTasksIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postTasksIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteTasksIDMembersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteTasksIDMembersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteTasksIDMembersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTasksIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceOwners + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTasksIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTasksIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postTasksIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceOwner + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postTasksIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postTasksIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteTasksIDOwnersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteTasksIDOwnersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteTasksIDOwnersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTasksIDRunsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Runs + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTasksIDRunsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTasksIDRunsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postTasksIDRunsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Run + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postTasksIDRunsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postTasksIDRunsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteTasksIDRunsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteTasksIDRunsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteTasksIDRunsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTasksIDRunsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Run + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTasksIDRunsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTasksIDRunsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTasksIDRunsIDLogsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Logs + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTasksIDRunsIDLogsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTasksIDRunsIDLogsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postTasksIDRunsIDRetryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Run + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postTasksIDRunsIDRetryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postTasksIDRunsIDRetryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTelegrafPluginsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *TelegrafPlugins + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTelegrafPluginsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTelegrafPluginsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTelegrafsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Telegrafs + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTelegrafsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTelegrafsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postTelegrafsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Telegraf + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postTelegrafsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postTelegrafsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteTelegrafsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteTelegrafsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteTelegrafsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTelegrafsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Telegraf + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTelegrafsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTelegrafsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type putTelegrafsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Telegraf + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r putTelegrafsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r putTelegrafsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTelegrafsIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTelegrafsIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTelegrafsIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postTelegrafsIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postTelegrafsIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postTelegrafsIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteTelegrafsIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteTelegrafsIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteTelegrafsIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTelegrafsIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceMembers + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTelegrafsIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTelegrafsIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postTelegrafsIDMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceMember + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postTelegrafsIDMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postTelegrafsIDMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteTelegrafsIDMembersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteTelegrafsIDMembersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteTelegrafsIDMembersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getTelegrafsIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ResourceOwners + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getTelegrafsIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getTelegrafsIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postTelegrafsIDOwnersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ResourceOwner + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postTelegrafsIDOwnersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postTelegrafsIDOwnersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteTelegrafsIDOwnersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteTelegrafsIDOwnersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteTelegrafsIDOwnersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getUsersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Users + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getUsersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getUsersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postUsersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *User + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postUsersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postUsersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteUsersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteUsersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteUsersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getUsersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *User + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getUsersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getUsersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchUsersIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *User + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchUsersIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchUsersIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getUsersIDLogsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *OperationLogs + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getUsersIDLogsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getUsersIDLogsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type putUsersIDPasswordResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r putUsersIDPasswordResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r putUsersIDPasswordResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getVariablesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Variables + JSON400 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getVariablesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getVariablesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postVariablesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Variable + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postVariablesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postVariablesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteVariablesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteVariablesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteVariablesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getVariablesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Variable + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getVariablesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getVariablesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type patchVariablesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Variable + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r patchVariablesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r patchVariablesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type putVariablesIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Variable + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r putVariablesIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r putVariablesIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type getVariablesIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *LabelsResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r getVariablesIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r getVariablesIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postVariablesIDLabelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *LabelResponse + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postVariablesIDLabelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postVariablesIDLabelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type deleteVariablesIDLabelsIDResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r deleteVariablesIDLabelsIDResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r deleteVariablesIDLabelsIDResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type postWriteResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *LineProtocolError + JSON401 *Error + JSON403 *Error + JSON413 *LineProtocolLengthError + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r postWriteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r postWriteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// GetRoutesWithResponse request returning *GetRoutesResponse +func (c *ClientWithResponses) GetRoutesWithResponse(ctx context.Context, params *GetRoutesParams) (*getRoutesResponse, error) { + rsp, err := c.GetRoutes(ctx, params) + if err != nil { + return nil, err + } + return ParseGetRoutesResponse(rsp) +} + +// GetAuthorizationsWithResponse request returning *GetAuthorizationsResponse +func (c *ClientWithResponses) GetAuthorizationsWithResponse(ctx context.Context, params *GetAuthorizationsParams) (*getAuthorizationsResponse, error) { + rsp, err := c.GetAuthorizations(ctx, params) + if err != nil { + return nil, err + } + return ParseGetAuthorizationsResponse(rsp) +} + +// PostAuthorizationsWithBodyWithResponse request with arbitrary body returning *PostAuthorizationsResponse +func (c *ClientWithResponses) PostAuthorizationsWithBodyWithResponse(ctx context.Context, params *PostAuthorizationsParams, contentType string, body io.Reader) (*postAuthorizationsResponse, error) { + rsp, err := c.PostAuthorizationsWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostAuthorizationsResponse(rsp) +} + +func (c *ClientWithResponses) PostAuthorizationsWithResponse(ctx context.Context, params *PostAuthorizationsParams, body PostAuthorizationsJSONRequestBody) (*postAuthorizationsResponse, error) { + rsp, err := c.PostAuthorizations(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostAuthorizationsResponse(rsp) +} + +// DeleteAuthorizationsIDWithResponse request returning *DeleteAuthorizationsIDResponse +func (c *ClientWithResponses) DeleteAuthorizationsIDWithResponse(ctx context.Context, authID string, params *DeleteAuthorizationsIDParams) (*deleteAuthorizationsIDResponse, error) { + rsp, err := c.DeleteAuthorizationsID(ctx, authID, params) + if err != nil { + return nil, err + } + return ParseDeleteAuthorizationsIDResponse(rsp) +} + +// GetAuthorizationsIDWithResponse request returning *GetAuthorizationsIDResponse +func (c *ClientWithResponses) GetAuthorizationsIDWithResponse(ctx context.Context, authID string, params *GetAuthorizationsIDParams) (*getAuthorizationsIDResponse, error) { + rsp, err := c.GetAuthorizationsID(ctx, authID, params) + if err != nil { + return nil, err + } + return ParseGetAuthorizationsIDResponse(rsp) +} + +// PatchAuthorizationsIDWithBodyWithResponse request with arbitrary body returning *PatchAuthorizationsIDResponse +func (c *ClientWithResponses) PatchAuthorizationsIDWithBodyWithResponse(ctx context.Context, authID string, params *PatchAuthorizationsIDParams, contentType string, body io.Reader) (*patchAuthorizationsIDResponse, error) { + rsp, err := c.PatchAuthorizationsIDWithBody(ctx, authID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchAuthorizationsIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchAuthorizationsIDWithResponse(ctx context.Context, authID string, params *PatchAuthorizationsIDParams, body PatchAuthorizationsIDJSONRequestBody) (*patchAuthorizationsIDResponse, error) { + rsp, err := c.PatchAuthorizationsID(ctx, authID, params, body) + if err != nil { + return nil, err + } + return ParsePatchAuthorizationsIDResponse(rsp) +} + +// GetBucketsWithResponse request returning *GetBucketsResponse +func (c *ClientWithResponses) GetBucketsWithResponse(ctx context.Context, params *GetBucketsParams) (*getBucketsResponse, error) { + rsp, err := c.GetBuckets(ctx, params) + if err != nil { + return nil, err + } + return ParseGetBucketsResponse(rsp) +} + +// PostBucketsWithBodyWithResponse request with arbitrary body returning *PostBucketsResponse +func (c *ClientWithResponses) PostBucketsWithBodyWithResponse(ctx context.Context, params *PostBucketsParams, contentType string, body io.Reader) (*postBucketsResponse, error) { + rsp, err := c.PostBucketsWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostBucketsResponse(rsp) +} + +func (c *ClientWithResponses) PostBucketsWithResponse(ctx context.Context, params *PostBucketsParams, body PostBucketsJSONRequestBody) (*postBucketsResponse, error) { + rsp, err := c.PostBuckets(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostBucketsResponse(rsp) +} + +// DeleteBucketsIDWithResponse request returning *DeleteBucketsIDResponse +func (c *ClientWithResponses) DeleteBucketsIDWithResponse(ctx context.Context, bucketID string, params *DeleteBucketsIDParams) (*deleteBucketsIDResponse, error) { + rsp, err := c.DeleteBucketsID(ctx, bucketID, params) + if err != nil { + return nil, err + } + return ParseDeleteBucketsIDResponse(rsp) +} + +// GetBucketsIDWithResponse request returning *GetBucketsIDResponse +func (c *ClientWithResponses) GetBucketsIDWithResponse(ctx context.Context, bucketID string, params *GetBucketsIDParams) (*getBucketsIDResponse, error) { + rsp, err := c.GetBucketsID(ctx, bucketID, params) + if err != nil { + return nil, err + } + return ParseGetBucketsIDResponse(rsp) +} + +// PatchBucketsIDWithBodyWithResponse request with arbitrary body returning *PatchBucketsIDResponse +func (c *ClientWithResponses) PatchBucketsIDWithBodyWithResponse(ctx context.Context, bucketID string, params *PatchBucketsIDParams, contentType string, body io.Reader) (*patchBucketsIDResponse, error) { + rsp, err := c.PatchBucketsIDWithBody(ctx, bucketID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchBucketsIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchBucketsIDWithResponse(ctx context.Context, bucketID string, params *PatchBucketsIDParams, body PatchBucketsIDJSONRequestBody) (*patchBucketsIDResponse, error) { + rsp, err := c.PatchBucketsID(ctx, bucketID, params, body) + if err != nil { + return nil, err + } + return ParsePatchBucketsIDResponse(rsp) +} + +// GetBucketsIDLabelsWithResponse request returning *GetBucketsIDLabelsResponse +func (c *ClientWithResponses) GetBucketsIDLabelsWithResponse(ctx context.Context, bucketID string, params *GetBucketsIDLabelsParams) (*getBucketsIDLabelsResponse, error) { + rsp, err := c.GetBucketsIDLabels(ctx, bucketID, params) + if err != nil { + return nil, err + } + return ParseGetBucketsIDLabelsResponse(rsp) +} + +// PostBucketsIDLabelsWithBodyWithResponse request with arbitrary body returning *PostBucketsIDLabelsResponse +func (c *ClientWithResponses) PostBucketsIDLabelsWithBodyWithResponse(ctx context.Context, bucketID string, params *PostBucketsIDLabelsParams, contentType string, body io.Reader) (*postBucketsIDLabelsResponse, error) { + rsp, err := c.PostBucketsIDLabelsWithBody(ctx, bucketID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostBucketsIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostBucketsIDLabelsWithResponse(ctx context.Context, bucketID string, params *PostBucketsIDLabelsParams, body PostBucketsIDLabelsJSONRequestBody) (*postBucketsIDLabelsResponse, error) { + rsp, err := c.PostBucketsIDLabels(ctx, bucketID, params, body) + if err != nil { + return nil, err + } + return ParsePostBucketsIDLabelsResponse(rsp) +} + +// DeleteBucketsIDLabelsIDWithResponse request returning *DeleteBucketsIDLabelsIDResponse +func (c *ClientWithResponses) DeleteBucketsIDLabelsIDWithResponse(ctx context.Context, bucketID string, labelID string, params *DeleteBucketsIDLabelsIDParams) (*deleteBucketsIDLabelsIDResponse, error) { + rsp, err := c.DeleteBucketsIDLabelsID(ctx, bucketID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteBucketsIDLabelsIDResponse(rsp) +} + +// GetBucketsIDLogsWithResponse request returning *GetBucketsIDLogsResponse +func (c *ClientWithResponses) GetBucketsIDLogsWithResponse(ctx context.Context, bucketID string, params *GetBucketsIDLogsParams) (*getBucketsIDLogsResponse, error) { + rsp, err := c.GetBucketsIDLogs(ctx, bucketID, params) + if err != nil { + return nil, err + } + return ParseGetBucketsIDLogsResponse(rsp) +} + +// GetBucketsIDMembersWithResponse request returning *GetBucketsIDMembersResponse +func (c *ClientWithResponses) GetBucketsIDMembersWithResponse(ctx context.Context, bucketID string, params *GetBucketsIDMembersParams) (*getBucketsIDMembersResponse, error) { + rsp, err := c.GetBucketsIDMembers(ctx, bucketID, params) + if err != nil { + return nil, err + } + return ParseGetBucketsIDMembersResponse(rsp) +} + +// PostBucketsIDMembersWithBodyWithResponse request with arbitrary body returning *PostBucketsIDMembersResponse +func (c *ClientWithResponses) PostBucketsIDMembersWithBodyWithResponse(ctx context.Context, bucketID string, params *PostBucketsIDMembersParams, contentType string, body io.Reader) (*postBucketsIDMembersResponse, error) { + rsp, err := c.PostBucketsIDMembersWithBody(ctx, bucketID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostBucketsIDMembersResponse(rsp) +} + +func (c *ClientWithResponses) PostBucketsIDMembersWithResponse(ctx context.Context, bucketID string, params *PostBucketsIDMembersParams, body PostBucketsIDMembersJSONRequestBody) (*postBucketsIDMembersResponse, error) { + rsp, err := c.PostBucketsIDMembers(ctx, bucketID, params, body) + if err != nil { + return nil, err + } + return ParsePostBucketsIDMembersResponse(rsp) +} + +// DeleteBucketsIDMembersIDWithResponse request returning *DeleteBucketsIDMembersIDResponse +func (c *ClientWithResponses) DeleteBucketsIDMembersIDWithResponse(ctx context.Context, bucketID string, userID string, params *DeleteBucketsIDMembersIDParams) (*deleteBucketsIDMembersIDResponse, error) { + rsp, err := c.DeleteBucketsIDMembersID(ctx, bucketID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteBucketsIDMembersIDResponse(rsp) +} + +// GetBucketsIDOwnersWithResponse request returning *GetBucketsIDOwnersResponse +func (c *ClientWithResponses) GetBucketsIDOwnersWithResponse(ctx context.Context, bucketID string, params *GetBucketsIDOwnersParams) (*getBucketsIDOwnersResponse, error) { + rsp, err := c.GetBucketsIDOwners(ctx, bucketID, params) + if err != nil { + return nil, err + } + return ParseGetBucketsIDOwnersResponse(rsp) +} + +// PostBucketsIDOwnersWithBodyWithResponse request with arbitrary body returning *PostBucketsIDOwnersResponse +func (c *ClientWithResponses) PostBucketsIDOwnersWithBodyWithResponse(ctx context.Context, bucketID string, params *PostBucketsIDOwnersParams, contentType string, body io.Reader) (*postBucketsIDOwnersResponse, error) { + rsp, err := c.PostBucketsIDOwnersWithBody(ctx, bucketID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostBucketsIDOwnersResponse(rsp) +} + +func (c *ClientWithResponses) PostBucketsIDOwnersWithResponse(ctx context.Context, bucketID string, params *PostBucketsIDOwnersParams, body PostBucketsIDOwnersJSONRequestBody) (*postBucketsIDOwnersResponse, error) { + rsp, err := c.PostBucketsIDOwners(ctx, bucketID, params, body) + if err != nil { + return nil, err + } + return ParsePostBucketsIDOwnersResponse(rsp) +} + +// DeleteBucketsIDOwnersIDWithResponse request returning *DeleteBucketsIDOwnersIDResponse +func (c *ClientWithResponses) DeleteBucketsIDOwnersIDWithResponse(ctx context.Context, bucketID string, userID string, params *DeleteBucketsIDOwnersIDParams) (*deleteBucketsIDOwnersIDResponse, error) { + rsp, err := c.DeleteBucketsIDOwnersID(ctx, bucketID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteBucketsIDOwnersIDResponse(rsp) +} + +// GetChecksWithResponse request returning *GetChecksResponse +func (c *ClientWithResponses) GetChecksWithResponse(ctx context.Context, params *GetChecksParams) (*getChecksResponse, error) { + rsp, err := c.GetChecks(ctx, params) + if err != nil { + return nil, err + } + return ParseGetChecksResponse(rsp) +} + +// CreateCheckWithBodyWithResponse request with arbitrary body returning *CreateCheckResponse +func (c *ClientWithResponses) CreateCheckWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*createCheckResponse, error) { + rsp, err := c.CreateCheckWithBody(ctx, contentType, body) + if err != nil { + return nil, err + } + return ParseCreateCheckResponse(rsp) +} + +func (c *ClientWithResponses) CreateCheckWithResponse(ctx context.Context, body CreateCheckJSONRequestBody) (*createCheckResponse, error) { + rsp, err := c.CreateCheck(ctx, body) + if err != nil { + return nil, err + } + return ParseCreateCheckResponse(rsp) +} + +// DeleteChecksIDWithResponse request returning *DeleteChecksIDResponse +func (c *ClientWithResponses) DeleteChecksIDWithResponse(ctx context.Context, checkID string, params *DeleteChecksIDParams) (*deleteChecksIDResponse, error) { + rsp, err := c.DeleteChecksID(ctx, checkID, params) + if err != nil { + return nil, err + } + return ParseDeleteChecksIDResponse(rsp) +} + +// GetChecksIDWithResponse request returning *GetChecksIDResponse +func (c *ClientWithResponses) GetChecksIDWithResponse(ctx context.Context, checkID string, params *GetChecksIDParams) (*getChecksIDResponse, error) { + rsp, err := c.GetChecksID(ctx, checkID, params) + if err != nil { + return nil, err + } + return ParseGetChecksIDResponse(rsp) +} + +// PatchChecksIDWithBodyWithResponse request with arbitrary body returning *PatchChecksIDResponse +func (c *ClientWithResponses) PatchChecksIDWithBodyWithResponse(ctx context.Context, checkID string, params *PatchChecksIDParams, contentType string, body io.Reader) (*patchChecksIDResponse, error) { + rsp, err := c.PatchChecksIDWithBody(ctx, checkID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchChecksIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchChecksIDWithResponse(ctx context.Context, checkID string, params *PatchChecksIDParams, body PatchChecksIDJSONRequestBody) (*patchChecksIDResponse, error) { + rsp, err := c.PatchChecksID(ctx, checkID, params, body) + if err != nil { + return nil, err + } + return ParsePatchChecksIDResponse(rsp) +} + +// PutChecksIDWithBodyWithResponse request with arbitrary body returning *PutChecksIDResponse +func (c *ClientWithResponses) PutChecksIDWithBodyWithResponse(ctx context.Context, checkID string, params *PutChecksIDParams, contentType string, body io.Reader) (*putChecksIDResponse, error) { + rsp, err := c.PutChecksIDWithBody(ctx, checkID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePutChecksIDResponse(rsp) +} + +func (c *ClientWithResponses) PutChecksIDWithResponse(ctx context.Context, checkID string, params *PutChecksIDParams, body PutChecksIDJSONRequestBody) (*putChecksIDResponse, error) { + rsp, err := c.PutChecksID(ctx, checkID, params, body) + if err != nil { + return nil, err + } + return ParsePutChecksIDResponse(rsp) +} + +// GetChecksIDLabelsWithResponse request returning *GetChecksIDLabelsResponse +func (c *ClientWithResponses) GetChecksIDLabelsWithResponse(ctx context.Context, checkID string, params *GetChecksIDLabelsParams) (*getChecksIDLabelsResponse, error) { + rsp, err := c.GetChecksIDLabels(ctx, checkID, params) + if err != nil { + return nil, err + } + return ParseGetChecksIDLabelsResponse(rsp) +} + +// PostChecksIDLabelsWithBodyWithResponse request with arbitrary body returning *PostChecksIDLabelsResponse +func (c *ClientWithResponses) PostChecksIDLabelsWithBodyWithResponse(ctx context.Context, checkID string, params *PostChecksIDLabelsParams, contentType string, body io.Reader) (*postChecksIDLabelsResponse, error) { + rsp, err := c.PostChecksIDLabelsWithBody(ctx, checkID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostChecksIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostChecksIDLabelsWithResponse(ctx context.Context, checkID string, params *PostChecksIDLabelsParams, body PostChecksIDLabelsJSONRequestBody) (*postChecksIDLabelsResponse, error) { + rsp, err := c.PostChecksIDLabels(ctx, checkID, params, body) + if err != nil { + return nil, err + } + return ParsePostChecksIDLabelsResponse(rsp) +} + +// DeleteChecksIDLabelsIDWithResponse request returning *DeleteChecksIDLabelsIDResponse +func (c *ClientWithResponses) DeleteChecksIDLabelsIDWithResponse(ctx context.Context, checkID string, labelID string, params *DeleteChecksIDLabelsIDParams) (*deleteChecksIDLabelsIDResponse, error) { + rsp, err := c.DeleteChecksIDLabelsID(ctx, checkID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteChecksIDLabelsIDResponse(rsp) +} + +// GetChecksIDQueryWithResponse request returning *GetChecksIDQueryResponse +func (c *ClientWithResponses) GetChecksIDQueryWithResponse(ctx context.Context, checkID string, params *GetChecksIDQueryParams) (*getChecksIDQueryResponse, error) { + rsp, err := c.GetChecksIDQuery(ctx, checkID, params) + if err != nil { + return nil, err + } + return ParseGetChecksIDQueryResponse(rsp) +} + +// GetDashboardsWithResponse request returning *GetDashboardsResponse +func (c *ClientWithResponses) GetDashboardsWithResponse(ctx context.Context, params *GetDashboardsParams) (*getDashboardsResponse, error) { + rsp, err := c.GetDashboards(ctx, params) + if err != nil { + return nil, err + } + return ParseGetDashboardsResponse(rsp) +} + +// PostDashboardsWithBodyWithResponse request with arbitrary body returning *PostDashboardsResponse +func (c *ClientWithResponses) PostDashboardsWithBodyWithResponse(ctx context.Context, params *PostDashboardsParams, contentType string, body io.Reader) (*postDashboardsResponse, error) { + rsp, err := c.PostDashboardsWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostDashboardsResponse(rsp) +} + +func (c *ClientWithResponses) PostDashboardsWithResponse(ctx context.Context, params *PostDashboardsParams, body PostDashboardsJSONRequestBody) (*postDashboardsResponse, error) { + rsp, err := c.PostDashboards(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostDashboardsResponse(rsp) +} + +// DeleteDashboardsIDWithResponse request returning *DeleteDashboardsIDResponse +func (c *ClientWithResponses) DeleteDashboardsIDWithResponse(ctx context.Context, dashboardID string, params *DeleteDashboardsIDParams) (*deleteDashboardsIDResponse, error) { + rsp, err := c.DeleteDashboardsID(ctx, dashboardID, params) + if err != nil { + return nil, err + } + return ParseDeleteDashboardsIDResponse(rsp) +} + +// GetDashboardsIDWithResponse request returning *GetDashboardsIDResponse +func (c *ClientWithResponses) GetDashboardsIDWithResponse(ctx context.Context, dashboardID string, params *GetDashboardsIDParams) (*getDashboardsIDResponse, error) { + rsp, err := c.GetDashboardsID(ctx, dashboardID, params) + if err != nil { + return nil, err + } + return ParseGetDashboardsIDResponse(rsp) +} + +// PatchDashboardsIDWithBodyWithResponse request with arbitrary body returning *PatchDashboardsIDResponse +func (c *ClientWithResponses) PatchDashboardsIDWithBodyWithResponse(ctx context.Context, dashboardID string, params *PatchDashboardsIDParams, contentType string, body io.Reader) (*patchDashboardsIDResponse, error) { + rsp, err := c.PatchDashboardsIDWithBody(ctx, dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchDashboardsIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchDashboardsIDWithResponse(ctx context.Context, dashboardID string, params *PatchDashboardsIDParams, body PatchDashboardsIDJSONRequestBody) (*patchDashboardsIDResponse, error) { + rsp, err := c.PatchDashboardsID(ctx, dashboardID, params, body) + if err != nil { + return nil, err + } + return ParsePatchDashboardsIDResponse(rsp) +} + +// PostDashboardsIDCellsWithBodyWithResponse request with arbitrary body returning *PostDashboardsIDCellsResponse +func (c *ClientWithResponses) PostDashboardsIDCellsWithBodyWithResponse(ctx context.Context, dashboardID string, params *PostDashboardsIDCellsParams, contentType string, body io.Reader) (*postDashboardsIDCellsResponse, error) { + rsp, err := c.PostDashboardsIDCellsWithBody(ctx, dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostDashboardsIDCellsResponse(rsp) +} + +func (c *ClientWithResponses) PostDashboardsIDCellsWithResponse(ctx context.Context, dashboardID string, params *PostDashboardsIDCellsParams, body PostDashboardsIDCellsJSONRequestBody) (*postDashboardsIDCellsResponse, error) { + rsp, err := c.PostDashboardsIDCells(ctx, dashboardID, params, body) + if err != nil { + return nil, err + } + return ParsePostDashboardsIDCellsResponse(rsp) +} + +// PutDashboardsIDCellsWithBodyWithResponse request with arbitrary body returning *PutDashboardsIDCellsResponse +func (c *ClientWithResponses) PutDashboardsIDCellsWithBodyWithResponse(ctx context.Context, dashboardID string, params *PutDashboardsIDCellsParams, contentType string, body io.Reader) (*putDashboardsIDCellsResponse, error) { + rsp, err := c.PutDashboardsIDCellsWithBody(ctx, dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePutDashboardsIDCellsResponse(rsp) +} + +func (c *ClientWithResponses) PutDashboardsIDCellsWithResponse(ctx context.Context, dashboardID string, params *PutDashboardsIDCellsParams, body PutDashboardsIDCellsJSONRequestBody) (*putDashboardsIDCellsResponse, error) { + rsp, err := c.PutDashboardsIDCells(ctx, dashboardID, params, body) + if err != nil { + return nil, err + } + return ParsePutDashboardsIDCellsResponse(rsp) +} + +// DeleteDashboardsIDCellsIDWithResponse request returning *DeleteDashboardsIDCellsIDResponse +func (c *ClientWithResponses) DeleteDashboardsIDCellsIDWithResponse(ctx context.Context, dashboardID string, cellID string, params *DeleteDashboardsIDCellsIDParams) (*deleteDashboardsIDCellsIDResponse, error) { + rsp, err := c.DeleteDashboardsIDCellsID(ctx, dashboardID, cellID, params) + if err != nil { + return nil, err + } + return ParseDeleteDashboardsIDCellsIDResponse(rsp) +} + +// PatchDashboardsIDCellsIDWithBodyWithResponse request with arbitrary body returning *PatchDashboardsIDCellsIDResponse +func (c *ClientWithResponses) PatchDashboardsIDCellsIDWithBodyWithResponse(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDParams, contentType string, body io.Reader) (*patchDashboardsIDCellsIDResponse, error) { + rsp, err := c.PatchDashboardsIDCellsIDWithBody(ctx, dashboardID, cellID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchDashboardsIDCellsIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchDashboardsIDCellsIDWithResponse(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDParams, body PatchDashboardsIDCellsIDJSONRequestBody) (*patchDashboardsIDCellsIDResponse, error) { + rsp, err := c.PatchDashboardsIDCellsID(ctx, dashboardID, cellID, params, body) + if err != nil { + return nil, err + } + return ParsePatchDashboardsIDCellsIDResponse(rsp) +} + +// GetDashboardsIDCellsIDViewWithResponse request returning *GetDashboardsIDCellsIDViewResponse +func (c *ClientWithResponses) GetDashboardsIDCellsIDViewWithResponse(ctx context.Context, dashboardID string, cellID string, params *GetDashboardsIDCellsIDViewParams) (*getDashboardsIDCellsIDViewResponse, error) { + rsp, err := c.GetDashboardsIDCellsIDView(ctx, dashboardID, cellID, params) + if err != nil { + return nil, err + } + return ParseGetDashboardsIDCellsIDViewResponse(rsp) +} + +// PatchDashboardsIDCellsIDViewWithBodyWithResponse request with arbitrary body returning *PatchDashboardsIDCellsIDViewResponse +func (c *ClientWithResponses) PatchDashboardsIDCellsIDViewWithBodyWithResponse(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDViewParams, contentType string, body io.Reader) (*patchDashboardsIDCellsIDViewResponse, error) { + rsp, err := c.PatchDashboardsIDCellsIDViewWithBody(ctx, dashboardID, cellID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchDashboardsIDCellsIDViewResponse(rsp) +} + +func (c *ClientWithResponses) PatchDashboardsIDCellsIDViewWithResponse(ctx context.Context, dashboardID string, cellID string, params *PatchDashboardsIDCellsIDViewParams, body PatchDashboardsIDCellsIDViewJSONRequestBody) (*patchDashboardsIDCellsIDViewResponse, error) { + rsp, err := c.PatchDashboardsIDCellsIDView(ctx, dashboardID, cellID, params, body) + if err != nil { + return nil, err + } + return ParsePatchDashboardsIDCellsIDViewResponse(rsp) +} + +// GetDashboardsIDLabelsWithResponse request returning *GetDashboardsIDLabelsResponse +func (c *ClientWithResponses) GetDashboardsIDLabelsWithResponse(ctx context.Context, dashboardID string, params *GetDashboardsIDLabelsParams) (*getDashboardsIDLabelsResponse, error) { + rsp, err := c.GetDashboardsIDLabels(ctx, dashboardID, params) + if err != nil { + return nil, err + } + return ParseGetDashboardsIDLabelsResponse(rsp) +} + +// PostDashboardsIDLabelsWithBodyWithResponse request with arbitrary body returning *PostDashboardsIDLabelsResponse +func (c *ClientWithResponses) PostDashboardsIDLabelsWithBodyWithResponse(ctx context.Context, dashboardID string, params *PostDashboardsIDLabelsParams, contentType string, body io.Reader) (*postDashboardsIDLabelsResponse, error) { + rsp, err := c.PostDashboardsIDLabelsWithBody(ctx, dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostDashboardsIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostDashboardsIDLabelsWithResponse(ctx context.Context, dashboardID string, params *PostDashboardsIDLabelsParams, body PostDashboardsIDLabelsJSONRequestBody) (*postDashboardsIDLabelsResponse, error) { + rsp, err := c.PostDashboardsIDLabels(ctx, dashboardID, params, body) + if err != nil { + return nil, err + } + return ParsePostDashboardsIDLabelsResponse(rsp) +} + +// DeleteDashboardsIDLabelsIDWithResponse request returning *DeleteDashboardsIDLabelsIDResponse +func (c *ClientWithResponses) DeleteDashboardsIDLabelsIDWithResponse(ctx context.Context, dashboardID string, labelID string, params *DeleteDashboardsIDLabelsIDParams) (*deleteDashboardsIDLabelsIDResponse, error) { + rsp, err := c.DeleteDashboardsIDLabelsID(ctx, dashboardID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteDashboardsIDLabelsIDResponse(rsp) +} + +// GetDashboardsIDLogsWithResponse request returning *GetDashboardsIDLogsResponse +func (c *ClientWithResponses) GetDashboardsIDLogsWithResponse(ctx context.Context, dashboardID string, params *GetDashboardsIDLogsParams) (*getDashboardsIDLogsResponse, error) { + rsp, err := c.GetDashboardsIDLogs(ctx, dashboardID, params) + if err != nil { + return nil, err + } + return ParseGetDashboardsIDLogsResponse(rsp) +} + +// GetDashboardsIDMembersWithResponse request returning *GetDashboardsIDMembersResponse +func (c *ClientWithResponses) GetDashboardsIDMembersWithResponse(ctx context.Context, dashboardID string, params *GetDashboardsIDMembersParams) (*getDashboardsIDMembersResponse, error) { + rsp, err := c.GetDashboardsIDMembers(ctx, dashboardID, params) + if err != nil { + return nil, err + } + return ParseGetDashboardsIDMembersResponse(rsp) +} + +// PostDashboardsIDMembersWithBodyWithResponse request with arbitrary body returning *PostDashboardsIDMembersResponse +func (c *ClientWithResponses) PostDashboardsIDMembersWithBodyWithResponse(ctx context.Context, dashboardID string, params *PostDashboardsIDMembersParams, contentType string, body io.Reader) (*postDashboardsIDMembersResponse, error) { + rsp, err := c.PostDashboardsIDMembersWithBody(ctx, dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostDashboardsIDMembersResponse(rsp) +} + +func (c *ClientWithResponses) PostDashboardsIDMembersWithResponse(ctx context.Context, dashboardID string, params *PostDashboardsIDMembersParams, body PostDashboardsIDMembersJSONRequestBody) (*postDashboardsIDMembersResponse, error) { + rsp, err := c.PostDashboardsIDMembers(ctx, dashboardID, params, body) + if err != nil { + return nil, err + } + return ParsePostDashboardsIDMembersResponse(rsp) +} + +// DeleteDashboardsIDMembersIDWithResponse request returning *DeleteDashboardsIDMembersIDResponse +func (c *ClientWithResponses) DeleteDashboardsIDMembersIDWithResponse(ctx context.Context, dashboardID string, userID string, params *DeleteDashboardsIDMembersIDParams) (*deleteDashboardsIDMembersIDResponse, error) { + rsp, err := c.DeleteDashboardsIDMembersID(ctx, dashboardID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteDashboardsIDMembersIDResponse(rsp) +} + +// GetDashboardsIDOwnersWithResponse request returning *GetDashboardsIDOwnersResponse +func (c *ClientWithResponses) GetDashboardsIDOwnersWithResponse(ctx context.Context, dashboardID string, params *GetDashboardsIDOwnersParams) (*getDashboardsIDOwnersResponse, error) { + rsp, err := c.GetDashboardsIDOwners(ctx, dashboardID, params) + if err != nil { + return nil, err + } + return ParseGetDashboardsIDOwnersResponse(rsp) +} + +// PostDashboardsIDOwnersWithBodyWithResponse request with arbitrary body returning *PostDashboardsIDOwnersResponse +func (c *ClientWithResponses) PostDashboardsIDOwnersWithBodyWithResponse(ctx context.Context, dashboardID string, params *PostDashboardsIDOwnersParams, contentType string, body io.Reader) (*postDashboardsIDOwnersResponse, error) { + rsp, err := c.PostDashboardsIDOwnersWithBody(ctx, dashboardID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostDashboardsIDOwnersResponse(rsp) +} + +func (c *ClientWithResponses) PostDashboardsIDOwnersWithResponse(ctx context.Context, dashboardID string, params *PostDashboardsIDOwnersParams, body PostDashboardsIDOwnersJSONRequestBody) (*postDashboardsIDOwnersResponse, error) { + rsp, err := c.PostDashboardsIDOwners(ctx, dashboardID, params, body) + if err != nil { + return nil, err + } + return ParsePostDashboardsIDOwnersResponse(rsp) +} + +// DeleteDashboardsIDOwnersIDWithResponse request returning *DeleteDashboardsIDOwnersIDResponse +func (c *ClientWithResponses) DeleteDashboardsIDOwnersIDWithResponse(ctx context.Context, dashboardID string, userID string, params *DeleteDashboardsIDOwnersIDParams) (*deleteDashboardsIDOwnersIDResponse, error) { + rsp, err := c.DeleteDashboardsIDOwnersID(ctx, dashboardID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteDashboardsIDOwnersIDResponse(rsp) +} + +// PostDeleteWithBodyWithResponse request with arbitrary body returning *PostDeleteResponse +func (c *ClientWithResponses) PostDeleteWithBodyWithResponse(ctx context.Context, params *PostDeleteParams, contentType string, body io.Reader) (*postDeleteResponse, error) { + rsp, err := c.PostDeleteWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostDeleteResponse(rsp) +} + +func (c *ClientWithResponses) PostDeleteWithResponse(ctx context.Context, params *PostDeleteParams, body PostDeleteJSONRequestBody) (*postDeleteResponse, error) { + rsp, err := c.PostDelete(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostDeleteResponse(rsp) +} + +// GetDocumentsTemplatesWithResponse request returning *GetDocumentsTemplatesResponse +func (c *ClientWithResponses) GetDocumentsTemplatesWithResponse(ctx context.Context, params *GetDocumentsTemplatesParams) (*getDocumentsTemplatesResponse, error) { + rsp, err := c.GetDocumentsTemplates(ctx, params) + if err != nil { + return nil, err + } + return ParseGetDocumentsTemplatesResponse(rsp) +} + +// PostDocumentsTemplatesWithBodyWithResponse request with arbitrary body returning *PostDocumentsTemplatesResponse +func (c *ClientWithResponses) PostDocumentsTemplatesWithBodyWithResponse(ctx context.Context, params *PostDocumentsTemplatesParams, contentType string, body io.Reader) (*postDocumentsTemplatesResponse, error) { + rsp, err := c.PostDocumentsTemplatesWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostDocumentsTemplatesResponse(rsp) +} + +func (c *ClientWithResponses) PostDocumentsTemplatesWithResponse(ctx context.Context, params *PostDocumentsTemplatesParams, body PostDocumentsTemplatesJSONRequestBody) (*postDocumentsTemplatesResponse, error) { + rsp, err := c.PostDocumentsTemplates(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostDocumentsTemplatesResponse(rsp) +} + +// DeleteDocumentsTemplatesIDWithResponse request returning *DeleteDocumentsTemplatesIDResponse +func (c *ClientWithResponses) DeleteDocumentsTemplatesIDWithResponse(ctx context.Context, templateID string, params *DeleteDocumentsTemplatesIDParams) (*deleteDocumentsTemplatesIDResponse, error) { + rsp, err := c.DeleteDocumentsTemplatesID(ctx, templateID, params) + if err != nil { + return nil, err + } + return ParseDeleteDocumentsTemplatesIDResponse(rsp) +} + +// GetDocumentsTemplatesIDWithResponse request returning *GetDocumentsTemplatesIDResponse +func (c *ClientWithResponses) GetDocumentsTemplatesIDWithResponse(ctx context.Context, templateID string, params *GetDocumentsTemplatesIDParams) (*getDocumentsTemplatesIDResponse, error) { + rsp, err := c.GetDocumentsTemplatesID(ctx, templateID, params) + if err != nil { + return nil, err + } + return ParseGetDocumentsTemplatesIDResponse(rsp) +} + +// PutDocumentsTemplatesIDWithBodyWithResponse request with arbitrary body returning *PutDocumentsTemplatesIDResponse +func (c *ClientWithResponses) PutDocumentsTemplatesIDWithBodyWithResponse(ctx context.Context, templateID string, params *PutDocumentsTemplatesIDParams, contentType string, body io.Reader) (*putDocumentsTemplatesIDResponse, error) { + rsp, err := c.PutDocumentsTemplatesIDWithBody(ctx, templateID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePutDocumentsTemplatesIDResponse(rsp) +} + +func (c *ClientWithResponses) PutDocumentsTemplatesIDWithResponse(ctx context.Context, templateID string, params *PutDocumentsTemplatesIDParams, body PutDocumentsTemplatesIDJSONRequestBody) (*putDocumentsTemplatesIDResponse, error) { + rsp, err := c.PutDocumentsTemplatesID(ctx, templateID, params, body) + if err != nil { + return nil, err + } + return ParsePutDocumentsTemplatesIDResponse(rsp) +} + +// GetDocumentsTemplatesIDLabelsWithResponse request returning *GetDocumentsTemplatesIDLabelsResponse +func (c *ClientWithResponses) GetDocumentsTemplatesIDLabelsWithResponse(ctx context.Context, templateID string, params *GetDocumentsTemplatesIDLabelsParams) (*getDocumentsTemplatesIDLabelsResponse, error) { + rsp, err := c.GetDocumentsTemplatesIDLabels(ctx, templateID, params) + if err != nil { + return nil, err + } + return ParseGetDocumentsTemplatesIDLabelsResponse(rsp) +} + +// PostDocumentsTemplatesIDLabelsWithBodyWithResponse request with arbitrary body returning *PostDocumentsTemplatesIDLabelsResponse +func (c *ClientWithResponses) PostDocumentsTemplatesIDLabelsWithBodyWithResponse(ctx context.Context, templateID string, params *PostDocumentsTemplatesIDLabelsParams, contentType string, body io.Reader) (*postDocumentsTemplatesIDLabelsResponse, error) { + rsp, err := c.PostDocumentsTemplatesIDLabelsWithBody(ctx, templateID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostDocumentsTemplatesIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostDocumentsTemplatesIDLabelsWithResponse(ctx context.Context, templateID string, params *PostDocumentsTemplatesIDLabelsParams, body PostDocumentsTemplatesIDLabelsJSONRequestBody) (*postDocumentsTemplatesIDLabelsResponse, error) { + rsp, err := c.PostDocumentsTemplatesIDLabels(ctx, templateID, params, body) + if err != nil { + return nil, err + } + return ParsePostDocumentsTemplatesIDLabelsResponse(rsp) +} + +// DeleteDocumentsTemplatesIDLabelsIDWithResponse request returning *DeleteDocumentsTemplatesIDLabelsIDResponse +func (c *ClientWithResponses) DeleteDocumentsTemplatesIDLabelsIDWithResponse(ctx context.Context, templateID string, labelID string, params *DeleteDocumentsTemplatesIDLabelsIDParams) (*deleteDocumentsTemplatesIDLabelsIDResponse, error) { + rsp, err := c.DeleteDocumentsTemplatesIDLabelsID(ctx, templateID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteDocumentsTemplatesIDLabelsIDResponse(rsp) +} + +// GetHealthWithResponse request returning *GetHealthResponse +func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, params *GetHealthParams) (*getHealthResponse, error) { + rsp, err := c.GetHealth(ctx, params) + if err != nil { + return nil, err + } + return ParseGetHealthResponse(rsp) +} + +// GetLabelsWithResponse request returning *GetLabelsResponse +func (c *ClientWithResponses) GetLabelsWithResponse(ctx context.Context, params *GetLabelsParams) (*getLabelsResponse, error) { + rsp, err := c.GetLabels(ctx, params) + if err != nil { + return nil, err + } + return ParseGetLabelsResponse(rsp) +} + +// PostLabelsWithBodyWithResponse request with arbitrary body returning *PostLabelsResponse +func (c *ClientWithResponses) PostLabelsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*postLabelsResponse, error) { + rsp, err := c.PostLabelsWithBody(ctx, contentType, body) + if err != nil { + return nil, err + } + return ParsePostLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostLabelsWithResponse(ctx context.Context, body PostLabelsJSONRequestBody) (*postLabelsResponse, error) { + rsp, err := c.PostLabels(ctx, body) + if err != nil { + return nil, err + } + return ParsePostLabelsResponse(rsp) +} + +// DeleteLabelsIDWithResponse request returning *DeleteLabelsIDResponse +func (c *ClientWithResponses) DeleteLabelsIDWithResponse(ctx context.Context, labelID string, params *DeleteLabelsIDParams) (*deleteLabelsIDResponse, error) { + rsp, err := c.DeleteLabelsID(ctx, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteLabelsIDResponse(rsp) +} + +// GetLabelsIDWithResponse request returning *GetLabelsIDResponse +func (c *ClientWithResponses) GetLabelsIDWithResponse(ctx context.Context, labelID string, params *GetLabelsIDParams) (*getLabelsIDResponse, error) { + rsp, err := c.GetLabelsID(ctx, labelID, params) + if err != nil { + return nil, err + } + return ParseGetLabelsIDResponse(rsp) +} + +// PatchLabelsIDWithBodyWithResponse request with arbitrary body returning *PatchLabelsIDResponse +func (c *ClientWithResponses) PatchLabelsIDWithBodyWithResponse(ctx context.Context, labelID string, params *PatchLabelsIDParams, contentType string, body io.Reader) (*patchLabelsIDResponse, error) { + rsp, err := c.PatchLabelsIDWithBody(ctx, labelID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchLabelsIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchLabelsIDWithResponse(ctx context.Context, labelID string, params *PatchLabelsIDParams, body PatchLabelsIDJSONRequestBody) (*patchLabelsIDResponse, error) { + rsp, err := c.PatchLabelsID(ctx, labelID, params, body) + if err != nil { + return nil, err + } + return ParsePatchLabelsIDResponse(rsp) +} + +// GetMeWithResponse request returning *GetMeResponse +func (c *ClientWithResponses) GetMeWithResponse(ctx context.Context, params *GetMeParams) (*getMeResponse, error) { + rsp, err := c.GetMe(ctx, params) + if err != nil { + return nil, err + } + return ParseGetMeResponse(rsp) +} + +// PutMePasswordWithBodyWithResponse request with arbitrary body returning *PutMePasswordResponse +func (c *ClientWithResponses) PutMePasswordWithBodyWithResponse(ctx context.Context, params *PutMePasswordParams, contentType string, body io.Reader) (*putMePasswordResponse, error) { + rsp, err := c.PutMePasswordWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePutMePasswordResponse(rsp) +} + +func (c *ClientWithResponses) PutMePasswordWithResponse(ctx context.Context, params *PutMePasswordParams, body PutMePasswordJSONRequestBody) (*putMePasswordResponse, error) { + rsp, err := c.PutMePassword(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePutMePasswordResponse(rsp) +} + +// GetNotificationEndpointsWithResponse request returning *GetNotificationEndpointsResponse +func (c *ClientWithResponses) GetNotificationEndpointsWithResponse(ctx context.Context, params *GetNotificationEndpointsParams) (*getNotificationEndpointsResponse, error) { + rsp, err := c.GetNotificationEndpoints(ctx, params) + if err != nil { + return nil, err + } + return ParseGetNotificationEndpointsResponse(rsp) +} + +// CreateNotificationEndpointWithBodyWithResponse request with arbitrary body returning *CreateNotificationEndpointResponse +func (c *ClientWithResponses) CreateNotificationEndpointWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*createNotificationEndpointResponse, error) { + rsp, err := c.CreateNotificationEndpointWithBody(ctx, contentType, body) + if err != nil { + return nil, err + } + return ParseCreateNotificationEndpointResponse(rsp) +} + +func (c *ClientWithResponses) CreateNotificationEndpointWithResponse(ctx context.Context, body CreateNotificationEndpointJSONRequestBody) (*createNotificationEndpointResponse, error) { + rsp, err := c.CreateNotificationEndpoint(ctx, body) + if err != nil { + return nil, err + } + return ParseCreateNotificationEndpointResponse(rsp) +} + +// DeleteNotificationEndpointsIDWithResponse request returning *DeleteNotificationEndpointsIDResponse +func (c *ClientWithResponses) DeleteNotificationEndpointsIDWithResponse(ctx context.Context, endpointID string, params *DeleteNotificationEndpointsIDParams) (*deleteNotificationEndpointsIDResponse, error) { + rsp, err := c.DeleteNotificationEndpointsID(ctx, endpointID, params) + if err != nil { + return nil, err + } + return ParseDeleteNotificationEndpointsIDResponse(rsp) +} + +// GetNotificationEndpointsIDWithResponse request returning *GetNotificationEndpointsIDResponse +func (c *ClientWithResponses) GetNotificationEndpointsIDWithResponse(ctx context.Context, endpointID string, params *GetNotificationEndpointsIDParams) (*getNotificationEndpointsIDResponse, error) { + rsp, err := c.GetNotificationEndpointsID(ctx, endpointID, params) + if err != nil { + return nil, err + } + return ParseGetNotificationEndpointsIDResponse(rsp) +} + +// PatchNotificationEndpointsIDWithBodyWithResponse request with arbitrary body returning *PatchNotificationEndpointsIDResponse +func (c *ClientWithResponses) PatchNotificationEndpointsIDWithBodyWithResponse(ctx context.Context, endpointID string, params *PatchNotificationEndpointsIDParams, contentType string, body io.Reader) (*patchNotificationEndpointsIDResponse, error) { + rsp, err := c.PatchNotificationEndpointsIDWithBody(ctx, endpointID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchNotificationEndpointsIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchNotificationEndpointsIDWithResponse(ctx context.Context, endpointID string, params *PatchNotificationEndpointsIDParams, body PatchNotificationEndpointsIDJSONRequestBody) (*patchNotificationEndpointsIDResponse, error) { + rsp, err := c.PatchNotificationEndpointsID(ctx, endpointID, params, body) + if err != nil { + return nil, err + } + return ParsePatchNotificationEndpointsIDResponse(rsp) +} + +// PutNotificationEndpointsIDWithBodyWithResponse request with arbitrary body returning *PutNotificationEndpointsIDResponse +func (c *ClientWithResponses) PutNotificationEndpointsIDWithBodyWithResponse(ctx context.Context, endpointID string, params *PutNotificationEndpointsIDParams, contentType string, body io.Reader) (*putNotificationEndpointsIDResponse, error) { + rsp, err := c.PutNotificationEndpointsIDWithBody(ctx, endpointID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePutNotificationEndpointsIDResponse(rsp) +} + +func (c *ClientWithResponses) PutNotificationEndpointsIDWithResponse(ctx context.Context, endpointID string, params *PutNotificationEndpointsIDParams, body PutNotificationEndpointsIDJSONRequestBody) (*putNotificationEndpointsIDResponse, error) { + rsp, err := c.PutNotificationEndpointsID(ctx, endpointID, params, body) + if err != nil { + return nil, err + } + return ParsePutNotificationEndpointsIDResponse(rsp) +} + +// GetNotificationEndpointsIDLabelsWithResponse request returning *GetNotificationEndpointsIDLabelsResponse +func (c *ClientWithResponses) GetNotificationEndpointsIDLabelsWithResponse(ctx context.Context, endpointID string, params *GetNotificationEndpointsIDLabelsParams) (*getNotificationEndpointsIDLabelsResponse, error) { + rsp, err := c.GetNotificationEndpointsIDLabels(ctx, endpointID, params) + if err != nil { + return nil, err + } + return ParseGetNotificationEndpointsIDLabelsResponse(rsp) +} + +// PostNotificationEndpointIDLabelsWithBodyWithResponse request with arbitrary body returning *PostNotificationEndpointIDLabelsResponse +func (c *ClientWithResponses) PostNotificationEndpointIDLabelsWithBodyWithResponse(ctx context.Context, endpointID string, params *PostNotificationEndpointIDLabelsParams, contentType string, body io.Reader) (*postNotificationEndpointIDLabelsResponse, error) { + rsp, err := c.PostNotificationEndpointIDLabelsWithBody(ctx, endpointID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostNotificationEndpointIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostNotificationEndpointIDLabelsWithResponse(ctx context.Context, endpointID string, params *PostNotificationEndpointIDLabelsParams, body PostNotificationEndpointIDLabelsJSONRequestBody) (*postNotificationEndpointIDLabelsResponse, error) { + rsp, err := c.PostNotificationEndpointIDLabels(ctx, endpointID, params, body) + if err != nil { + return nil, err + } + return ParsePostNotificationEndpointIDLabelsResponse(rsp) +} + +// DeleteNotificationEndpointsIDLabelsIDWithResponse request returning *DeleteNotificationEndpointsIDLabelsIDResponse +func (c *ClientWithResponses) DeleteNotificationEndpointsIDLabelsIDWithResponse(ctx context.Context, endpointID string, labelID string, params *DeleteNotificationEndpointsIDLabelsIDParams) (*deleteNotificationEndpointsIDLabelsIDResponse, error) { + rsp, err := c.DeleteNotificationEndpointsIDLabelsID(ctx, endpointID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteNotificationEndpointsIDLabelsIDResponse(rsp) +} + +// GetNotificationRulesWithResponse request returning *GetNotificationRulesResponse +func (c *ClientWithResponses) GetNotificationRulesWithResponse(ctx context.Context, params *GetNotificationRulesParams) (*getNotificationRulesResponse, error) { + rsp, err := c.GetNotificationRules(ctx, params) + if err != nil { + return nil, err + } + return ParseGetNotificationRulesResponse(rsp) +} + +// CreateNotificationRuleWithBodyWithResponse request with arbitrary body returning *CreateNotificationRuleResponse +func (c *ClientWithResponses) CreateNotificationRuleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*createNotificationRuleResponse, error) { + rsp, err := c.CreateNotificationRuleWithBody(ctx, contentType, body) + if err != nil { + return nil, err + } + return ParseCreateNotificationRuleResponse(rsp) +} + +func (c *ClientWithResponses) CreateNotificationRuleWithResponse(ctx context.Context, body CreateNotificationRuleJSONRequestBody) (*createNotificationRuleResponse, error) { + rsp, err := c.CreateNotificationRule(ctx, body) + if err != nil { + return nil, err + } + return ParseCreateNotificationRuleResponse(rsp) +} + +// DeleteNotificationRulesIDWithResponse request returning *DeleteNotificationRulesIDResponse +func (c *ClientWithResponses) DeleteNotificationRulesIDWithResponse(ctx context.Context, ruleID string, params *DeleteNotificationRulesIDParams) (*deleteNotificationRulesIDResponse, error) { + rsp, err := c.DeleteNotificationRulesID(ctx, ruleID, params) + if err != nil { + return nil, err + } + return ParseDeleteNotificationRulesIDResponse(rsp) +} + +// GetNotificationRulesIDWithResponse request returning *GetNotificationRulesIDResponse +func (c *ClientWithResponses) GetNotificationRulesIDWithResponse(ctx context.Context, ruleID string, params *GetNotificationRulesIDParams) (*getNotificationRulesIDResponse, error) { + rsp, err := c.GetNotificationRulesID(ctx, ruleID, params) + if err != nil { + return nil, err + } + return ParseGetNotificationRulesIDResponse(rsp) +} + +// PatchNotificationRulesIDWithBodyWithResponse request with arbitrary body returning *PatchNotificationRulesIDResponse +func (c *ClientWithResponses) PatchNotificationRulesIDWithBodyWithResponse(ctx context.Context, ruleID string, params *PatchNotificationRulesIDParams, contentType string, body io.Reader) (*patchNotificationRulesIDResponse, error) { + rsp, err := c.PatchNotificationRulesIDWithBody(ctx, ruleID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchNotificationRulesIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchNotificationRulesIDWithResponse(ctx context.Context, ruleID string, params *PatchNotificationRulesIDParams, body PatchNotificationRulesIDJSONRequestBody) (*patchNotificationRulesIDResponse, error) { + rsp, err := c.PatchNotificationRulesID(ctx, ruleID, params, body) + if err != nil { + return nil, err + } + return ParsePatchNotificationRulesIDResponse(rsp) +} + +// PutNotificationRulesIDWithBodyWithResponse request with arbitrary body returning *PutNotificationRulesIDResponse +func (c *ClientWithResponses) PutNotificationRulesIDWithBodyWithResponse(ctx context.Context, ruleID string, params *PutNotificationRulesIDParams, contentType string, body io.Reader) (*putNotificationRulesIDResponse, error) { + rsp, err := c.PutNotificationRulesIDWithBody(ctx, ruleID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePutNotificationRulesIDResponse(rsp) +} + +func (c *ClientWithResponses) PutNotificationRulesIDWithResponse(ctx context.Context, ruleID string, params *PutNotificationRulesIDParams, body PutNotificationRulesIDJSONRequestBody) (*putNotificationRulesIDResponse, error) { + rsp, err := c.PutNotificationRulesID(ctx, ruleID, params, body) + if err != nil { + return nil, err + } + return ParsePutNotificationRulesIDResponse(rsp) +} + +// GetNotificationRulesIDLabelsWithResponse request returning *GetNotificationRulesIDLabelsResponse +func (c *ClientWithResponses) GetNotificationRulesIDLabelsWithResponse(ctx context.Context, ruleID string, params *GetNotificationRulesIDLabelsParams) (*getNotificationRulesIDLabelsResponse, error) { + rsp, err := c.GetNotificationRulesIDLabels(ctx, ruleID, params) + if err != nil { + return nil, err + } + return ParseGetNotificationRulesIDLabelsResponse(rsp) +} + +// PostNotificationRuleIDLabelsWithBodyWithResponse request with arbitrary body returning *PostNotificationRuleIDLabelsResponse +func (c *ClientWithResponses) PostNotificationRuleIDLabelsWithBodyWithResponse(ctx context.Context, ruleID string, params *PostNotificationRuleIDLabelsParams, contentType string, body io.Reader) (*postNotificationRuleIDLabelsResponse, error) { + rsp, err := c.PostNotificationRuleIDLabelsWithBody(ctx, ruleID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostNotificationRuleIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostNotificationRuleIDLabelsWithResponse(ctx context.Context, ruleID string, params *PostNotificationRuleIDLabelsParams, body PostNotificationRuleIDLabelsJSONRequestBody) (*postNotificationRuleIDLabelsResponse, error) { + rsp, err := c.PostNotificationRuleIDLabels(ctx, ruleID, params, body) + if err != nil { + return nil, err + } + return ParsePostNotificationRuleIDLabelsResponse(rsp) +} + +// DeleteNotificationRulesIDLabelsIDWithResponse request returning *DeleteNotificationRulesIDLabelsIDResponse +func (c *ClientWithResponses) DeleteNotificationRulesIDLabelsIDWithResponse(ctx context.Context, ruleID string, labelID string, params *DeleteNotificationRulesIDLabelsIDParams) (*deleteNotificationRulesIDLabelsIDResponse, error) { + rsp, err := c.DeleteNotificationRulesIDLabelsID(ctx, ruleID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteNotificationRulesIDLabelsIDResponse(rsp) +} + +// GetNotificationRulesIDQueryWithResponse request returning *GetNotificationRulesIDQueryResponse +func (c *ClientWithResponses) GetNotificationRulesIDQueryWithResponse(ctx context.Context, ruleID string, params *GetNotificationRulesIDQueryParams) (*getNotificationRulesIDQueryResponse, error) { + rsp, err := c.GetNotificationRulesIDQuery(ctx, ruleID, params) + if err != nil { + return nil, err + } + return ParseGetNotificationRulesIDQueryResponse(rsp) +} + +// GetOrgsWithResponse request returning *GetOrgsResponse +func (c *ClientWithResponses) GetOrgsWithResponse(ctx context.Context, params *GetOrgsParams) (*getOrgsResponse, error) { + rsp, err := c.GetOrgs(ctx, params) + if err != nil { + return nil, err + } + return ParseGetOrgsResponse(rsp) +} + +// PostOrgsWithBodyWithResponse request with arbitrary body returning *PostOrgsResponse +func (c *ClientWithResponses) PostOrgsWithBodyWithResponse(ctx context.Context, params *PostOrgsParams, contentType string, body io.Reader) (*postOrgsResponse, error) { + rsp, err := c.PostOrgsWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostOrgsResponse(rsp) +} + +func (c *ClientWithResponses) PostOrgsWithResponse(ctx context.Context, params *PostOrgsParams, body PostOrgsJSONRequestBody) (*postOrgsResponse, error) { + rsp, err := c.PostOrgs(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostOrgsResponse(rsp) +} + +// DeleteOrgsIDWithResponse request returning *DeleteOrgsIDResponse +func (c *ClientWithResponses) DeleteOrgsIDWithResponse(ctx context.Context, orgID string, params *DeleteOrgsIDParams) (*deleteOrgsIDResponse, error) { + rsp, err := c.DeleteOrgsID(ctx, orgID, params) + if err != nil { + return nil, err + } + return ParseDeleteOrgsIDResponse(rsp) +} + +// GetOrgsIDWithResponse request returning *GetOrgsIDResponse +func (c *ClientWithResponses) GetOrgsIDWithResponse(ctx context.Context, orgID string, params *GetOrgsIDParams) (*getOrgsIDResponse, error) { + rsp, err := c.GetOrgsID(ctx, orgID, params) + if err != nil { + return nil, err + } + return ParseGetOrgsIDResponse(rsp) +} + +// PatchOrgsIDWithBodyWithResponse request with arbitrary body returning *PatchOrgsIDResponse +func (c *ClientWithResponses) PatchOrgsIDWithBodyWithResponse(ctx context.Context, orgID string, params *PatchOrgsIDParams, contentType string, body io.Reader) (*patchOrgsIDResponse, error) { + rsp, err := c.PatchOrgsIDWithBody(ctx, orgID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchOrgsIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchOrgsIDWithResponse(ctx context.Context, orgID string, params *PatchOrgsIDParams, body PatchOrgsIDJSONRequestBody) (*patchOrgsIDResponse, error) { + rsp, err := c.PatchOrgsID(ctx, orgID, params, body) + if err != nil { + return nil, err + } + return ParsePatchOrgsIDResponse(rsp) +} + +// GetOrgsIDLabelsWithResponse request returning *GetOrgsIDLabelsResponse +func (c *ClientWithResponses) GetOrgsIDLabelsWithResponse(ctx context.Context, orgID string, params *GetOrgsIDLabelsParams) (*getOrgsIDLabelsResponse, error) { + rsp, err := c.GetOrgsIDLabels(ctx, orgID, params) + if err != nil { + return nil, err + } + return ParseGetOrgsIDLabelsResponse(rsp) +} + +// PostOrgsIDLabelsWithBodyWithResponse request with arbitrary body returning *PostOrgsIDLabelsResponse +func (c *ClientWithResponses) PostOrgsIDLabelsWithBodyWithResponse(ctx context.Context, orgID string, params *PostOrgsIDLabelsParams, contentType string, body io.Reader) (*postOrgsIDLabelsResponse, error) { + rsp, err := c.PostOrgsIDLabelsWithBody(ctx, orgID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostOrgsIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostOrgsIDLabelsWithResponse(ctx context.Context, orgID string, params *PostOrgsIDLabelsParams, body PostOrgsIDLabelsJSONRequestBody) (*postOrgsIDLabelsResponse, error) { + rsp, err := c.PostOrgsIDLabels(ctx, orgID, params, body) + if err != nil { + return nil, err + } + return ParsePostOrgsIDLabelsResponse(rsp) +} + +// DeleteOrgsIDLabelsIDWithResponse request returning *DeleteOrgsIDLabelsIDResponse +func (c *ClientWithResponses) DeleteOrgsIDLabelsIDWithResponse(ctx context.Context, orgID string, labelID string, params *DeleteOrgsIDLabelsIDParams) (*deleteOrgsIDLabelsIDResponse, error) { + rsp, err := c.DeleteOrgsIDLabelsID(ctx, orgID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteOrgsIDLabelsIDResponse(rsp) +} + +// GetOrgsIDLogsWithResponse request returning *GetOrgsIDLogsResponse +func (c *ClientWithResponses) GetOrgsIDLogsWithResponse(ctx context.Context, orgID string, params *GetOrgsIDLogsParams) (*getOrgsIDLogsResponse, error) { + rsp, err := c.GetOrgsIDLogs(ctx, orgID, params) + if err != nil { + return nil, err + } + return ParseGetOrgsIDLogsResponse(rsp) +} + +// GetOrgsIDMembersWithResponse request returning *GetOrgsIDMembersResponse +func (c *ClientWithResponses) GetOrgsIDMembersWithResponse(ctx context.Context, orgID string, params *GetOrgsIDMembersParams) (*getOrgsIDMembersResponse, error) { + rsp, err := c.GetOrgsIDMembers(ctx, orgID, params) + if err != nil { + return nil, err + } + return ParseGetOrgsIDMembersResponse(rsp) +} + +// PostOrgsIDMembersWithBodyWithResponse request with arbitrary body returning *PostOrgsIDMembersResponse +func (c *ClientWithResponses) PostOrgsIDMembersWithBodyWithResponse(ctx context.Context, orgID string, params *PostOrgsIDMembersParams, contentType string, body io.Reader) (*postOrgsIDMembersResponse, error) { + rsp, err := c.PostOrgsIDMembersWithBody(ctx, orgID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostOrgsIDMembersResponse(rsp) +} + +func (c *ClientWithResponses) PostOrgsIDMembersWithResponse(ctx context.Context, orgID string, params *PostOrgsIDMembersParams, body PostOrgsIDMembersJSONRequestBody) (*postOrgsIDMembersResponse, error) { + rsp, err := c.PostOrgsIDMembers(ctx, orgID, params, body) + if err != nil { + return nil, err + } + return ParsePostOrgsIDMembersResponse(rsp) +} + +// DeleteOrgsIDMembersIDWithResponse request returning *DeleteOrgsIDMembersIDResponse +func (c *ClientWithResponses) DeleteOrgsIDMembersIDWithResponse(ctx context.Context, orgID string, userID string, params *DeleteOrgsIDMembersIDParams) (*deleteOrgsIDMembersIDResponse, error) { + rsp, err := c.DeleteOrgsIDMembersID(ctx, orgID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteOrgsIDMembersIDResponse(rsp) +} + +// GetOrgsIDOwnersWithResponse request returning *GetOrgsIDOwnersResponse +func (c *ClientWithResponses) GetOrgsIDOwnersWithResponse(ctx context.Context, orgID string, params *GetOrgsIDOwnersParams) (*getOrgsIDOwnersResponse, error) { + rsp, err := c.GetOrgsIDOwners(ctx, orgID, params) + if err != nil { + return nil, err + } + return ParseGetOrgsIDOwnersResponse(rsp) +} + +// PostOrgsIDOwnersWithBodyWithResponse request with arbitrary body returning *PostOrgsIDOwnersResponse +func (c *ClientWithResponses) PostOrgsIDOwnersWithBodyWithResponse(ctx context.Context, orgID string, params *PostOrgsIDOwnersParams, contentType string, body io.Reader) (*postOrgsIDOwnersResponse, error) { + rsp, err := c.PostOrgsIDOwnersWithBody(ctx, orgID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostOrgsIDOwnersResponse(rsp) +} + +func (c *ClientWithResponses) PostOrgsIDOwnersWithResponse(ctx context.Context, orgID string, params *PostOrgsIDOwnersParams, body PostOrgsIDOwnersJSONRequestBody) (*postOrgsIDOwnersResponse, error) { + rsp, err := c.PostOrgsIDOwners(ctx, orgID, params, body) + if err != nil { + return nil, err + } + return ParsePostOrgsIDOwnersResponse(rsp) +} + +// DeleteOrgsIDOwnersIDWithResponse request returning *DeleteOrgsIDOwnersIDResponse +func (c *ClientWithResponses) DeleteOrgsIDOwnersIDWithResponse(ctx context.Context, orgID string, userID string, params *DeleteOrgsIDOwnersIDParams) (*deleteOrgsIDOwnersIDResponse, error) { + rsp, err := c.DeleteOrgsIDOwnersID(ctx, orgID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteOrgsIDOwnersIDResponse(rsp) +} + +// GetOrgsIDSecretsWithResponse request returning *GetOrgsIDSecretsResponse +func (c *ClientWithResponses) GetOrgsIDSecretsWithResponse(ctx context.Context, orgID string, params *GetOrgsIDSecretsParams) (*getOrgsIDSecretsResponse, error) { + rsp, err := c.GetOrgsIDSecrets(ctx, orgID, params) + if err != nil { + return nil, err + } + return ParseGetOrgsIDSecretsResponse(rsp) +} + +// PatchOrgsIDSecretsWithBodyWithResponse request with arbitrary body returning *PatchOrgsIDSecretsResponse +func (c *ClientWithResponses) PatchOrgsIDSecretsWithBodyWithResponse(ctx context.Context, orgID string, params *PatchOrgsIDSecretsParams, contentType string, body io.Reader) (*patchOrgsIDSecretsResponse, error) { + rsp, err := c.PatchOrgsIDSecretsWithBody(ctx, orgID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchOrgsIDSecretsResponse(rsp) +} + +func (c *ClientWithResponses) PatchOrgsIDSecretsWithResponse(ctx context.Context, orgID string, params *PatchOrgsIDSecretsParams, body PatchOrgsIDSecretsJSONRequestBody) (*patchOrgsIDSecretsResponse, error) { + rsp, err := c.PatchOrgsIDSecrets(ctx, orgID, params, body) + if err != nil { + return nil, err + } + return ParsePatchOrgsIDSecretsResponse(rsp) +} + +// PostOrgsIDSecretsWithBodyWithResponse request with arbitrary body returning *PostOrgsIDSecretsResponse +func (c *ClientWithResponses) PostOrgsIDSecretsWithBodyWithResponse(ctx context.Context, orgID string, params *PostOrgsIDSecretsParams, contentType string, body io.Reader) (*postOrgsIDSecretsResponse, error) { + rsp, err := c.PostOrgsIDSecretsWithBody(ctx, orgID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostOrgsIDSecretsResponse(rsp) +} + +func (c *ClientWithResponses) PostOrgsIDSecretsWithResponse(ctx context.Context, orgID string, params *PostOrgsIDSecretsParams, body PostOrgsIDSecretsJSONRequestBody) (*postOrgsIDSecretsResponse, error) { + rsp, err := c.PostOrgsIDSecrets(ctx, orgID, params, body) + if err != nil { + return nil, err + } + return ParsePostOrgsIDSecretsResponse(rsp) +} + +// CreatePkgWithBodyWithResponse request with arbitrary body returning *CreatePkgResponse +func (c *ClientWithResponses) CreatePkgWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*createPkgResponse, error) { + rsp, err := c.CreatePkgWithBody(ctx, contentType, body) + if err != nil { + return nil, err + } + return ParseCreatePkgResponse(rsp) +} + +func (c *ClientWithResponses) CreatePkgWithResponse(ctx context.Context, body CreatePkgJSONRequestBody) (*createPkgResponse, error) { + rsp, err := c.CreatePkg(ctx, body) + if err != nil { + return nil, err + } + return ParseCreatePkgResponse(rsp) +} + +// ApplyPkgWithBodyWithResponse request with arbitrary body returning *ApplyPkgResponse +func (c *ClientWithResponses) ApplyPkgWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*applyPkgResponse, error) { + rsp, err := c.ApplyPkgWithBody(ctx, contentType, body) + if err != nil { + return nil, err + } + return ParseApplyPkgResponse(rsp) +} + +func (c *ClientWithResponses) ApplyPkgWithResponse(ctx context.Context, body ApplyPkgJSONRequestBody) (*applyPkgResponse, error) { + rsp, err := c.ApplyPkg(ctx, body) + if err != nil { + return nil, err + } + return ParseApplyPkgResponse(rsp) +} + +// PostQueryWithBodyWithResponse request with arbitrary body returning *PostQueryResponse +func (c *ClientWithResponses) PostQueryWithBodyWithResponse(ctx context.Context, params *PostQueryParams, contentType string, body io.Reader) (*postQueryResponse, error) { + rsp, err := c.PostQueryWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostQueryResponse(rsp) +} + +func (c *ClientWithResponses) PostQueryWithResponse(ctx context.Context, params *PostQueryParams, body PostQueryJSONRequestBody) (*postQueryResponse, error) { + rsp, err := c.PostQuery(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostQueryResponse(rsp) +} + +// PostQueryAnalyzeWithBodyWithResponse request with arbitrary body returning *PostQueryAnalyzeResponse +func (c *ClientWithResponses) PostQueryAnalyzeWithBodyWithResponse(ctx context.Context, params *PostQueryAnalyzeParams, contentType string, body io.Reader) (*postQueryAnalyzeResponse, error) { + rsp, err := c.PostQueryAnalyzeWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostQueryAnalyzeResponse(rsp) +} + +func (c *ClientWithResponses) PostQueryAnalyzeWithResponse(ctx context.Context, params *PostQueryAnalyzeParams, body PostQueryAnalyzeJSONRequestBody) (*postQueryAnalyzeResponse, error) { + rsp, err := c.PostQueryAnalyze(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostQueryAnalyzeResponse(rsp) +} + +// PostQueryAstWithBodyWithResponse request with arbitrary body returning *PostQueryAstResponse +func (c *ClientWithResponses) PostQueryAstWithBodyWithResponse(ctx context.Context, params *PostQueryAstParams, contentType string, body io.Reader) (*postQueryAstResponse, error) { + rsp, err := c.PostQueryAstWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostQueryAstResponse(rsp) +} + +func (c *ClientWithResponses) PostQueryAstWithResponse(ctx context.Context, params *PostQueryAstParams, body PostQueryAstJSONRequestBody) (*postQueryAstResponse, error) { + rsp, err := c.PostQueryAst(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostQueryAstResponse(rsp) +} + +// GetQuerySuggestionsWithResponse request returning *GetQuerySuggestionsResponse +func (c *ClientWithResponses) GetQuerySuggestionsWithResponse(ctx context.Context, params *GetQuerySuggestionsParams) (*getQuerySuggestionsResponse, error) { + rsp, err := c.GetQuerySuggestions(ctx, params) + if err != nil { + return nil, err + } + return ParseGetQuerySuggestionsResponse(rsp) +} + +// GetQuerySuggestionsNameWithResponse request returning *GetQuerySuggestionsNameResponse +func (c *ClientWithResponses) GetQuerySuggestionsNameWithResponse(ctx context.Context, name string, params *GetQuerySuggestionsNameParams) (*getQuerySuggestionsNameResponse, error) { + rsp, err := c.GetQuerySuggestionsName(ctx, name, params) + if err != nil { + return nil, err + } + return ParseGetQuerySuggestionsNameResponse(rsp) +} + +// GetReadyWithResponse request returning *GetReadyResponse +func (c *ClientWithResponses) GetReadyWithResponse(ctx context.Context, params *GetReadyParams) (*getReadyResponse, error) { + rsp, err := c.GetReady(ctx, params) + if err != nil { + return nil, err + } + return ParseGetReadyResponse(rsp) +} + +// GetScrapersWithResponse request returning *GetScrapersResponse +func (c *ClientWithResponses) GetScrapersWithResponse(ctx context.Context, params *GetScrapersParams) (*getScrapersResponse, error) { + rsp, err := c.GetScrapers(ctx, params) + if err != nil { + return nil, err + } + return ParseGetScrapersResponse(rsp) +} + +// PostScrapersWithBodyWithResponse request with arbitrary body returning *PostScrapersResponse +func (c *ClientWithResponses) PostScrapersWithBodyWithResponse(ctx context.Context, params *PostScrapersParams, contentType string, body io.Reader) (*postScrapersResponse, error) { + rsp, err := c.PostScrapersWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostScrapersResponse(rsp) +} + +func (c *ClientWithResponses) PostScrapersWithResponse(ctx context.Context, params *PostScrapersParams, body PostScrapersJSONRequestBody) (*postScrapersResponse, error) { + rsp, err := c.PostScrapers(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostScrapersResponse(rsp) +} + +// DeleteScrapersIDWithResponse request returning *DeleteScrapersIDResponse +func (c *ClientWithResponses) DeleteScrapersIDWithResponse(ctx context.Context, scraperTargetID string, params *DeleteScrapersIDParams) (*deleteScrapersIDResponse, error) { + rsp, err := c.DeleteScrapersID(ctx, scraperTargetID, params) + if err != nil { + return nil, err + } + return ParseDeleteScrapersIDResponse(rsp) +} + +// GetScrapersIDWithResponse request returning *GetScrapersIDResponse +func (c *ClientWithResponses) GetScrapersIDWithResponse(ctx context.Context, scraperTargetID string, params *GetScrapersIDParams) (*getScrapersIDResponse, error) { + rsp, err := c.GetScrapersID(ctx, scraperTargetID, params) + if err != nil { + return nil, err + } + return ParseGetScrapersIDResponse(rsp) +} + +// PatchScrapersIDWithBodyWithResponse request with arbitrary body returning *PatchScrapersIDResponse +func (c *ClientWithResponses) PatchScrapersIDWithBodyWithResponse(ctx context.Context, scraperTargetID string, params *PatchScrapersIDParams, contentType string, body io.Reader) (*patchScrapersIDResponse, error) { + rsp, err := c.PatchScrapersIDWithBody(ctx, scraperTargetID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchScrapersIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchScrapersIDWithResponse(ctx context.Context, scraperTargetID string, params *PatchScrapersIDParams, body PatchScrapersIDJSONRequestBody) (*patchScrapersIDResponse, error) { + rsp, err := c.PatchScrapersID(ctx, scraperTargetID, params, body) + if err != nil { + return nil, err + } + return ParsePatchScrapersIDResponse(rsp) +} + +// GetScrapersIDLabelsWithResponse request returning *GetScrapersIDLabelsResponse +func (c *ClientWithResponses) GetScrapersIDLabelsWithResponse(ctx context.Context, scraperTargetID string, params *GetScrapersIDLabelsParams) (*getScrapersIDLabelsResponse, error) { + rsp, err := c.GetScrapersIDLabels(ctx, scraperTargetID, params) + if err != nil { + return nil, err + } + return ParseGetScrapersIDLabelsResponse(rsp) +} + +// PostScrapersIDLabelsWithBodyWithResponse request with arbitrary body returning *PostScrapersIDLabelsResponse +func (c *ClientWithResponses) PostScrapersIDLabelsWithBodyWithResponse(ctx context.Context, scraperTargetID string, params *PostScrapersIDLabelsParams, contentType string, body io.Reader) (*postScrapersIDLabelsResponse, error) { + rsp, err := c.PostScrapersIDLabelsWithBody(ctx, scraperTargetID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostScrapersIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostScrapersIDLabelsWithResponse(ctx context.Context, scraperTargetID string, params *PostScrapersIDLabelsParams, body PostScrapersIDLabelsJSONRequestBody) (*postScrapersIDLabelsResponse, error) { + rsp, err := c.PostScrapersIDLabels(ctx, scraperTargetID, params, body) + if err != nil { + return nil, err + } + return ParsePostScrapersIDLabelsResponse(rsp) +} + +// DeleteScrapersIDLabelsIDWithResponse request returning *DeleteScrapersIDLabelsIDResponse +func (c *ClientWithResponses) DeleteScrapersIDLabelsIDWithResponse(ctx context.Context, scraperTargetID string, labelID string, params *DeleteScrapersIDLabelsIDParams) (*deleteScrapersIDLabelsIDResponse, error) { + rsp, err := c.DeleteScrapersIDLabelsID(ctx, scraperTargetID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteScrapersIDLabelsIDResponse(rsp) +} + +// PatchScrapersIDLabelsIDWithBodyWithResponse request with arbitrary body returning *PatchScrapersIDLabelsIDResponse +func (c *ClientWithResponses) PatchScrapersIDLabelsIDWithBodyWithResponse(ctx context.Context, scraperTargetID string, labelID string, params *PatchScrapersIDLabelsIDParams, contentType string, body io.Reader) (*patchScrapersIDLabelsIDResponse, error) { + rsp, err := c.PatchScrapersIDLabelsIDWithBody(ctx, scraperTargetID, labelID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchScrapersIDLabelsIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchScrapersIDLabelsIDWithResponse(ctx context.Context, scraperTargetID string, labelID string, params *PatchScrapersIDLabelsIDParams, body PatchScrapersIDLabelsIDJSONRequestBody) (*patchScrapersIDLabelsIDResponse, error) { + rsp, err := c.PatchScrapersIDLabelsID(ctx, scraperTargetID, labelID, params, body) + if err != nil { + return nil, err + } + return ParsePatchScrapersIDLabelsIDResponse(rsp) +} + +// GetScrapersIDMembersWithResponse request returning *GetScrapersIDMembersResponse +func (c *ClientWithResponses) GetScrapersIDMembersWithResponse(ctx context.Context, scraperTargetID string, params *GetScrapersIDMembersParams) (*getScrapersIDMembersResponse, error) { + rsp, err := c.GetScrapersIDMembers(ctx, scraperTargetID, params) + if err != nil { + return nil, err + } + return ParseGetScrapersIDMembersResponse(rsp) +} + +// PostScrapersIDMembersWithBodyWithResponse request with arbitrary body returning *PostScrapersIDMembersResponse +func (c *ClientWithResponses) PostScrapersIDMembersWithBodyWithResponse(ctx context.Context, scraperTargetID string, params *PostScrapersIDMembersParams, contentType string, body io.Reader) (*postScrapersIDMembersResponse, error) { + rsp, err := c.PostScrapersIDMembersWithBody(ctx, scraperTargetID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostScrapersIDMembersResponse(rsp) +} + +func (c *ClientWithResponses) PostScrapersIDMembersWithResponse(ctx context.Context, scraperTargetID string, params *PostScrapersIDMembersParams, body PostScrapersIDMembersJSONRequestBody) (*postScrapersIDMembersResponse, error) { + rsp, err := c.PostScrapersIDMembers(ctx, scraperTargetID, params, body) + if err != nil { + return nil, err + } + return ParsePostScrapersIDMembersResponse(rsp) +} + +// DeleteScrapersIDMembersIDWithResponse request returning *DeleteScrapersIDMembersIDResponse +func (c *ClientWithResponses) DeleteScrapersIDMembersIDWithResponse(ctx context.Context, scraperTargetID string, userID string, params *DeleteScrapersIDMembersIDParams) (*deleteScrapersIDMembersIDResponse, error) { + rsp, err := c.DeleteScrapersIDMembersID(ctx, scraperTargetID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteScrapersIDMembersIDResponse(rsp) +} + +// GetScrapersIDOwnersWithResponse request returning *GetScrapersIDOwnersResponse +func (c *ClientWithResponses) GetScrapersIDOwnersWithResponse(ctx context.Context, scraperTargetID string, params *GetScrapersIDOwnersParams) (*getScrapersIDOwnersResponse, error) { + rsp, err := c.GetScrapersIDOwners(ctx, scraperTargetID, params) + if err != nil { + return nil, err + } + return ParseGetScrapersIDOwnersResponse(rsp) +} + +// PostScrapersIDOwnersWithBodyWithResponse request with arbitrary body returning *PostScrapersIDOwnersResponse +func (c *ClientWithResponses) PostScrapersIDOwnersWithBodyWithResponse(ctx context.Context, scraperTargetID string, params *PostScrapersIDOwnersParams, contentType string, body io.Reader) (*postScrapersIDOwnersResponse, error) { + rsp, err := c.PostScrapersIDOwnersWithBody(ctx, scraperTargetID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostScrapersIDOwnersResponse(rsp) +} + +func (c *ClientWithResponses) PostScrapersIDOwnersWithResponse(ctx context.Context, scraperTargetID string, params *PostScrapersIDOwnersParams, body PostScrapersIDOwnersJSONRequestBody) (*postScrapersIDOwnersResponse, error) { + rsp, err := c.PostScrapersIDOwners(ctx, scraperTargetID, params, body) + if err != nil { + return nil, err + } + return ParsePostScrapersIDOwnersResponse(rsp) +} + +// DeleteScrapersIDOwnersIDWithResponse request returning *DeleteScrapersIDOwnersIDResponse +func (c *ClientWithResponses) DeleteScrapersIDOwnersIDWithResponse(ctx context.Context, scraperTargetID string, userID string, params *DeleteScrapersIDOwnersIDParams) (*deleteScrapersIDOwnersIDResponse, error) { + rsp, err := c.DeleteScrapersIDOwnersID(ctx, scraperTargetID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteScrapersIDOwnersIDResponse(rsp) +} + +// GetSetupWithResponse request returning *GetSetupResponse +func (c *ClientWithResponses) GetSetupWithResponse(ctx context.Context, params *GetSetupParams) (*getSetupResponse, error) { + rsp, err := c.GetSetup(ctx, params) + if err != nil { + return nil, err + } + return ParseGetSetupResponse(rsp) +} + +// PostSetupWithBodyWithResponse request with arbitrary body returning *PostSetupResponse +func (c *ClientWithResponses) PostSetupWithBodyWithResponse(ctx context.Context, params *PostSetupParams, contentType string, body io.Reader) (*postSetupResponse, error) { + rsp, err := c.PostSetupWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostSetupResponse(rsp) +} + +func (c *ClientWithResponses) PostSetupWithResponse(ctx context.Context, params *PostSetupParams, body PostSetupJSONRequestBody) (*postSetupResponse, error) { + rsp, err := c.PostSetup(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostSetupResponse(rsp) +} + +// PostSigninWithResponse request returning *PostSigninResponse +func (c *ClientWithResponses) PostSigninWithResponse(ctx context.Context, params *PostSigninParams) (*postSigninResponse, error) { + rsp, err := c.PostSignin(ctx, params) + if err != nil { + return nil, err + } + return ParsePostSigninResponse(rsp) +} + +// PostSignoutWithResponse request returning *PostSignoutResponse +func (c *ClientWithResponses) PostSignoutWithResponse(ctx context.Context, params *PostSignoutParams) (*postSignoutResponse, error) { + rsp, err := c.PostSignout(ctx, params) + if err != nil { + return nil, err + } + return ParsePostSignoutResponse(rsp) +} + +// GetSourcesWithResponse request returning *GetSourcesResponse +func (c *ClientWithResponses) GetSourcesWithResponse(ctx context.Context, params *GetSourcesParams) (*getSourcesResponse, error) { + rsp, err := c.GetSources(ctx, params) + if err != nil { + return nil, err + } + return ParseGetSourcesResponse(rsp) +} + +// PostSourcesWithBodyWithResponse request with arbitrary body returning *PostSourcesResponse +func (c *ClientWithResponses) PostSourcesWithBodyWithResponse(ctx context.Context, params *PostSourcesParams, contentType string, body io.Reader) (*postSourcesResponse, error) { + rsp, err := c.PostSourcesWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostSourcesResponse(rsp) +} + +func (c *ClientWithResponses) PostSourcesWithResponse(ctx context.Context, params *PostSourcesParams, body PostSourcesJSONRequestBody) (*postSourcesResponse, error) { + rsp, err := c.PostSources(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostSourcesResponse(rsp) +} + +// DeleteSourcesIDWithResponse request returning *DeleteSourcesIDResponse +func (c *ClientWithResponses) DeleteSourcesIDWithResponse(ctx context.Context, sourceID string, params *DeleteSourcesIDParams) (*deleteSourcesIDResponse, error) { + rsp, err := c.DeleteSourcesID(ctx, sourceID, params) + if err != nil { + return nil, err + } + return ParseDeleteSourcesIDResponse(rsp) +} + +// GetSourcesIDWithResponse request returning *GetSourcesIDResponse +func (c *ClientWithResponses) GetSourcesIDWithResponse(ctx context.Context, sourceID string, params *GetSourcesIDParams) (*getSourcesIDResponse, error) { + rsp, err := c.GetSourcesID(ctx, sourceID, params) + if err != nil { + return nil, err + } + return ParseGetSourcesIDResponse(rsp) +} + +// PatchSourcesIDWithBodyWithResponse request with arbitrary body returning *PatchSourcesIDResponse +func (c *ClientWithResponses) PatchSourcesIDWithBodyWithResponse(ctx context.Context, sourceID string, params *PatchSourcesIDParams, contentType string, body io.Reader) (*patchSourcesIDResponse, error) { + rsp, err := c.PatchSourcesIDWithBody(ctx, sourceID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchSourcesIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchSourcesIDWithResponse(ctx context.Context, sourceID string, params *PatchSourcesIDParams, body PatchSourcesIDJSONRequestBody) (*patchSourcesIDResponse, error) { + rsp, err := c.PatchSourcesID(ctx, sourceID, params, body) + if err != nil { + return nil, err + } + return ParsePatchSourcesIDResponse(rsp) +} + +// GetSourcesIDBucketsWithResponse request returning *GetSourcesIDBucketsResponse +func (c *ClientWithResponses) GetSourcesIDBucketsWithResponse(ctx context.Context, sourceID string, params *GetSourcesIDBucketsParams) (*getSourcesIDBucketsResponse, error) { + rsp, err := c.GetSourcesIDBuckets(ctx, sourceID, params) + if err != nil { + return nil, err + } + return ParseGetSourcesIDBucketsResponse(rsp) +} + +// GetSourcesIDHealthWithResponse request returning *GetSourcesIDHealthResponse +func (c *ClientWithResponses) GetSourcesIDHealthWithResponse(ctx context.Context, sourceID string, params *GetSourcesIDHealthParams) (*getSourcesIDHealthResponse, error) { + rsp, err := c.GetSourcesIDHealth(ctx, sourceID, params) + if err != nil { + return nil, err + } + return ParseGetSourcesIDHealthResponse(rsp) +} + +// GetTasksWithResponse request returning *GetTasksResponse +func (c *ClientWithResponses) GetTasksWithResponse(ctx context.Context, params *GetTasksParams) (*getTasksResponse, error) { + rsp, err := c.GetTasks(ctx, params) + if err != nil { + return nil, err + } + return ParseGetTasksResponse(rsp) +} + +// PostTasksWithBodyWithResponse request with arbitrary body returning *PostTasksResponse +func (c *ClientWithResponses) PostTasksWithBodyWithResponse(ctx context.Context, params *PostTasksParams, contentType string, body io.Reader) (*postTasksResponse, error) { + rsp, err := c.PostTasksWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostTasksResponse(rsp) +} + +func (c *ClientWithResponses) PostTasksWithResponse(ctx context.Context, params *PostTasksParams, body PostTasksJSONRequestBody) (*postTasksResponse, error) { + rsp, err := c.PostTasks(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostTasksResponse(rsp) +} + +// DeleteTasksIDWithResponse request returning *DeleteTasksIDResponse +func (c *ClientWithResponses) DeleteTasksIDWithResponse(ctx context.Context, taskID string, params *DeleteTasksIDParams) (*deleteTasksIDResponse, error) { + rsp, err := c.DeleteTasksID(ctx, taskID, params) + if err != nil { + return nil, err + } + return ParseDeleteTasksIDResponse(rsp) +} + +// GetTasksIDWithResponse request returning *GetTasksIDResponse +func (c *ClientWithResponses) GetTasksIDWithResponse(ctx context.Context, taskID string, params *GetTasksIDParams) (*getTasksIDResponse, error) { + rsp, err := c.GetTasksID(ctx, taskID, params) + if err != nil { + return nil, err + } + return ParseGetTasksIDResponse(rsp) +} + +// PatchTasksIDWithBodyWithResponse request with arbitrary body returning *PatchTasksIDResponse +func (c *ClientWithResponses) PatchTasksIDWithBodyWithResponse(ctx context.Context, taskID string, params *PatchTasksIDParams, contentType string, body io.Reader) (*patchTasksIDResponse, error) { + rsp, err := c.PatchTasksIDWithBody(ctx, taskID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchTasksIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchTasksIDWithResponse(ctx context.Context, taskID string, params *PatchTasksIDParams, body PatchTasksIDJSONRequestBody) (*patchTasksIDResponse, error) { + rsp, err := c.PatchTasksID(ctx, taskID, params, body) + if err != nil { + return nil, err + } + return ParsePatchTasksIDResponse(rsp) +} + +// GetTasksIDLabelsWithResponse request returning *GetTasksIDLabelsResponse +func (c *ClientWithResponses) GetTasksIDLabelsWithResponse(ctx context.Context, taskID string, params *GetTasksIDLabelsParams) (*getTasksIDLabelsResponse, error) { + rsp, err := c.GetTasksIDLabels(ctx, taskID, params) + if err != nil { + return nil, err + } + return ParseGetTasksIDLabelsResponse(rsp) +} + +// PostTasksIDLabelsWithBodyWithResponse request with arbitrary body returning *PostTasksIDLabelsResponse +func (c *ClientWithResponses) PostTasksIDLabelsWithBodyWithResponse(ctx context.Context, taskID string, params *PostTasksIDLabelsParams, contentType string, body io.Reader) (*postTasksIDLabelsResponse, error) { + rsp, err := c.PostTasksIDLabelsWithBody(ctx, taskID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostTasksIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostTasksIDLabelsWithResponse(ctx context.Context, taskID string, params *PostTasksIDLabelsParams, body PostTasksIDLabelsJSONRequestBody) (*postTasksIDLabelsResponse, error) { + rsp, err := c.PostTasksIDLabels(ctx, taskID, params, body) + if err != nil { + return nil, err + } + return ParsePostTasksIDLabelsResponse(rsp) +} + +// DeleteTasksIDLabelsIDWithResponse request returning *DeleteTasksIDLabelsIDResponse +func (c *ClientWithResponses) DeleteTasksIDLabelsIDWithResponse(ctx context.Context, taskID string, labelID string, params *DeleteTasksIDLabelsIDParams) (*deleteTasksIDLabelsIDResponse, error) { + rsp, err := c.DeleteTasksIDLabelsID(ctx, taskID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteTasksIDLabelsIDResponse(rsp) +} + +// GetTasksIDLogsWithResponse request returning *GetTasksIDLogsResponse +func (c *ClientWithResponses) GetTasksIDLogsWithResponse(ctx context.Context, taskID string, params *GetTasksIDLogsParams) (*getTasksIDLogsResponse, error) { + rsp, err := c.GetTasksIDLogs(ctx, taskID, params) + if err != nil { + return nil, err + } + return ParseGetTasksIDLogsResponse(rsp) +} + +// GetTasksIDMembersWithResponse request returning *GetTasksIDMembersResponse +func (c *ClientWithResponses) GetTasksIDMembersWithResponse(ctx context.Context, taskID string, params *GetTasksIDMembersParams) (*getTasksIDMembersResponse, error) { + rsp, err := c.GetTasksIDMembers(ctx, taskID, params) + if err != nil { + return nil, err + } + return ParseGetTasksIDMembersResponse(rsp) +} + +// PostTasksIDMembersWithBodyWithResponse request with arbitrary body returning *PostTasksIDMembersResponse +func (c *ClientWithResponses) PostTasksIDMembersWithBodyWithResponse(ctx context.Context, taskID string, params *PostTasksIDMembersParams, contentType string, body io.Reader) (*postTasksIDMembersResponse, error) { + rsp, err := c.PostTasksIDMembersWithBody(ctx, taskID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostTasksIDMembersResponse(rsp) +} + +func (c *ClientWithResponses) PostTasksIDMembersWithResponse(ctx context.Context, taskID string, params *PostTasksIDMembersParams, body PostTasksIDMembersJSONRequestBody) (*postTasksIDMembersResponse, error) { + rsp, err := c.PostTasksIDMembers(ctx, taskID, params, body) + if err != nil { + return nil, err + } + return ParsePostTasksIDMembersResponse(rsp) +} + +// DeleteTasksIDMembersIDWithResponse request returning *DeleteTasksIDMembersIDResponse +func (c *ClientWithResponses) DeleteTasksIDMembersIDWithResponse(ctx context.Context, taskID string, userID string, params *DeleteTasksIDMembersIDParams) (*deleteTasksIDMembersIDResponse, error) { + rsp, err := c.DeleteTasksIDMembersID(ctx, taskID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteTasksIDMembersIDResponse(rsp) +} + +// GetTasksIDOwnersWithResponse request returning *GetTasksIDOwnersResponse +func (c *ClientWithResponses) GetTasksIDOwnersWithResponse(ctx context.Context, taskID string, params *GetTasksIDOwnersParams) (*getTasksIDOwnersResponse, error) { + rsp, err := c.GetTasksIDOwners(ctx, taskID, params) + if err != nil { + return nil, err + } + return ParseGetTasksIDOwnersResponse(rsp) +} + +// PostTasksIDOwnersWithBodyWithResponse request with arbitrary body returning *PostTasksIDOwnersResponse +func (c *ClientWithResponses) PostTasksIDOwnersWithBodyWithResponse(ctx context.Context, taskID string, params *PostTasksIDOwnersParams, contentType string, body io.Reader) (*postTasksIDOwnersResponse, error) { + rsp, err := c.PostTasksIDOwnersWithBody(ctx, taskID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostTasksIDOwnersResponse(rsp) +} + +func (c *ClientWithResponses) PostTasksIDOwnersWithResponse(ctx context.Context, taskID string, params *PostTasksIDOwnersParams, body PostTasksIDOwnersJSONRequestBody) (*postTasksIDOwnersResponse, error) { + rsp, err := c.PostTasksIDOwners(ctx, taskID, params, body) + if err != nil { + return nil, err + } + return ParsePostTasksIDOwnersResponse(rsp) +} + +// DeleteTasksIDOwnersIDWithResponse request returning *DeleteTasksIDOwnersIDResponse +func (c *ClientWithResponses) DeleteTasksIDOwnersIDWithResponse(ctx context.Context, taskID string, userID string, params *DeleteTasksIDOwnersIDParams) (*deleteTasksIDOwnersIDResponse, error) { + rsp, err := c.DeleteTasksIDOwnersID(ctx, taskID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteTasksIDOwnersIDResponse(rsp) +} + +// GetTasksIDRunsWithResponse request returning *GetTasksIDRunsResponse +func (c *ClientWithResponses) GetTasksIDRunsWithResponse(ctx context.Context, taskID string, params *GetTasksIDRunsParams) (*getTasksIDRunsResponse, error) { + rsp, err := c.GetTasksIDRuns(ctx, taskID, params) + if err != nil { + return nil, err + } + return ParseGetTasksIDRunsResponse(rsp) +} + +// PostTasksIDRunsWithBodyWithResponse request with arbitrary body returning *PostTasksIDRunsResponse +func (c *ClientWithResponses) PostTasksIDRunsWithBodyWithResponse(ctx context.Context, taskID string, params *PostTasksIDRunsParams, contentType string, body io.Reader) (*postTasksIDRunsResponse, error) { + rsp, err := c.PostTasksIDRunsWithBody(ctx, taskID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostTasksIDRunsResponse(rsp) +} + +func (c *ClientWithResponses) PostTasksIDRunsWithResponse(ctx context.Context, taskID string, params *PostTasksIDRunsParams, body PostTasksIDRunsJSONRequestBody) (*postTasksIDRunsResponse, error) { + rsp, err := c.PostTasksIDRuns(ctx, taskID, params, body) + if err != nil { + return nil, err + } + return ParsePostTasksIDRunsResponse(rsp) +} + +// DeleteTasksIDRunsIDWithResponse request returning *DeleteTasksIDRunsIDResponse +func (c *ClientWithResponses) DeleteTasksIDRunsIDWithResponse(ctx context.Context, taskID string, runID string, params *DeleteTasksIDRunsIDParams) (*deleteTasksIDRunsIDResponse, error) { + rsp, err := c.DeleteTasksIDRunsID(ctx, taskID, runID, params) + if err != nil { + return nil, err + } + return ParseDeleteTasksIDRunsIDResponse(rsp) +} + +// GetTasksIDRunsIDWithResponse request returning *GetTasksIDRunsIDResponse +func (c *ClientWithResponses) GetTasksIDRunsIDWithResponse(ctx context.Context, taskID string, runID string, params *GetTasksIDRunsIDParams) (*getTasksIDRunsIDResponse, error) { + rsp, err := c.GetTasksIDRunsID(ctx, taskID, runID, params) + if err != nil { + return nil, err + } + return ParseGetTasksIDRunsIDResponse(rsp) +} + +// GetTasksIDRunsIDLogsWithResponse request returning *GetTasksIDRunsIDLogsResponse +func (c *ClientWithResponses) GetTasksIDRunsIDLogsWithResponse(ctx context.Context, taskID string, runID string, params *GetTasksIDRunsIDLogsParams) (*getTasksIDRunsIDLogsResponse, error) { + rsp, err := c.GetTasksIDRunsIDLogs(ctx, taskID, runID, params) + if err != nil { + return nil, err + } + return ParseGetTasksIDRunsIDLogsResponse(rsp) +} + +// PostTasksIDRunsIDRetryWithResponse request returning *PostTasksIDRunsIDRetryResponse +func (c *ClientWithResponses) PostTasksIDRunsIDRetryWithResponse(ctx context.Context, taskID string, runID string, params *PostTasksIDRunsIDRetryParams) (*postTasksIDRunsIDRetryResponse, error) { + rsp, err := c.PostTasksIDRunsIDRetry(ctx, taskID, runID, params) + if err != nil { + return nil, err + } + return ParsePostTasksIDRunsIDRetryResponse(rsp) +} + +// GetTelegrafPluginsWithResponse request returning *GetTelegrafPluginsResponse +func (c *ClientWithResponses) GetTelegrafPluginsWithResponse(ctx context.Context, params *GetTelegrafPluginsParams) (*getTelegrafPluginsResponse, error) { + rsp, err := c.GetTelegrafPlugins(ctx, params) + if err != nil { + return nil, err + } + return ParseGetTelegrafPluginsResponse(rsp) +} + +// GetTelegrafsWithResponse request returning *GetTelegrafsResponse +func (c *ClientWithResponses) GetTelegrafsWithResponse(ctx context.Context, params *GetTelegrafsParams) (*getTelegrafsResponse, error) { + rsp, err := c.GetTelegrafs(ctx, params) + if err != nil { + return nil, err + } + return ParseGetTelegrafsResponse(rsp) +} + +// PostTelegrafsWithBodyWithResponse request with arbitrary body returning *PostTelegrafsResponse +func (c *ClientWithResponses) PostTelegrafsWithBodyWithResponse(ctx context.Context, params *PostTelegrafsParams, contentType string, body io.Reader) (*postTelegrafsResponse, error) { + rsp, err := c.PostTelegrafsWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostTelegrafsResponse(rsp) +} + +func (c *ClientWithResponses) PostTelegrafsWithResponse(ctx context.Context, params *PostTelegrafsParams, body PostTelegrafsJSONRequestBody) (*postTelegrafsResponse, error) { + rsp, err := c.PostTelegrafs(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostTelegrafsResponse(rsp) +} + +// DeleteTelegrafsIDWithResponse request returning *DeleteTelegrafsIDResponse +func (c *ClientWithResponses) DeleteTelegrafsIDWithResponse(ctx context.Context, telegrafID string, params *DeleteTelegrafsIDParams) (*deleteTelegrafsIDResponse, error) { + rsp, err := c.DeleteTelegrafsID(ctx, telegrafID, params) + if err != nil { + return nil, err + } + return ParseDeleteTelegrafsIDResponse(rsp) +} + +// GetTelegrafsIDWithResponse request returning *GetTelegrafsIDResponse +func (c *ClientWithResponses) GetTelegrafsIDWithResponse(ctx context.Context, telegrafID string, params *GetTelegrafsIDParams) (*getTelegrafsIDResponse, error) { + rsp, err := c.GetTelegrafsID(ctx, telegrafID, params) + if err != nil { + return nil, err + } + return ParseGetTelegrafsIDResponse(rsp) +} + +// PutTelegrafsIDWithBodyWithResponse request with arbitrary body returning *PutTelegrafsIDResponse +func (c *ClientWithResponses) PutTelegrafsIDWithBodyWithResponse(ctx context.Context, telegrafID string, params *PutTelegrafsIDParams, contentType string, body io.Reader) (*putTelegrafsIDResponse, error) { + rsp, err := c.PutTelegrafsIDWithBody(ctx, telegrafID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePutTelegrafsIDResponse(rsp) +} + +func (c *ClientWithResponses) PutTelegrafsIDWithResponse(ctx context.Context, telegrafID string, params *PutTelegrafsIDParams, body PutTelegrafsIDJSONRequestBody) (*putTelegrafsIDResponse, error) { + rsp, err := c.PutTelegrafsID(ctx, telegrafID, params, body) + if err != nil { + return nil, err + } + return ParsePutTelegrafsIDResponse(rsp) +} + +// GetTelegrafsIDLabelsWithResponse request returning *GetTelegrafsIDLabelsResponse +func (c *ClientWithResponses) GetTelegrafsIDLabelsWithResponse(ctx context.Context, telegrafID string, params *GetTelegrafsIDLabelsParams) (*getTelegrafsIDLabelsResponse, error) { + rsp, err := c.GetTelegrafsIDLabels(ctx, telegrafID, params) + if err != nil { + return nil, err + } + return ParseGetTelegrafsIDLabelsResponse(rsp) +} + +// PostTelegrafsIDLabelsWithBodyWithResponse request with arbitrary body returning *PostTelegrafsIDLabelsResponse +func (c *ClientWithResponses) PostTelegrafsIDLabelsWithBodyWithResponse(ctx context.Context, telegrafID string, params *PostTelegrafsIDLabelsParams, contentType string, body io.Reader) (*postTelegrafsIDLabelsResponse, error) { + rsp, err := c.PostTelegrafsIDLabelsWithBody(ctx, telegrafID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostTelegrafsIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostTelegrafsIDLabelsWithResponse(ctx context.Context, telegrafID string, params *PostTelegrafsIDLabelsParams, body PostTelegrafsIDLabelsJSONRequestBody) (*postTelegrafsIDLabelsResponse, error) { + rsp, err := c.PostTelegrafsIDLabels(ctx, telegrafID, params, body) + if err != nil { + return nil, err + } + return ParsePostTelegrafsIDLabelsResponse(rsp) +} + +// DeleteTelegrafsIDLabelsIDWithResponse request returning *DeleteTelegrafsIDLabelsIDResponse +func (c *ClientWithResponses) DeleteTelegrafsIDLabelsIDWithResponse(ctx context.Context, telegrafID string, labelID string, params *DeleteTelegrafsIDLabelsIDParams) (*deleteTelegrafsIDLabelsIDResponse, error) { + rsp, err := c.DeleteTelegrafsIDLabelsID(ctx, telegrafID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteTelegrafsIDLabelsIDResponse(rsp) +} + +// GetTelegrafsIDMembersWithResponse request returning *GetTelegrafsIDMembersResponse +func (c *ClientWithResponses) GetTelegrafsIDMembersWithResponse(ctx context.Context, telegrafID string, params *GetTelegrafsIDMembersParams) (*getTelegrafsIDMembersResponse, error) { + rsp, err := c.GetTelegrafsIDMembers(ctx, telegrafID, params) + if err != nil { + return nil, err + } + return ParseGetTelegrafsIDMembersResponse(rsp) +} + +// PostTelegrafsIDMembersWithBodyWithResponse request with arbitrary body returning *PostTelegrafsIDMembersResponse +func (c *ClientWithResponses) PostTelegrafsIDMembersWithBodyWithResponse(ctx context.Context, telegrafID string, params *PostTelegrafsIDMembersParams, contentType string, body io.Reader) (*postTelegrafsIDMembersResponse, error) { + rsp, err := c.PostTelegrafsIDMembersWithBody(ctx, telegrafID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostTelegrafsIDMembersResponse(rsp) +} + +func (c *ClientWithResponses) PostTelegrafsIDMembersWithResponse(ctx context.Context, telegrafID string, params *PostTelegrafsIDMembersParams, body PostTelegrafsIDMembersJSONRequestBody) (*postTelegrafsIDMembersResponse, error) { + rsp, err := c.PostTelegrafsIDMembers(ctx, telegrafID, params, body) + if err != nil { + return nil, err + } + return ParsePostTelegrafsIDMembersResponse(rsp) +} + +// DeleteTelegrafsIDMembersIDWithResponse request returning *DeleteTelegrafsIDMembersIDResponse +func (c *ClientWithResponses) DeleteTelegrafsIDMembersIDWithResponse(ctx context.Context, telegrafID string, userID string, params *DeleteTelegrafsIDMembersIDParams) (*deleteTelegrafsIDMembersIDResponse, error) { + rsp, err := c.DeleteTelegrafsIDMembersID(ctx, telegrafID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteTelegrafsIDMembersIDResponse(rsp) +} + +// GetTelegrafsIDOwnersWithResponse request returning *GetTelegrafsIDOwnersResponse +func (c *ClientWithResponses) GetTelegrafsIDOwnersWithResponse(ctx context.Context, telegrafID string, params *GetTelegrafsIDOwnersParams) (*getTelegrafsIDOwnersResponse, error) { + rsp, err := c.GetTelegrafsIDOwners(ctx, telegrafID, params) + if err != nil { + return nil, err + } + return ParseGetTelegrafsIDOwnersResponse(rsp) +} + +// PostTelegrafsIDOwnersWithBodyWithResponse request with arbitrary body returning *PostTelegrafsIDOwnersResponse +func (c *ClientWithResponses) PostTelegrafsIDOwnersWithBodyWithResponse(ctx context.Context, telegrafID string, params *PostTelegrafsIDOwnersParams, contentType string, body io.Reader) (*postTelegrafsIDOwnersResponse, error) { + rsp, err := c.PostTelegrafsIDOwnersWithBody(ctx, telegrafID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostTelegrafsIDOwnersResponse(rsp) +} + +func (c *ClientWithResponses) PostTelegrafsIDOwnersWithResponse(ctx context.Context, telegrafID string, params *PostTelegrafsIDOwnersParams, body PostTelegrafsIDOwnersJSONRequestBody) (*postTelegrafsIDOwnersResponse, error) { + rsp, err := c.PostTelegrafsIDOwners(ctx, telegrafID, params, body) + if err != nil { + return nil, err + } + return ParsePostTelegrafsIDOwnersResponse(rsp) +} + +// DeleteTelegrafsIDOwnersIDWithResponse request returning *DeleteTelegrafsIDOwnersIDResponse +func (c *ClientWithResponses) DeleteTelegrafsIDOwnersIDWithResponse(ctx context.Context, telegrafID string, userID string, params *DeleteTelegrafsIDOwnersIDParams) (*deleteTelegrafsIDOwnersIDResponse, error) { + rsp, err := c.DeleteTelegrafsIDOwnersID(ctx, telegrafID, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteTelegrafsIDOwnersIDResponse(rsp) +} + +// GetUsersWithResponse request returning *GetUsersResponse +func (c *ClientWithResponses) GetUsersWithResponse(ctx context.Context, params *GetUsersParams) (*getUsersResponse, error) { + rsp, err := c.GetUsers(ctx, params) + if err != nil { + return nil, err + } + return ParseGetUsersResponse(rsp) +} + +// PostUsersWithBodyWithResponse request with arbitrary body returning *PostUsersResponse +func (c *ClientWithResponses) PostUsersWithBodyWithResponse(ctx context.Context, params *PostUsersParams, contentType string, body io.Reader) (*postUsersResponse, error) { + rsp, err := c.PostUsersWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostUsersResponse(rsp) +} + +func (c *ClientWithResponses) PostUsersWithResponse(ctx context.Context, params *PostUsersParams, body PostUsersJSONRequestBody) (*postUsersResponse, error) { + rsp, err := c.PostUsers(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostUsersResponse(rsp) +} + +// DeleteUsersIDWithResponse request returning *DeleteUsersIDResponse +func (c *ClientWithResponses) DeleteUsersIDWithResponse(ctx context.Context, userID string, params *DeleteUsersIDParams) (*deleteUsersIDResponse, error) { + rsp, err := c.DeleteUsersID(ctx, userID, params) + if err != nil { + return nil, err + } + return ParseDeleteUsersIDResponse(rsp) +} + +// GetUsersIDWithResponse request returning *GetUsersIDResponse +func (c *ClientWithResponses) GetUsersIDWithResponse(ctx context.Context, userID string, params *GetUsersIDParams) (*getUsersIDResponse, error) { + rsp, err := c.GetUsersID(ctx, userID, params) + if err != nil { + return nil, err + } + return ParseGetUsersIDResponse(rsp) +} + +// PatchUsersIDWithBodyWithResponse request with arbitrary body returning *PatchUsersIDResponse +func (c *ClientWithResponses) PatchUsersIDWithBodyWithResponse(ctx context.Context, userID string, params *PatchUsersIDParams, contentType string, body io.Reader) (*patchUsersIDResponse, error) { + rsp, err := c.PatchUsersIDWithBody(ctx, userID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchUsersIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchUsersIDWithResponse(ctx context.Context, userID string, params *PatchUsersIDParams, body PatchUsersIDJSONRequestBody) (*patchUsersIDResponse, error) { + rsp, err := c.PatchUsersID(ctx, userID, params, body) + if err != nil { + return nil, err + } + return ParsePatchUsersIDResponse(rsp) +} + +// GetUsersIDLogsWithResponse request returning *GetUsersIDLogsResponse +func (c *ClientWithResponses) GetUsersIDLogsWithResponse(ctx context.Context, userID string, params *GetUsersIDLogsParams) (*getUsersIDLogsResponse, error) { + rsp, err := c.GetUsersIDLogs(ctx, userID, params) + if err != nil { + return nil, err + } + return ParseGetUsersIDLogsResponse(rsp) +} + +// PutUsersIDPasswordWithBodyWithResponse request with arbitrary body returning *PutUsersIDPasswordResponse +func (c *ClientWithResponses) PutUsersIDPasswordWithBodyWithResponse(ctx context.Context, userID string, params *PutUsersIDPasswordParams, contentType string, body io.Reader) (*putUsersIDPasswordResponse, error) { + rsp, err := c.PutUsersIDPasswordWithBody(ctx, userID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePutUsersIDPasswordResponse(rsp) +} + +func (c *ClientWithResponses) PutUsersIDPasswordWithResponse(ctx context.Context, userID string, params *PutUsersIDPasswordParams, body PutUsersIDPasswordJSONRequestBody) (*putUsersIDPasswordResponse, error) { + rsp, err := c.PutUsersIDPassword(ctx, userID, params, body) + if err != nil { + return nil, err + } + return ParsePutUsersIDPasswordResponse(rsp) +} + +// GetVariablesWithResponse request returning *GetVariablesResponse +func (c *ClientWithResponses) GetVariablesWithResponse(ctx context.Context, params *GetVariablesParams) (*getVariablesResponse, error) { + rsp, err := c.GetVariables(ctx, params) + if err != nil { + return nil, err + } + return ParseGetVariablesResponse(rsp) +} + +// PostVariablesWithBodyWithResponse request with arbitrary body returning *PostVariablesResponse +func (c *ClientWithResponses) PostVariablesWithBodyWithResponse(ctx context.Context, params *PostVariablesParams, contentType string, body io.Reader) (*postVariablesResponse, error) { + rsp, err := c.PostVariablesWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostVariablesResponse(rsp) +} + +func (c *ClientWithResponses) PostVariablesWithResponse(ctx context.Context, params *PostVariablesParams, body PostVariablesJSONRequestBody) (*postVariablesResponse, error) { + rsp, err := c.PostVariables(ctx, params, body) + if err != nil { + return nil, err + } + return ParsePostVariablesResponse(rsp) +} + +// DeleteVariablesIDWithResponse request returning *DeleteVariablesIDResponse +func (c *ClientWithResponses) DeleteVariablesIDWithResponse(ctx context.Context, variableID string, params *DeleteVariablesIDParams) (*deleteVariablesIDResponse, error) { + rsp, err := c.DeleteVariablesID(ctx, variableID, params) + if err != nil { + return nil, err + } + return ParseDeleteVariablesIDResponse(rsp) +} + +// GetVariablesIDWithResponse request returning *GetVariablesIDResponse +func (c *ClientWithResponses) GetVariablesIDWithResponse(ctx context.Context, variableID string, params *GetVariablesIDParams) (*getVariablesIDResponse, error) { + rsp, err := c.GetVariablesID(ctx, variableID, params) + if err != nil { + return nil, err + } + return ParseGetVariablesIDResponse(rsp) +} + +// PatchVariablesIDWithBodyWithResponse request with arbitrary body returning *PatchVariablesIDResponse +func (c *ClientWithResponses) PatchVariablesIDWithBodyWithResponse(ctx context.Context, variableID string, params *PatchVariablesIDParams, contentType string, body io.Reader) (*patchVariablesIDResponse, error) { + rsp, err := c.PatchVariablesIDWithBody(ctx, variableID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePatchVariablesIDResponse(rsp) +} + +func (c *ClientWithResponses) PatchVariablesIDWithResponse(ctx context.Context, variableID string, params *PatchVariablesIDParams, body PatchVariablesIDJSONRequestBody) (*patchVariablesIDResponse, error) { + rsp, err := c.PatchVariablesID(ctx, variableID, params, body) + if err != nil { + return nil, err + } + return ParsePatchVariablesIDResponse(rsp) +} + +// PutVariablesIDWithBodyWithResponse request with arbitrary body returning *PutVariablesIDResponse +func (c *ClientWithResponses) PutVariablesIDWithBodyWithResponse(ctx context.Context, variableID string, params *PutVariablesIDParams, contentType string, body io.Reader) (*putVariablesIDResponse, error) { + rsp, err := c.PutVariablesIDWithBody(ctx, variableID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePutVariablesIDResponse(rsp) +} + +func (c *ClientWithResponses) PutVariablesIDWithResponse(ctx context.Context, variableID string, params *PutVariablesIDParams, body PutVariablesIDJSONRequestBody) (*putVariablesIDResponse, error) { + rsp, err := c.PutVariablesID(ctx, variableID, params, body) + if err != nil { + return nil, err + } + return ParsePutVariablesIDResponse(rsp) +} + +// GetVariablesIDLabelsWithResponse request returning *GetVariablesIDLabelsResponse +func (c *ClientWithResponses) GetVariablesIDLabelsWithResponse(ctx context.Context, variableID string, params *GetVariablesIDLabelsParams) (*getVariablesIDLabelsResponse, error) { + rsp, err := c.GetVariablesIDLabels(ctx, variableID, params) + if err != nil { + return nil, err + } + return ParseGetVariablesIDLabelsResponse(rsp) +} + +// PostVariablesIDLabelsWithBodyWithResponse request with arbitrary body returning *PostVariablesIDLabelsResponse +func (c *ClientWithResponses) PostVariablesIDLabelsWithBodyWithResponse(ctx context.Context, variableID string, params *PostVariablesIDLabelsParams, contentType string, body io.Reader) (*postVariablesIDLabelsResponse, error) { + rsp, err := c.PostVariablesIDLabelsWithBody(ctx, variableID, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostVariablesIDLabelsResponse(rsp) +} + +func (c *ClientWithResponses) PostVariablesIDLabelsWithResponse(ctx context.Context, variableID string, params *PostVariablesIDLabelsParams, body PostVariablesIDLabelsJSONRequestBody) (*postVariablesIDLabelsResponse, error) { + rsp, err := c.PostVariablesIDLabels(ctx, variableID, params, body) + if err != nil { + return nil, err + } + return ParsePostVariablesIDLabelsResponse(rsp) +} + +// DeleteVariablesIDLabelsIDWithResponse request returning *DeleteVariablesIDLabelsIDResponse +func (c *ClientWithResponses) DeleteVariablesIDLabelsIDWithResponse(ctx context.Context, variableID string, labelID string, params *DeleteVariablesIDLabelsIDParams) (*deleteVariablesIDLabelsIDResponse, error) { + rsp, err := c.DeleteVariablesIDLabelsID(ctx, variableID, labelID, params) + if err != nil { + return nil, err + } + return ParseDeleteVariablesIDLabelsIDResponse(rsp) +} + +// PostWriteWithBodyWithResponse request with arbitrary body returning *PostWriteResponse +func (c *ClientWithResponses) PostWriteWithBodyWithResponse(ctx context.Context, params *PostWriteParams, contentType string, body io.Reader) (*postWriteResponse, error) { + rsp, err := c.PostWriteWithBody(ctx, params, contentType, body) + if err != nil { + return nil, err + } + return ParsePostWriteResponse(rsp) +} + +// ParseGetRoutesResponse parses an HTTP response from a GetRoutesWithResponse call +func ParseGetRoutesResponse(rsp *http.Response) (*getRoutesResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getRoutesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Routes + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetAuthorizationsResponse parses an HTTP response from a GetAuthorizationsWithResponse call +func ParseGetAuthorizationsResponse(rsp *http.Response) (*getAuthorizationsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getAuthorizationsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Authorizations + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostAuthorizationsResponse parses an HTTP response from a PostAuthorizationsWithResponse call +func ParsePostAuthorizationsResponse(rsp *http.Response) (*postAuthorizationsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postAuthorizationsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Authorization + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteAuthorizationsIDResponse parses an HTTP response from a DeleteAuthorizationsIDWithResponse call +func ParseDeleteAuthorizationsIDResponse(rsp *http.Response) (*deleteAuthorizationsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteAuthorizationsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetAuthorizationsIDResponse parses an HTTP response from a GetAuthorizationsIDWithResponse call +func ParseGetAuthorizationsIDResponse(rsp *http.Response) (*getAuthorizationsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getAuthorizationsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Authorization + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchAuthorizationsIDResponse parses an HTTP response from a PatchAuthorizationsIDWithResponse call +func ParsePatchAuthorizationsIDResponse(rsp *http.Response) (*patchAuthorizationsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchAuthorizationsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Authorization + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetBucketsResponse parses an HTTP response from a GetBucketsWithResponse call +func ParseGetBucketsResponse(rsp *http.Response) (*getBucketsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getBucketsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Buckets + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostBucketsResponse parses an HTTP response from a PostBucketsWithResponse call +func ParsePostBucketsResponse(rsp *http.Response) (*postBucketsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postBucketsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Bucket + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteBucketsIDResponse parses an HTTP response from a DeleteBucketsIDWithResponse call +func ParseDeleteBucketsIDResponse(rsp *http.Response) (*deleteBucketsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteBucketsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetBucketsIDResponse parses an HTTP response from a GetBucketsIDWithResponse call +func ParseGetBucketsIDResponse(rsp *http.Response) (*getBucketsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getBucketsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Bucket + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchBucketsIDResponse parses an HTTP response from a PatchBucketsIDWithResponse call +func ParsePatchBucketsIDResponse(rsp *http.Response) (*patchBucketsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchBucketsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Bucket + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetBucketsIDLabelsResponse parses an HTTP response from a GetBucketsIDLabelsWithResponse call +func ParseGetBucketsIDLabelsResponse(rsp *http.Response) (*getBucketsIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getBucketsIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostBucketsIDLabelsResponse parses an HTTP response from a PostBucketsIDLabelsWithResponse call +func ParsePostBucketsIDLabelsResponse(rsp *http.Response) (*postBucketsIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postBucketsIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteBucketsIDLabelsIDResponse parses an HTTP response from a DeleteBucketsIDLabelsIDWithResponse call +func ParseDeleteBucketsIDLabelsIDResponse(rsp *http.Response) (*deleteBucketsIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteBucketsIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetBucketsIDLogsResponse parses an HTTP response from a GetBucketsIDLogsWithResponse call +func ParseGetBucketsIDLogsResponse(rsp *http.Response) (*getBucketsIDLogsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getBucketsIDLogsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OperationLogs + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetBucketsIDMembersResponse parses an HTTP response from a GetBucketsIDMembersWithResponse call +func ParseGetBucketsIDMembersResponse(rsp *http.Response) (*getBucketsIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getBucketsIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceMembers + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostBucketsIDMembersResponse parses an HTTP response from a PostBucketsIDMembersWithResponse call +func ParsePostBucketsIDMembersResponse(rsp *http.Response) (*postBucketsIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postBucketsIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceMember + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteBucketsIDMembersIDResponse parses an HTTP response from a DeleteBucketsIDMembersIDWithResponse call +func ParseDeleteBucketsIDMembersIDResponse(rsp *http.Response) (*deleteBucketsIDMembersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteBucketsIDMembersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetBucketsIDOwnersResponse parses an HTTP response from a GetBucketsIDOwnersWithResponse call +func ParseGetBucketsIDOwnersResponse(rsp *http.Response) (*getBucketsIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getBucketsIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceOwners + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostBucketsIDOwnersResponse parses an HTTP response from a PostBucketsIDOwnersWithResponse call +func ParsePostBucketsIDOwnersResponse(rsp *http.Response) (*postBucketsIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postBucketsIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceOwner + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteBucketsIDOwnersIDResponse parses an HTTP response from a DeleteBucketsIDOwnersIDWithResponse call +func ParseDeleteBucketsIDOwnersIDResponse(rsp *http.Response) (*deleteBucketsIDOwnersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteBucketsIDOwnersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetChecksResponse parses an HTTP response from a GetChecksWithResponse call +func ParseGetChecksResponse(rsp *http.Response) (*getChecksResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getChecksResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Checks + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseCreateCheckResponse parses an HTTP response from a CreateCheckWithResponse call +func ParseCreateCheckResponse(rsp *http.Response) (*createCheckResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &createCheckResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Check + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteChecksIDResponse parses an HTTP response from a DeleteChecksIDWithResponse call +func ParseDeleteChecksIDResponse(rsp *http.Response) (*deleteChecksIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteChecksIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetChecksIDResponse parses an HTTP response from a GetChecksIDWithResponse call +func ParseGetChecksIDResponse(rsp *http.Response) (*getChecksIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getChecksIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Check + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchChecksIDResponse parses an HTTP response from a PatchChecksIDWithResponse call +func ParsePatchChecksIDResponse(rsp *http.Response) (*patchChecksIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchChecksIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Check + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePutChecksIDResponse parses an HTTP response from a PutChecksIDWithResponse call +func ParsePutChecksIDResponse(rsp *http.Response) (*putChecksIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &putChecksIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Check + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetChecksIDLabelsResponse parses an HTTP response from a GetChecksIDLabelsWithResponse call +func ParseGetChecksIDLabelsResponse(rsp *http.Response) (*getChecksIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getChecksIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostChecksIDLabelsResponse parses an HTTP response from a PostChecksIDLabelsWithResponse call +func ParsePostChecksIDLabelsResponse(rsp *http.Response) (*postChecksIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postChecksIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteChecksIDLabelsIDResponse parses an HTTP response from a DeleteChecksIDLabelsIDWithResponse call +func ParseDeleteChecksIDLabelsIDResponse(rsp *http.Response) (*deleteChecksIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteChecksIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetChecksIDQueryResponse parses an HTTP response from a GetChecksIDQueryWithResponse call +func ParseGetChecksIDQueryResponse(rsp *http.Response) (*getChecksIDQueryResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getChecksIDQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest FluxResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetDashboardsResponse parses an HTTP response from a GetDashboardsWithResponse call +func ParseGetDashboardsResponse(rsp *http.Response) (*getDashboardsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getDashboardsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Dashboards + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostDashboardsResponse parses an HTTP response from a PostDashboardsWithResponse call +func ParsePostDashboardsResponse(rsp *http.Response) (*postDashboardsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postDashboardsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest interface{} + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteDashboardsIDResponse parses an HTTP response from a DeleteDashboardsIDWithResponse call +func ParseDeleteDashboardsIDResponse(rsp *http.Response) (*deleteDashboardsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteDashboardsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetDashboardsIDResponse parses an HTTP response from a GetDashboardsIDWithResponse call +func ParseGetDashboardsIDResponse(rsp *http.Response) (*getDashboardsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getDashboardsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest interface{} + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchDashboardsIDResponse parses an HTTP response from a PatchDashboardsIDWithResponse call +func ParsePatchDashboardsIDResponse(rsp *http.Response) (*patchDashboardsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchDashboardsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Dashboard + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostDashboardsIDCellsResponse parses an HTTP response from a PostDashboardsIDCellsWithResponse call +func ParsePostDashboardsIDCellsResponse(rsp *http.Response) (*postDashboardsIDCellsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postDashboardsIDCellsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Cell + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePutDashboardsIDCellsResponse parses an HTTP response from a PutDashboardsIDCellsWithResponse call +func ParsePutDashboardsIDCellsResponse(rsp *http.Response) (*putDashboardsIDCellsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &putDashboardsIDCellsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Dashboard + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteDashboardsIDCellsIDResponse parses an HTTP response from a DeleteDashboardsIDCellsIDWithResponse call +func ParseDeleteDashboardsIDCellsIDResponse(rsp *http.Response) (*deleteDashboardsIDCellsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteDashboardsIDCellsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchDashboardsIDCellsIDResponse parses an HTTP response from a PatchDashboardsIDCellsIDWithResponse call +func ParsePatchDashboardsIDCellsIDResponse(rsp *http.Response) (*patchDashboardsIDCellsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchDashboardsIDCellsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Cell + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetDashboardsIDCellsIDViewResponse parses an HTTP response from a GetDashboardsIDCellsIDViewWithResponse call +func ParseGetDashboardsIDCellsIDViewResponse(rsp *http.Response) (*getDashboardsIDCellsIDViewResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getDashboardsIDCellsIDViewResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest View + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchDashboardsIDCellsIDViewResponse parses an HTTP response from a PatchDashboardsIDCellsIDViewWithResponse call +func ParsePatchDashboardsIDCellsIDViewResponse(rsp *http.Response) (*patchDashboardsIDCellsIDViewResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchDashboardsIDCellsIDViewResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest View + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetDashboardsIDLabelsResponse parses an HTTP response from a GetDashboardsIDLabelsWithResponse call +func ParseGetDashboardsIDLabelsResponse(rsp *http.Response) (*getDashboardsIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getDashboardsIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostDashboardsIDLabelsResponse parses an HTTP response from a PostDashboardsIDLabelsWithResponse call +func ParsePostDashboardsIDLabelsResponse(rsp *http.Response) (*postDashboardsIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postDashboardsIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteDashboardsIDLabelsIDResponse parses an HTTP response from a DeleteDashboardsIDLabelsIDWithResponse call +func ParseDeleteDashboardsIDLabelsIDResponse(rsp *http.Response) (*deleteDashboardsIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteDashboardsIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetDashboardsIDLogsResponse parses an HTTP response from a GetDashboardsIDLogsWithResponse call +func ParseGetDashboardsIDLogsResponse(rsp *http.Response) (*getDashboardsIDLogsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getDashboardsIDLogsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OperationLogs + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetDashboardsIDMembersResponse parses an HTTP response from a GetDashboardsIDMembersWithResponse call +func ParseGetDashboardsIDMembersResponse(rsp *http.Response) (*getDashboardsIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getDashboardsIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceMembers + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostDashboardsIDMembersResponse parses an HTTP response from a PostDashboardsIDMembersWithResponse call +func ParsePostDashboardsIDMembersResponse(rsp *http.Response) (*postDashboardsIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postDashboardsIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceMember + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteDashboardsIDMembersIDResponse parses an HTTP response from a DeleteDashboardsIDMembersIDWithResponse call +func ParseDeleteDashboardsIDMembersIDResponse(rsp *http.Response) (*deleteDashboardsIDMembersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteDashboardsIDMembersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetDashboardsIDOwnersResponse parses an HTTP response from a GetDashboardsIDOwnersWithResponse call +func ParseGetDashboardsIDOwnersResponse(rsp *http.Response) (*getDashboardsIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getDashboardsIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceOwners + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostDashboardsIDOwnersResponse parses an HTTP response from a PostDashboardsIDOwnersWithResponse call +func ParsePostDashboardsIDOwnersResponse(rsp *http.Response) (*postDashboardsIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postDashboardsIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceOwner + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteDashboardsIDOwnersIDResponse parses an HTTP response from a DeleteDashboardsIDOwnersIDWithResponse call +func ParseDeleteDashboardsIDOwnersIDResponse(rsp *http.Response) (*deleteDashboardsIDOwnersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteDashboardsIDOwnersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostDeleteResponse parses an HTTP response from a PostDeleteWithResponse call +func ParsePostDeleteResponse(rsp *http.Response) (*postDeleteResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postDeleteResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetDocumentsTemplatesResponse parses an HTTP response from a GetDocumentsTemplatesWithResponse call +func ParseGetDocumentsTemplatesResponse(rsp *http.Response) (*getDocumentsTemplatesResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getDocumentsTemplatesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Documents + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostDocumentsTemplatesResponse parses an HTTP response from a PostDocumentsTemplatesWithResponse call +func ParsePostDocumentsTemplatesResponse(rsp *http.Response) (*postDocumentsTemplatesResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postDocumentsTemplatesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Document + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteDocumentsTemplatesIDResponse parses an HTTP response from a DeleteDocumentsTemplatesIDWithResponse call +func ParseDeleteDocumentsTemplatesIDResponse(rsp *http.Response) (*deleteDocumentsTemplatesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteDocumentsTemplatesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetDocumentsTemplatesIDResponse parses an HTTP response from a GetDocumentsTemplatesIDWithResponse call +func ParseGetDocumentsTemplatesIDResponse(rsp *http.Response) (*getDocumentsTemplatesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getDocumentsTemplatesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Document + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePutDocumentsTemplatesIDResponse parses an HTTP response from a PutDocumentsTemplatesIDWithResponse call +func ParsePutDocumentsTemplatesIDResponse(rsp *http.Response) (*putDocumentsTemplatesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &putDocumentsTemplatesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Document + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetDocumentsTemplatesIDLabelsResponse parses an HTTP response from a GetDocumentsTemplatesIDLabelsWithResponse call +func ParseGetDocumentsTemplatesIDLabelsResponse(rsp *http.Response) (*getDocumentsTemplatesIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getDocumentsTemplatesIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostDocumentsTemplatesIDLabelsResponse parses an HTTP response from a PostDocumentsTemplatesIDLabelsWithResponse call +func ParsePostDocumentsTemplatesIDLabelsResponse(rsp *http.Response) (*postDocumentsTemplatesIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postDocumentsTemplatesIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteDocumentsTemplatesIDLabelsIDResponse parses an HTTP response from a DeleteDocumentsTemplatesIDLabelsIDWithResponse call +func ParseDeleteDocumentsTemplatesIDLabelsIDResponse(rsp *http.Response) (*deleteDocumentsTemplatesIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteDocumentsTemplatesIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetHealthResponse parses an HTTP response from a GetHealthWithResponse call +func ParseGetHealthResponse(rsp *http.Response) (*getHealthResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getHealthResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest HealthCheck + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest HealthCheck + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetLabelsResponse parses an HTTP response from a GetLabelsWithResponse call +func ParseGetLabelsResponse(rsp *http.Response) (*getLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostLabelsResponse parses an HTTP response from a PostLabelsWithResponse call +func ParsePostLabelsResponse(rsp *http.Response) (*postLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteLabelsIDResponse parses an HTTP response from a DeleteLabelsIDWithResponse call +func ParseDeleteLabelsIDResponse(rsp *http.Response) (*deleteLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetLabelsIDResponse parses an HTTP response from a GetLabelsIDWithResponse call +func ParseGetLabelsIDResponse(rsp *http.Response) (*getLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchLabelsIDResponse parses an HTTP response from a PatchLabelsIDWithResponse call +func ParsePatchLabelsIDResponse(rsp *http.Response) (*patchLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetMeResponse parses an HTTP response from a GetMeWithResponse call +func ParseGetMeResponse(rsp *http.Response) (*getMeResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getMeResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest User + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePutMePasswordResponse parses an HTTP response from a PutMePasswordWithResponse call +func ParsePutMePasswordResponse(rsp *http.Response) (*putMePasswordResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &putMePasswordResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetNotificationEndpointsResponse parses an HTTP response from a GetNotificationEndpointsWithResponse call +func ParseGetNotificationEndpointsResponse(rsp *http.Response) (*getNotificationEndpointsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getNotificationEndpointsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NotificationEndpoints + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseCreateNotificationEndpointResponse parses an HTTP response from a CreateNotificationEndpointWithResponse call +func ParseCreateNotificationEndpointResponse(rsp *http.Response) (*createNotificationEndpointResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &createNotificationEndpointResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest NotificationEndpoint + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteNotificationEndpointsIDResponse parses an HTTP response from a DeleteNotificationEndpointsIDWithResponse call +func ParseDeleteNotificationEndpointsIDResponse(rsp *http.Response) (*deleteNotificationEndpointsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteNotificationEndpointsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetNotificationEndpointsIDResponse parses an HTTP response from a GetNotificationEndpointsIDWithResponse call +func ParseGetNotificationEndpointsIDResponse(rsp *http.Response) (*getNotificationEndpointsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getNotificationEndpointsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NotificationEndpoint + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchNotificationEndpointsIDResponse parses an HTTP response from a PatchNotificationEndpointsIDWithResponse call +func ParsePatchNotificationEndpointsIDResponse(rsp *http.Response) (*patchNotificationEndpointsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchNotificationEndpointsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NotificationEndpoint + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePutNotificationEndpointsIDResponse parses an HTTP response from a PutNotificationEndpointsIDWithResponse call +func ParsePutNotificationEndpointsIDResponse(rsp *http.Response) (*putNotificationEndpointsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &putNotificationEndpointsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NotificationEndpoint + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetNotificationEndpointsIDLabelsResponse parses an HTTP response from a GetNotificationEndpointsIDLabelsWithResponse call +func ParseGetNotificationEndpointsIDLabelsResponse(rsp *http.Response) (*getNotificationEndpointsIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getNotificationEndpointsIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostNotificationEndpointIDLabelsResponse parses an HTTP response from a PostNotificationEndpointIDLabelsWithResponse call +func ParsePostNotificationEndpointIDLabelsResponse(rsp *http.Response) (*postNotificationEndpointIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postNotificationEndpointIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteNotificationEndpointsIDLabelsIDResponse parses an HTTP response from a DeleteNotificationEndpointsIDLabelsIDWithResponse call +func ParseDeleteNotificationEndpointsIDLabelsIDResponse(rsp *http.Response) (*deleteNotificationEndpointsIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteNotificationEndpointsIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetNotificationRulesResponse parses an HTTP response from a GetNotificationRulesWithResponse call +func ParseGetNotificationRulesResponse(rsp *http.Response) (*getNotificationRulesResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getNotificationRulesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NotificationRules + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseCreateNotificationRuleResponse parses an HTTP response from a CreateNotificationRuleWithResponse call +func ParseCreateNotificationRuleResponse(rsp *http.Response) (*createNotificationRuleResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &createNotificationRuleResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest NotificationRule + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteNotificationRulesIDResponse parses an HTTP response from a DeleteNotificationRulesIDWithResponse call +func ParseDeleteNotificationRulesIDResponse(rsp *http.Response) (*deleteNotificationRulesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteNotificationRulesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetNotificationRulesIDResponse parses an HTTP response from a GetNotificationRulesIDWithResponse call +func ParseGetNotificationRulesIDResponse(rsp *http.Response) (*getNotificationRulesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getNotificationRulesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NotificationRule + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchNotificationRulesIDResponse parses an HTTP response from a PatchNotificationRulesIDWithResponse call +func ParsePatchNotificationRulesIDResponse(rsp *http.Response) (*patchNotificationRulesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchNotificationRulesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NotificationRule + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePutNotificationRulesIDResponse parses an HTTP response from a PutNotificationRulesIDWithResponse call +func ParsePutNotificationRulesIDResponse(rsp *http.Response) (*putNotificationRulesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &putNotificationRulesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NotificationRule + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetNotificationRulesIDLabelsResponse parses an HTTP response from a GetNotificationRulesIDLabelsWithResponse call +func ParseGetNotificationRulesIDLabelsResponse(rsp *http.Response) (*getNotificationRulesIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getNotificationRulesIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostNotificationRuleIDLabelsResponse parses an HTTP response from a PostNotificationRuleIDLabelsWithResponse call +func ParsePostNotificationRuleIDLabelsResponse(rsp *http.Response) (*postNotificationRuleIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postNotificationRuleIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteNotificationRulesIDLabelsIDResponse parses an HTTP response from a DeleteNotificationRulesIDLabelsIDWithResponse call +func ParseDeleteNotificationRulesIDLabelsIDResponse(rsp *http.Response) (*deleteNotificationRulesIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteNotificationRulesIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetNotificationRulesIDQueryResponse parses an HTTP response from a GetNotificationRulesIDQueryWithResponse call +func ParseGetNotificationRulesIDQueryResponse(rsp *http.Response) (*getNotificationRulesIDQueryResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getNotificationRulesIDQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest FluxResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetOrgsResponse parses an HTTP response from a GetOrgsWithResponse call +func ParseGetOrgsResponse(rsp *http.Response) (*getOrgsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getOrgsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Organizations + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostOrgsResponse parses an HTTP response from a PostOrgsWithResponse call +func ParsePostOrgsResponse(rsp *http.Response) (*postOrgsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postOrgsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Organization + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteOrgsIDResponse parses an HTTP response from a DeleteOrgsIDWithResponse call +func ParseDeleteOrgsIDResponse(rsp *http.Response) (*deleteOrgsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteOrgsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetOrgsIDResponse parses an HTTP response from a GetOrgsIDWithResponse call +func ParseGetOrgsIDResponse(rsp *http.Response) (*getOrgsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getOrgsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Organization + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchOrgsIDResponse parses an HTTP response from a PatchOrgsIDWithResponse call +func ParsePatchOrgsIDResponse(rsp *http.Response) (*patchOrgsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchOrgsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Organization + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetOrgsIDLabelsResponse parses an HTTP response from a GetOrgsIDLabelsWithResponse call +func ParseGetOrgsIDLabelsResponse(rsp *http.Response) (*getOrgsIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getOrgsIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostOrgsIDLabelsResponse parses an HTTP response from a PostOrgsIDLabelsWithResponse call +func ParsePostOrgsIDLabelsResponse(rsp *http.Response) (*postOrgsIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postOrgsIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteOrgsIDLabelsIDResponse parses an HTTP response from a DeleteOrgsIDLabelsIDWithResponse call +func ParseDeleteOrgsIDLabelsIDResponse(rsp *http.Response) (*deleteOrgsIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteOrgsIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetOrgsIDLogsResponse parses an HTTP response from a GetOrgsIDLogsWithResponse call +func ParseGetOrgsIDLogsResponse(rsp *http.Response) (*getOrgsIDLogsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getOrgsIDLogsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OperationLogs + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetOrgsIDMembersResponse parses an HTTP response from a GetOrgsIDMembersWithResponse call +func ParseGetOrgsIDMembersResponse(rsp *http.Response) (*getOrgsIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getOrgsIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceMembers + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostOrgsIDMembersResponse parses an HTTP response from a PostOrgsIDMembersWithResponse call +func ParsePostOrgsIDMembersResponse(rsp *http.Response) (*postOrgsIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postOrgsIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceMember + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteOrgsIDMembersIDResponse parses an HTTP response from a DeleteOrgsIDMembersIDWithResponse call +func ParseDeleteOrgsIDMembersIDResponse(rsp *http.Response) (*deleteOrgsIDMembersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteOrgsIDMembersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetOrgsIDOwnersResponse parses an HTTP response from a GetOrgsIDOwnersWithResponse call +func ParseGetOrgsIDOwnersResponse(rsp *http.Response) (*getOrgsIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getOrgsIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceOwners + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostOrgsIDOwnersResponse parses an HTTP response from a PostOrgsIDOwnersWithResponse call +func ParsePostOrgsIDOwnersResponse(rsp *http.Response) (*postOrgsIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postOrgsIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceOwner + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteOrgsIDOwnersIDResponse parses an HTTP response from a DeleteOrgsIDOwnersIDWithResponse call +func ParseDeleteOrgsIDOwnersIDResponse(rsp *http.Response) (*deleteOrgsIDOwnersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteOrgsIDOwnersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetOrgsIDSecretsResponse parses an HTTP response from a GetOrgsIDSecretsWithResponse call +func ParseGetOrgsIDSecretsResponse(rsp *http.Response) (*getOrgsIDSecretsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getOrgsIDSecretsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SecretKeysResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchOrgsIDSecretsResponse parses an HTTP response from a PatchOrgsIDSecretsWithResponse call +func ParsePatchOrgsIDSecretsResponse(rsp *http.Response) (*patchOrgsIDSecretsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchOrgsIDSecretsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostOrgsIDSecretsResponse parses an HTTP response from a PostOrgsIDSecretsWithResponse call +func ParsePostOrgsIDSecretsResponse(rsp *http.Response) (*postOrgsIDSecretsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postOrgsIDSecretsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseCreatePkgResponse parses an HTTP response from a CreatePkgWithResponse call +func ParseCreatePkgResponse(rsp *http.Response) (*createPkgResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &createPkgResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Pkg + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseApplyPkgResponse parses an HTTP response from a ApplyPkgWithResponse call +func ParseApplyPkgResponse(rsp *http.Response) (*applyPkgResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &applyPkgResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PkgSummary + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest PkgSummary + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostQueryResponse parses an HTTP response from a PostQueryWithResponse call +func ParsePostQueryResponse(rsp *http.Response) (*postQueryResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostQueryAnalyzeResponse parses an HTTP response from a PostQueryAnalyzeWithResponse call +func ParsePostQueryAnalyzeResponse(rsp *http.Response) (*postQueryAnalyzeResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postQueryAnalyzeResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AnalyzeQueryResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostQueryAstResponse parses an HTTP response from a PostQueryAstWithResponse call +func ParsePostQueryAstResponse(rsp *http.Response) (*postQueryAstResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postQueryAstResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ASTResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetQuerySuggestionsResponse parses an HTTP response from a GetQuerySuggestionsWithResponse call +func ParseGetQuerySuggestionsResponse(rsp *http.Response) (*getQuerySuggestionsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getQuerySuggestionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest FluxSuggestions + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetQuerySuggestionsNameResponse parses an HTTP response from a GetQuerySuggestionsNameWithResponse call +func ParseGetQuerySuggestionsNameResponse(rsp *http.Response) (*getQuerySuggestionsNameResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getQuerySuggestionsNameResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest FluxSuggestion + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetReadyResponse parses an HTTP response from a GetReadyWithResponse call +func ParseGetReadyResponse(rsp *http.Response) (*getReadyResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getReadyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Ready + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetScrapersResponse parses an HTTP response from a GetScrapersWithResponse call +func ParseGetScrapersResponse(rsp *http.Response) (*getScrapersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getScrapersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ScraperTargetResponses + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostScrapersResponse parses an HTTP response from a PostScrapersWithResponse call +func ParsePostScrapersResponse(rsp *http.Response) (*postScrapersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postScrapersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ScraperTargetResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteScrapersIDResponse parses an HTTP response from a DeleteScrapersIDWithResponse call +func ParseDeleteScrapersIDResponse(rsp *http.Response) (*deleteScrapersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteScrapersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetScrapersIDResponse parses an HTTP response from a GetScrapersIDWithResponse call +func ParseGetScrapersIDResponse(rsp *http.Response) (*getScrapersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getScrapersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ScraperTargetResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchScrapersIDResponse parses an HTTP response from a PatchScrapersIDWithResponse call +func ParsePatchScrapersIDResponse(rsp *http.Response) (*patchScrapersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchScrapersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ScraperTargetResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetScrapersIDLabelsResponse parses an HTTP response from a GetScrapersIDLabelsWithResponse call +func ParseGetScrapersIDLabelsResponse(rsp *http.Response) (*getScrapersIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getScrapersIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostScrapersIDLabelsResponse parses an HTTP response from a PostScrapersIDLabelsWithResponse call +func ParsePostScrapersIDLabelsResponse(rsp *http.Response) (*postScrapersIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postScrapersIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteScrapersIDLabelsIDResponse parses an HTTP response from a DeleteScrapersIDLabelsIDWithResponse call +func ParseDeleteScrapersIDLabelsIDResponse(rsp *http.Response) (*deleteScrapersIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteScrapersIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchScrapersIDLabelsIDResponse parses an HTTP response from a PatchScrapersIDLabelsIDWithResponse call +func ParsePatchScrapersIDLabelsIDResponse(rsp *http.Response) (*patchScrapersIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchScrapersIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetScrapersIDMembersResponse parses an HTTP response from a GetScrapersIDMembersWithResponse call +func ParseGetScrapersIDMembersResponse(rsp *http.Response) (*getScrapersIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getScrapersIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceMembers + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostScrapersIDMembersResponse parses an HTTP response from a PostScrapersIDMembersWithResponse call +func ParsePostScrapersIDMembersResponse(rsp *http.Response) (*postScrapersIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postScrapersIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceMember + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteScrapersIDMembersIDResponse parses an HTTP response from a DeleteScrapersIDMembersIDWithResponse call +func ParseDeleteScrapersIDMembersIDResponse(rsp *http.Response) (*deleteScrapersIDMembersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteScrapersIDMembersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetScrapersIDOwnersResponse parses an HTTP response from a GetScrapersIDOwnersWithResponse call +func ParseGetScrapersIDOwnersResponse(rsp *http.Response) (*getScrapersIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getScrapersIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceOwners + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostScrapersIDOwnersResponse parses an HTTP response from a PostScrapersIDOwnersWithResponse call +func ParsePostScrapersIDOwnersResponse(rsp *http.Response) (*postScrapersIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postScrapersIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceOwner + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteScrapersIDOwnersIDResponse parses an HTTP response from a DeleteScrapersIDOwnersIDWithResponse call +func ParseDeleteScrapersIDOwnersIDResponse(rsp *http.Response) (*deleteScrapersIDOwnersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteScrapersIDOwnersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetSetupResponse parses an HTTP response from a GetSetupWithResponse call +func ParseGetSetupResponse(rsp *http.Response) (*getSetupResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getSetupResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest IsOnboarding + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParsePostSetupResponse parses an HTTP response from a PostSetupWithResponse call +func ParsePostSetupResponse(rsp *http.Response) (*postSetupResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postSetupResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest OnboardingResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + } + + return response, nil +} + +// ParsePostSigninResponse parses an HTTP response from a PostSigninWithResponse call +func ParsePostSigninResponse(rsp *http.Response) (*postSigninResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postSigninResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostSignoutResponse parses an HTTP response from a PostSignoutWithResponse call +func ParsePostSignoutResponse(rsp *http.Response) (*postSignoutResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postSignoutResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetSourcesResponse parses an HTTP response from a GetSourcesWithResponse call +func ParseGetSourcesResponse(rsp *http.Response) (*getSourcesResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getSourcesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Sources + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostSourcesResponse parses an HTTP response from a PostSourcesWithResponse call +func ParsePostSourcesResponse(rsp *http.Response) (*postSourcesResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postSourcesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Source + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteSourcesIDResponse parses an HTTP response from a DeleteSourcesIDWithResponse call +func ParseDeleteSourcesIDResponse(rsp *http.Response) (*deleteSourcesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteSourcesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetSourcesIDResponse parses an HTTP response from a GetSourcesIDWithResponse call +func ParseGetSourcesIDResponse(rsp *http.Response) (*getSourcesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getSourcesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Source + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchSourcesIDResponse parses an HTTP response from a PatchSourcesIDWithResponse call +func ParsePatchSourcesIDResponse(rsp *http.Response) (*patchSourcesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchSourcesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Source + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetSourcesIDBucketsResponse parses an HTTP response from a GetSourcesIDBucketsWithResponse call +func ParseGetSourcesIDBucketsResponse(rsp *http.Response) (*getSourcesIDBucketsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getSourcesIDBucketsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Buckets + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetSourcesIDHealthResponse parses an HTTP response from a GetSourcesIDHealthWithResponse call +func ParseGetSourcesIDHealthResponse(rsp *http.Response) (*getSourcesIDHealthResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getSourcesIDHealthResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest HealthCheck + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest HealthCheck + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTasksResponse parses an HTTP response from a GetTasksWithResponse call +func ParseGetTasksResponse(rsp *http.Response) (*getTasksResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTasksResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Tasks + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostTasksResponse parses an HTTP response from a PostTasksWithResponse call +func ParsePostTasksResponse(rsp *http.Response) (*postTasksResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postTasksResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Task + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteTasksIDResponse parses an HTTP response from a DeleteTasksIDWithResponse call +func ParseDeleteTasksIDResponse(rsp *http.Response) (*deleteTasksIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteTasksIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTasksIDResponse parses an HTTP response from a GetTasksIDWithResponse call +func ParseGetTasksIDResponse(rsp *http.Response) (*getTasksIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTasksIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Task + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchTasksIDResponse parses an HTTP response from a PatchTasksIDWithResponse call +func ParsePatchTasksIDResponse(rsp *http.Response) (*patchTasksIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchTasksIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Task + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTasksIDLabelsResponse parses an HTTP response from a GetTasksIDLabelsWithResponse call +func ParseGetTasksIDLabelsResponse(rsp *http.Response) (*getTasksIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTasksIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostTasksIDLabelsResponse parses an HTTP response from a PostTasksIDLabelsWithResponse call +func ParsePostTasksIDLabelsResponse(rsp *http.Response) (*postTasksIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postTasksIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteTasksIDLabelsIDResponse parses an HTTP response from a DeleteTasksIDLabelsIDWithResponse call +func ParseDeleteTasksIDLabelsIDResponse(rsp *http.Response) (*deleteTasksIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteTasksIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTasksIDLogsResponse parses an HTTP response from a GetTasksIDLogsWithResponse call +func ParseGetTasksIDLogsResponse(rsp *http.Response) (*getTasksIDLogsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTasksIDLogsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Logs + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTasksIDMembersResponse parses an HTTP response from a GetTasksIDMembersWithResponse call +func ParseGetTasksIDMembersResponse(rsp *http.Response) (*getTasksIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTasksIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceMembers + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostTasksIDMembersResponse parses an HTTP response from a PostTasksIDMembersWithResponse call +func ParsePostTasksIDMembersResponse(rsp *http.Response) (*postTasksIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postTasksIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceMember + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteTasksIDMembersIDResponse parses an HTTP response from a DeleteTasksIDMembersIDWithResponse call +func ParseDeleteTasksIDMembersIDResponse(rsp *http.Response) (*deleteTasksIDMembersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteTasksIDMembersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTasksIDOwnersResponse parses an HTTP response from a GetTasksIDOwnersWithResponse call +func ParseGetTasksIDOwnersResponse(rsp *http.Response) (*getTasksIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTasksIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceOwners + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostTasksIDOwnersResponse parses an HTTP response from a PostTasksIDOwnersWithResponse call +func ParsePostTasksIDOwnersResponse(rsp *http.Response) (*postTasksIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postTasksIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceOwner + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteTasksIDOwnersIDResponse parses an HTTP response from a DeleteTasksIDOwnersIDWithResponse call +func ParseDeleteTasksIDOwnersIDResponse(rsp *http.Response) (*deleteTasksIDOwnersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteTasksIDOwnersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTasksIDRunsResponse parses an HTTP response from a GetTasksIDRunsWithResponse call +func ParseGetTasksIDRunsResponse(rsp *http.Response) (*getTasksIDRunsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTasksIDRunsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Runs + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostTasksIDRunsResponse parses an HTTP response from a PostTasksIDRunsWithResponse call +func ParsePostTasksIDRunsResponse(rsp *http.Response) (*postTasksIDRunsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postTasksIDRunsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Run + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteTasksIDRunsIDResponse parses an HTTP response from a DeleteTasksIDRunsIDWithResponse call +func ParseDeleteTasksIDRunsIDResponse(rsp *http.Response) (*deleteTasksIDRunsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteTasksIDRunsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTasksIDRunsIDResponse parses an HTTP response from a GetTasksIDRunsIDWithResponse call +func ParseGetTasksIDRunsIDResponse(rsp *http.Response) (*getTasksIDRunsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTasksIDRunsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Run + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTasksIDRunsIDLogsResponse parses an HTTP response from a GetTasksIDRunsIDLogsWithResponse call +func ParseGetTasksIDRunsIDLogsResponse(rsp *http.Response) (*getTasksIDRunsIDLogsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTasksIDRunsIDLogsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Logs + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostTasksIDRunsIDRetryResponse parses an HTTP response from a PostTasksIDRunsIDRetryWithResponse call +func ParsePostTasksIDRunsIDRetryResponse(rsp *http.Response) (*postTasksIDRunsIDRetryResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postTasksIDRunsIDRetryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Run + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTelegrafPluginsResponse parses an HTTP response from a GetTelegrafPluginsWithResponse call +func ParseGetTelegrafPluginsResponse(rsp *http.Response) (*getTelegrafPluginsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTelegrafPluginsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest TelegrafPlugins + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTelegrafsResponse parses an HTTP response from a GetTelegrafsWithResponse call +func ParseGetTelegrafsResponse(rsp *http.Response) (*getTelegrafsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTelegrafsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Telegrafs + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostTelegrafsResponse parses an HTTP response from a PostTelegrafsWithResponse call +func ParsePostTelegrafsResponse(rsp *http.Response) (*postTelegrafsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postTelegrafsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Telegraf + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteTelegrafsIDResponse parses an HTTP response from a DeleteTelegrafsIDWithResponse call +func ParseDeleteTelegrafsIDResponse(rsp *http.Response) (*deleteTelegrafsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteTelegrafsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTelegrafsIDResponse parses an HTTP response from a GetTelegrafsIDWithResponse call +func ParseGetTelegrafsIDResponse(rsp *http.Response) (*getTelegrafsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTelegrafsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Telegraf + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + case rsp.StatusCode == 200: + // Content-type (application/toml) unsupported + + } + + return response, nil +} + +// ParsePutTelegrafsIDResponse parses an HTTP response from a PutTelegrafsIDWithResponse call +func ParsePutTelegrafsIDResponse(rsp *http.Response) (*putTelegrafsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &putTelegrafsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Telegraf + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTelegrafsIDLabelsResponse parses an HTTP response from a GetTelegrafsIDLabelsWithResponse call +func ParseGetTelegrafsIDLabelsResponse(rsp *http.Response) (*getTelegrafsIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTelegrafsIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostTelegrafsIDLabelsResponse parses an HTTP response from a PostTelegrafsIDLabelsWithResponse call +func ParsePostTelegrafsIDLabelsResponse(rsp *http.Response) (*postTelegrafsIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postTelegrafsIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteTelegrafsIDLabelsIDResponse parses an HTTP response from a DeleteTelegrafsIDLabelsIDWithResponse call +func ParseDeleteTelegrafsIDLabelsIDResponse(rsp *http.Response) (*deleteTelegrafsIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteTelegrafsIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTelegrafsIDMembersResponse parses an HTTP response from a GetTelegrafsIDMembersWithResponse call +func ParseGetTelegrafsIDMembersResponse(rsp *http.Response) (*getTelegrafsIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTelegrafsIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceMembers + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostTelegrafsIDMembersResponse parses an HTTP response from a PostTelegrafsIDMembersWithResponse call +func ParsePostTelegrafsIDMembersResponse(rsp *http.Response) (*postTelegrafsIDMembersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postTelegrafsIDMembersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceMember + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteTelegrafsIDMembersIDResponse parses an HTTP response from a DeleteTelegrafsIDMembersIDWithResponse call +func ParseDeleteTelegrafsIDMembersIDResponse(rsp *http.Response) (*deleteTelegrafsIDMembersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteTelegrafsIDMembersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetTelegrafsIDOwnersResponse parses an HTTP response from a GetTelegrafsIDOwnersWithResponse call +func ParseGetTelegrafsIDOwnersResponse(rsp *http.Response) (*getTelegrafsIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getTelegrafsIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ResourceOwners + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostTelegrafsIDOwnersResponse parses an HTTP response from a PostTelegrafsIDOwnersWithResponse call +func ParsePostTelegrafsIDOwnersResponse(rsp *http.Response) (*postTelegrafsIDOwnersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postTelegrafsIDOwnersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ResourceOwner + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteTelegrafsIDOwnersIDResponse parses an HTTP response from a DeleteTelegrafsIDOwnersIDWithResponse call +func ParseDeleteTelegrafsIDOwnersIDResponse(rsp *http.Response) (*deleteTelegrafsIDOwnersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteTelegrafsIDOwnersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetUsersResponse parses an HTTP response from a GetUsersWithResponse call +func ParseGetUsersResponse(rsp *http.Response) (*getUsersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getUsersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Users + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostUsersResponse parses an HTTP response from a PostUsersWithResponse call +func ParsePostUsersResponse(rsp *http.Response) (*postUsersResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postUsersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest User + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteUsersIDResponse parses an HTTP response from a DeleteUsersIDWithResponse call +func ParseDeleteUsersIDResponse(rsp *http.Response) (*deleteUsersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteUsersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetUsersIDResponse parses an HTTP response from a GetUsersIDWithResponse call +func ParseGetUsersIDResponse(rsp *http.Response) (*getUsersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getUsersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest User + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchUsersIDResponse parses an HTTP response from a PatchUsersIDWithResponse call +func ParsePatchUsersIDResponse(rsp *http.Response) (*patchUsersIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchUsersIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest User + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetUsersIDLogsResponse parses an HTTP response from a GetUsersIDLogsWithResponse call +func ParseGetUsersIDLogsResponse(rsp *http.Response) (*getUsersIDLogsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getUsersIDLogsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OperationLogs + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePutUsersIDPasswordResponse parses an HTTP response from a PutUsersIDPasswordWithResponse call +func ParsePutUsersIDPasswordResponse(rsp *http.Response) (*putUsersIDPasswordResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &putUsersIDPasswordResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetVariablesResponse parses an HTTP response from a GetVariablesWithResponse call +func ParseGetVariablesResponse(rsp *http.Response) (*getVariablesResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getVariablesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Variables + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostVariablesResponse parses an HTTP response from a PostVariablesWithResponse call +func ParsePostVariablesResponse(rsp *http.Response) (*postVariablesResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postVariablesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Variable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteVariablesIDResponse parses an HTTP response from a DeleteVariablesIDWithResponse call +func ParseDeleteVariablesIDResponse(rsp *http.Response) (*deleteVariablesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteVariablesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetVariablesIDResponse parses an HTTP response from a GetVariablesIDWithResponse call +func ParseGetVariablesIDResponse(rsp *http.Response) (*getVariablesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getVariablesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Variable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePatchVariablesIDResponse parses an HTTP response from a PatchVariablesIDWithResponse call +func ParsePatchVariablesIDResponse(rsp *http.Response) (*patchVariablesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &patchVariablesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Variable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePutVariablesIDResponse parses an HTTP response from a PutVariablesIDWithResponse call +func ParsePutVariablesIDResponse(rsp *http.Response) (*putVariablesIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &putVariablesIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Variable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseGetVariablesIDLabelsResponse parses an HTTP response from a GetVariablesIDLabelsWithResponse call +func ParseGetVariablesIDLabelsResponse(rsp *http.Response) (*getVariablesIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &getVariablesIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LabelsResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostVariablesIDLabelsResponse parses an HTTP response from a PostVariablesIDLabelsWithResponse call +func ParsePostVariablesIDLabelsResponse(rsp *http.Response) (*postVariablesIDLabelsResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postVariablesIDLabelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest LabelResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseDeleteVariablesIDLabelsIDResponse parses an HTTP response from a DeleteVariablesIDLabelsIDWithResponse call +func ParseDeleteVariablesIDLabelsIDResponse(rsp *http.Response) (*deleteVariablesIDLabelsIDResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &deleteVariablesIDLabelsIDResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParsePostWriteResponse parses an HTTP response from a PostWriteWithResponse call +func ParsePostWriteResponse(rsp *http.Response) (*postWriteResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &postWriteResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest LineProtocolError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 413: + var dest LineProtocolLengthError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON413 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json"): + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} diff --git a/domain/swagger.yml b/domain/swagger.yml new file mode 100644 index 00000000..1baa92e0 --- /dev/null +++ b/domain/swagger.yml @@ -0,0 +1,10829 @@ +openapi: "3.0.0" +info: + title: Influx API Service + version: 0.1.0 +servers: + - url: /api/v2 +paths: + /signin: + post: + operationId: PostSignin + summary: Exchange basic auth credentials for session + security: + - BasicAuth: [] + parameters: + - $ref: '#/components/parameters/TraceSpan' + responses: + '204': + description: Successfully authenticated + '401': + description: Unauthorized access + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '403': + description: user account is disabled + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unsuccessful authentication + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /signout: + post: + operationId: PostSignout + summary: Expire the current session + parameters: + - $ref: '#/components/parameters/TraceSpan' + responses: + '204': + description: Session successfully expired + '401': + description: Unauthorized access + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unsuccessful session expiry + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /: + get: + operationId: GetRoutes + summary: Map of all top level routes available + parameters: + - $ref: '#/components/parameters/TraceSpan' + responses: + default: + description: All routes + content: + application/json: + schema: + $ref: "#/components/schemas/Routes" + /setup: + get: + operationId: GetSetup + tags: + - Setup + summary: Check if database has default user, org, bucket + description: Returns `true` if no default user, organization, or bucket has been created. + parameters: + - $ref: '#/components/parameters/TraceSpan' + responses: + '200': + description: + allowed true or false + content: + application/json: + schema: + $ref: "#/components/schemas/IsOnboarding" + post: + operationId: PostSetup + tags: + - Setup + summary: Set up initial user, org and bucket + description: Post an onboarding request to set up initial user, org and bucket. + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Source to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/OnboardingRequest" + responses: + '201': + description: Created default user, bucket, org + content: + application/json: + schema: + $ref: "#/components/schemas/OnboardingResponse" + /documents/templates: + get: + operationId: GetDocumentsTemplates + tags: + - Templates + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: org + description: Specifies the name of the organization of the template. + schema: + type: string + - in: query + name: orgID + description: Specifies the organization ID of the template. + schema: + type: string + responses: + '200': + description: A list of template documents + content: + application/json: + schema: + $ref: "#/components/schemas/Documents" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostDocumentsTemplates + tags: + - Templates + summary: Create a template + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Template that will be created + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/DocumentCreate" + responses: + '201': + description: Template created + content: + application/json: + schema: + $ref: "#/components/schemas/Document" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/documents/templates/{templateID}': + get: + operationId: GetDocumentsTemplatesID + tags: + - Templates + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: templateID + schema: + type: string + required: true + description: The template ID. + responses: + '200': + description: The template requested + content: + application/json: + schema: + $ref: "#/components/schemas/Document" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + put: + operationId: PutDocumentsTemplatesID + tags: + - Templates + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: templateID + schema: + type: string + required: true + description: The template ID. + requestBody: + description: Template that will be updated + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/DocumentUpdate" + responses: + '200': + description: The newly updated template + content: + application/json: + schema: + $ref: "#/components/schemas/Document" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteDocumentsTemplatesID + tags: + - Templates + summary: Delete a template + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: templateID + schema: + type: string + required: true + description: The template ID. + responses: + '204': + description: Delete has been accepted + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/documents/templates/{templateID}/labels': + get: + operationId: GetDocumentsTemplatesIDLabels + tags: + - Templates + summary: List all labels for a template + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: templateID + schema: + type: string + required: true + description: The template ID. + responses: + '200': + description: A list of all labels for a template + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostDocumentsTemplatesIDLabels + tags: + - Templates + summary: Add a label to a template + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: templateID + schema: + type: string + required: true + description: The template ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: The label added to the template + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/documents/templates/{templateID}/labels/{labelID}': + delete: + operationId: DeleteDocumentsTemplatesIDLabelsID + tags: + - Templates + summary: Delete a label from a template + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: templateID + schema: + type: string + required: true + description: The template ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The label ID. + responses: + '204': + description: Delete has been accepted + '404': + description: Template not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /telegraf/plugins: + get: + operationId: GetTelegrafPlugins + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: type + description: The type of plugin desired. + schema: + type: string + responses: + '200': + description: A list of Telegraf plugins. + content: + application/json: + schema: + $ref: "#/components/schemas/TelegrafPlugins" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /telegrafs: + get: + operationId: GetTelegrafs + tags: + - Telegrafs + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: orgID + description: The organization ID the Telegraf config belongs to. + schema: + type: string + responses: + '200': + description: A list of Telegraf configs + content: + application/json: + schema: + $ref: "#/components/schemas/Telegrafs" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostTelegrafs + tags: + - Telegrafs + summary: Create a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Telegraf config to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/TelegrafRequest" + responses: + '201': + description: Telegraf config created + content: + application/json: + schema: + $ref: "#/components/schemas/Telegraf" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/telegrafs/{telegrafID}': + get: + operationId: GetTelegrafsID + tags: + - Telegrafs + summary: Retrieve a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + - in: header + name: Accept + required: false + schema: + type: string + default: application/toml + enum: + - application/toml + - application/json + - application/octet-stream + responses: + '200': + description: Telegraf config details + content: + application/toml: + example: "[agent]\ninterval = \"10s\"" + schema: + type: string + application/json: + schema: + $ref: "#/components/schemas/Telegraf" + application/octet-stream: + example: "[agent]\ninterval = \"10s\"" + schema: + type: string + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + put: + operationId: PutTelegrafsID + tags: + - Telegrafs + summary: Update a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + requestBody: + description: Telegraf config update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/TelegrafRequest" + responses: + '200': + description: An updated Telegraf config + content: + application/json: + schema: + $ref: "#/components/schemas/Telegraf" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteTelegrafsID + tags: + - Telegrafs + summary: Delete a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + responses: + '204': + description: Delete has been accepted + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/telegrafs/{telegrafID}/labels': + get: + operationId: GetTelegrafsIDLabels + tags: + - Telegrafs + summary: List all labels for a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + responses: + '200': + description: A list of all labels for a Telegraf config + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostTelegrafsIDLabels + tags: + - Telegrafs + summary: Add a label to a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: The label added to the Telegraf config + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/telegrafs/{telegrafID}/labels/{labelID}': + delete: + operationId: DeleteTelegrafsIDLabelsID + tags: + - Telegrafs + summary: Delete a label from a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The label ID. + responses: + '204': + description: Delete has been accepted + '404': + description: Telegraf config not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/telegrafs/{telegrafID}/members': + get: + operationId: GetTelegrafsIDMembers + tags: + - Users + - Telegrafs + summary: List all users with member privileges for a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + responses: + '200': + description: A list of Telegraf config members + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMembers" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostTelegrafsIDMembers + tags: + - Users + - Telegrafs + summary: Add a member to a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + requestBody: + description: User to add as member + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Member added to Telegraf config + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMember" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/telegrafs/{telegrafID}/members/{userID}': + delete: + operationId: DeleteTelegrafsIDMembersID + tags: + - Users + - Telegrafs + summary: Remove a member from a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the member to remove. + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + responses: + '204': + description: Member removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/telegrafs/{telegrafID}/owners': + get: + operationId: GetTelegrafsIDOwners + tags: + - Users + - Telegrafs + summary: List all owners of a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + responses: + '200': + description: A list of Telegraf config owners + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwners" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostTelegrafsIDOwners + tags: + - Users + - Telegrafs + summary: Add an owner to a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + requestBody: + description: User to add as owner + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Telegraf config owner added + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwner" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/telegrafs/{telegrafID}/owners/{userID}': + delete: + operationId: DeleteTelegrafsIDOwnersID + tags: + - Users + - Telegrafs + summary: Remove an owner from a Telegraf config + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the owner to remove. + - in: path + name: telegrafID + schema: + type: string + required: true + description: The Telegraf config ID. + responses: + '204': + description: Owner removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /scrapers: + get: + operationId: GetScrapers + tags: + - ScraperTargets + summary: Get all scraper targets + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: name + description: Specifies the name of the scraper target. + schema: + type: string + - in: query + name: id + description: List of scraper target IDs to return. If both `id` and `owner` are specified, only `id` is used. + schema: + type: array + items: + type: string + - in: query + name: orgID + description: Specifies the organization ID of the scraper target. + schema: + type: string + - in: query + name: org + description: Specifies the organization name of the scraper target. + schema: + type: string + responses: + '200': + description: All scraper targets + content: + application/json: + schema: + $ref: "#/components/schemas/ScraperTargetResponses" + post: + operationId: PostScrapers + summary: Create a scraper target + tags: + - ScraperTargets + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Scraper target to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ScraperTargetRequest" + responses: + '201': + description: Scraper target created + content: + application/json: + schema: + $ref: "#/components/schemas/ScraperTargetResponse" + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/scrapers/{scraperTargetID}': + get: + operationId: GetScrapersID + tags: + - ScraperTargets + summary: Get a scraper target by ID + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + required: true + schema: + type: string + description: The scraper target ID. + responses: + '200': + description: Scraper target updated + content: + application/json: + schema: + $ref: "#/components/schemas/ScraperTargetResponse" + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteScrapersID + tags: + - ScraperTargets + summary: Delete a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + required: true + schema: + type: string + description: The scraper target ID. + responses: + '204': + description: Scraper target deleted + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchScrapersID + summary: Update a scraper target + tags: + - ScraperTargets + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + required: true + schema: + type: string + description: The scraper target ID. + requestBody: + description: Scraper target update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ScraperTargetRequest" + responses: + '200': + description: Scraper target updated + content: + application/json: + schema: + $ref: "#/components/schemas/ScraperTargetResponse" + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/scrapers/{scraperTargetID}/labels': + get: + operationId: GetScrapersIDLabels + tags: + - ScraperTargets + summary: List all labels for a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + schema: + type: string + required: true + description: The scraper target ID. + responses: + '200': + description: A list of all labels for a scraper target + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostScrapersIDLabels + tags: + - ScraperTargets + summary: Add a label to a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + schema: + type: string + required: true + description: The scraper target ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: The newly added label + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/scrapers/{scraperTargetID}/labels/{labelID}': + delete: + operationId: DeleteScrapersIDLabelsID + tags: + - ScraperTargets + summary: Delete a label from a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + schema: + type: string + required: true + description: The scraper target ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The label ID. + responses: + '204': + description: Delete has been accepted + '404': + description: Scraper target not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchScrapersIDLabelsID + tags: + - ScraperTargets + summary: Update a label on a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + schema: + type: string + required: true + description: The scraper target ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The label ID. + requestBody: + description: Label update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Label" + responses: + '200': + description: Updated successfully + '404': + description: Scraper target not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/scrapers/{scraperTargetID}/members': + get: + operationId: GetScrapersIDMembers + tags: + - Users + - ScraperTargets + summary: List all users with member privileges for a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + schema: + type: string + required: true + description: The scraper target ID. + responses: + '200': + description: A list of scraper target members + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMembers" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostScrapersIDMembers + tags: + - Users + - ScraperTargets + summary: Add a member to a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + schema: + type: string + required: true + description: The scraper target ID. + requestBody: + description: User to add as member + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Member added to scraper targets + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMember" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/scrapers/{scraperTargetID}/members/{userID}': + delete: + operationId: DeleteScrapersIDMembersID + tags: + - Users + - ScraperTargets + summary: Remove a member from a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of member to remove. + - in: path + name: scraperTargetID + schema: + type: string + required: true + description: The scraper target ID. + responses: + '204': + description: Member removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/scrapers/{scraperTargetID}/owners': + get: + operationId: GetScrapersIDOwners + tags: + - Users + - ScraperTargets + summary: List all owners of a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + schema: + type: string + required: true + description: The scraper target ID. + responses: + '200': + description: A list of scraper target owners + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwners" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostScrapersIDOwners + tags: + - Users + - ScraperTargets + summary: Add an owner to a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: scraperTargetID + schema: + type: string + required: true + description: The scraper target ID. + requestBody: + description: User to add as owner + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Scraper target owner added + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwner" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/scrapers/{scraperTargetID}/owners/{userID}': + delete: + operationId: DeleteScrapersIDOwnersID + tags: + - Users + - ScraperTargets + summary: Remove an owner from a scraper target + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of owner to remove. + - in: path + name: scraperTargetID + schema: + type: string + required: true + description: The scraper target ID. + responses: + '204': + description: Owner removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /variables: + get: + operationId: GetVariables + tags: + - Variables + summary: Get all variables + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: org + description: The organization name. + schema: + type: string + - in: query + name: orgID + description: The organization ID. + schema: + type: string + responses: + '200': + description: All variables for an organization + content: + application/json: + schema: + $ref: "#/components/schemas/Variables" + '400': + description: Invalid request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostVariables + summary: Create a variable + tags: + - Variables + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Variable to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Variable" + responses: + '201': + description: Variable created + content: + application/json: + schema: + $ref: "#/components/schemas/Variable" + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/variables/{variableID}': + get: + operationId: GetVariablesID + tags: + - Variables + summary: Get a variable + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: variableID + required: true + schema: + type: string + description: The variable ID. + responses: + '200': + description: Variable found + content: + application/json: + schema: + $ref: "#/components/schemas/Variable" + '404': + description: Variable not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteVariablesID + tags: + - Variables + summary: Delete a variable + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: variableID + required: true + schema: + type: string + description: The variable ID. + responses: + '204': + description: Variable deleted + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchVariablesID + summary: Update a variable + tags: + - Variables + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: variableID + required: true + schema: + type: string + description: The variable ID. + requestBody: + description: Variable update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Variable" + responses: + '200': + description: Variable updated + content: + application/json: + schema: + $ref: "#/components/schemas/Variable" + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + put: + operationId: PutVariablesID + summary: Replace a variable + tags: + - Variables + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: variableID + required: true + schema: + type: string + description: The variable ID. + requestBody: + description: Variable to replace + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Variable" + responses: + '200': + description: Variable updated + content: + application/json: + schema: + $ref: "#/components/schemas/Variable" + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/variables/{variableID}/labels': + get: + operationId: GetVariablesIDLabels + tags: + - Variables + summary: List all labels for a variable + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: variableID + schema: + type: string + required: true + description: The variable ID. + responses: + '200': + description: A list of all labels for a variable + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostVariablesIDLabels + tags: + - Variables + summary: Add a label to a variable + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: variableID + schema: + type: string + required: true + description: The variable ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: The newly added label + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/variables/{variableID}/labels/{labelID}': + delete: + operationId: DeleteVariablesIDLabelsID + tags: + - Variables + summary: Delete a label from a variable + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: variableID + schema: + type: string + required: true + description: The variable ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The label ID to delete. + responses: + '204': + description: Delete has been accepted + '404': + description: Variable not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /write: + post: + operationId: PostWrite + tags: + - Write + summary: Write time series data into InfluxDB + requestBody: + description: Line protocol body + required: true + content: + text/plain: + schema: + type: string + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: header + name: Content-Encoding + description: When present, its value indicates to the database that compression is applied to the line-protocol body. + schema: + type: string + description: Specifies that the line protocol in the body is encoded with gzip or not encoded with identity. + default: identity + enum: + - gzip + - identity + - in: header + name: Content-Type + description: Content-Type is used to indicate the format of the data sent to the server. + schema: + type: string + description: Text/plain specifies the text line protocol; charset is assumed to be utf-8. + default: text/plain; charset=utf-8 + enum: + - text/plain + - text/plain; charset=utf-8 + - application/vnd.influx.arrow + - in: header + name: Content-Length + description: Content-Length is an entity header is indicating the size of the entity-body, in bytes, sent to the database. If the length is greater than the database max body configuration option, a 413 response is sent. + schema: + type: integer + description: The length in decimal number of octets. + - in: header + name: Accept + description: Specifies the return content format. + schema: + type: string + description: The return format for errors. + default: application/json + enum: + - application/json + - in: query + name: org + description: Specifies the destination organization for writes. Takes either the ID or Name interchangeably. If both `orgID` and `org` are specified, `org` takes precedence. + required: true + schema: + type: string + description: All points within batch are written to this organization. + - in: query + name: orgID + description: Specifies the ID of the destination organization for writes. If both `orgID` and `org` are specified, `org` takes precedence. + schema: + type: string + - in: query + name: bucket + description: The destination bucket for writes. + required: true + schema: + type: string + description: All points within batch are written to this bucket. + - in: query + name: precision + description: The precision for the unix timestamps within the body line-protocol. + schema: + $ref: "#/components/schemas/WritePrecision" + responses: + '204': + description: Write data is correctly formatted and accepted for writing to the bucket. + '400': + description: Line protocol poorly formed and no points were written. Response can be used to determine the first malformed line in the body line-protocol. All data in body was rejected and not written. + content: + application/json: + schema: + $ref: "#/components/schemas/LineProtocolError" + '401': + description: Token does not have sufficient permissions to write to this organization and bucket or the organization and bucket do not exist. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '403': + description: No token was sent and they are required. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '413': + description: Write has been rejected because the payload is too large. Error message returns max size supported. All data in body was rejected and not written. + content: + application/json: + schema: + $ref: "#/components/schemas/LineProtocolLengthError" + '429': + description: Token is temporarily over quota. The Retry-After header describes when to try the write again. + headers: + Retry-After: + description: A non-negative decimal integer indicating the seconds to delay after the response is received. + schema: + type: integer + format: int32 + '503': + description: Server is temporarily unavailable to accept writes. The Retry-After header describes when to try the write again. + headers: + Retry-After: + description: A non-negative decimal integer indicating the seconds to delay after the response is received. + schema: + type: integer + format: int32 + default: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /delete: + post: + summary: Delete time series data from InfluxDB + requestBody: + description: Predicate delete request + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/DeletePredicateRequest" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: org + description: Specifies the organization to delete data from. + schema: + type: string + description: Only points from this organization are deleted. + - in: query + name: bucket + description: Specifies the bucket to delete data from. + schema: + type: string + description: Only points from this bucket are deleted. + - in: query + name: orgID + description: Specifies the organization ID of the resource. + schema: + type: string + - in: query + name: bucketID + description: Specifies the bucket ID to delete data from. + schema: + type: string + description: Only points from this bucket ID are deleted. + responses: + '204': + description: delete has been accepted + '400': + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '404': + description: the bucket or organization is not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '403': + description: no token was sent or does not have sufficient permissions. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /ready: + servers: + - url: / + get: + operationId: GetReady + tags: + - Ready + summary: Get the readiness of an instance at startup + parameters: + - $ref: '#/components/parameters/TraceSpan' + responses: + '200': + description: The instance is ready + content: + application/json: + schema: + $ref: "#/components/schemas/Ready" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /health: + servers: + - url: / + get: + operationId: GetHealth + tags: + - Health + summary: Get the health of an instance + parameters: + - $ref: '#/components/parameters/TraceSpan' + responses: + '200': + description: The instance is healthy + content: + application/json: + schema: + $ref: "#/components/schemas/HealthCheck" + '503': + description: The instance is unhealthy + content: + application/json: + schema: + $ref: "#/components/schemas/HealthCheck" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /sources: + post: + operationId: PostSources + tags: + - Sources + summary: Creates a source + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Source to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Source" + responses: + '201': + description: Created Source + content: + application/json: + schema: + $ref: "#/components/schemas/Source" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + get: + operationId: GetSources + tags: + - Sources + summary: Get all sources + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: org + description: The organization name. + schema: + type: string + responses: + '200': + description: All sources + content: + application/json: + schema: + $ref: "#/components/schemas/Sources" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /sources/{sourceID}: + delete: + operationId: DeleteSourcesID + tags: + - Sources + summary: Delete a source + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: sourceID + schema: + type: string + required: true + description: The source ID. + responses: + '204': + description: Delete has been accepted + '404': + description: View not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchSourcesID + tags: + - Sources + summary: Update a Source + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: sourceID + schema: + type: string + required: true + description: The source ID. + requestBody: + description: Source update + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Source" + responses: + '200': + description: Created Source + content: + application/json: + schema: + $ref: "#/components/schemas/Source" + '404': + description: Source not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + get: + operationId: GetSourcesID + tags: + - Sources + summary: Get a source + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: sourceID + schema: + type: string + required: true + description: The source ID. + responses: + '200': + description: A source + content: + application/json: + schema: + $ref: "#/components/schemas/Source" + '404': + description: Source not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /sources/{sourceID}/health: + get: + operationId: GetSourcesIDHealth + tags: + - Sources + summary: Get the health of a source + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: sourceID + schema: + type: string + required: true + description: The source ID. + responses: + '200': + description: The source is healthy + content: + application/json: + schema: + $ref: "#/components/schemas/HealthCheck" + '503': + description: The source is not healthy + content: + application/json: + schema: + $ref: "#/components/schemas/HealthCheck" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /sources/{sourceID}/buckets: + get: + operationId: GetSourcesIDBuckets + tags: + - Sources + - Buckets + summary: Get buckets in a source + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: sourceID + schema: + type: string + required: true + description: The source ID. + - in: query + name: org + description: The organization name. + schema: + type: string + responses: + '200': + description: A source + content: + application/json: + schema: + $ref: "#/components/schemas/Buckets" + '404': + description: Source not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /labels: + post: + operationId: PostLabels + tags: + - Labels + summary: Create a label + requestBody: + description: Label to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelCreateRequest" + responses: + '201': + description: Added label + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + get: + operationId: GetLabels + tags: + - Labels + summary: Get all labels + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: orgID + description: The organization ID. + schema: + type: string + responses: + '200': + description: All labels + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /labels/{labelID}: + get: + operationId: GetLabelsID + tags: + - Labels + summary: Get a label + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: labelID + schema: + type: string + required: true + description: The ID of the label to update. + responses: + '200': + description: A label + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchLabelsID + tags: + - Labels + summary: Update a label + requestBody: + description: Label update + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelUpdate" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: labelID + schema: + type: string + required: true + description: The ID of the label to update. + responses: + '200': + description: Updated label + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + '404': + description: Label not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteLabelsID + tags: + - Labels + summary: Delete a label + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: labelID + schema: + type: string + required: true + description: The ID of the label to delete. + responses: + '204': + description: Delete has been accepted + '404': + description: Label not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /dashboards: + post: + operationId: PostDashboards + tags: + - Dashboards + summary: Create a dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Dashboard to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateDashboardRequest" + responses: + '201': + description: Added dashboard + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/Dashboard" + - $ref: "#/components/schemas/DashboardWithViewProperties" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + get: + operationId: GetDashboards + tags: + - Dashboards + summary: Get all dashboards + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: owner + description: The owner ID. + schema: + type: string + - in: query + name: sortBy + description: The column to sort by. + schema: + type: string + enum: + - "ID" + - "CreatedAt" + - "UpdatedAt" + - in: query + name: id + description: List of dashboard IDs to return. If both `id and `owner` are specified, only `id` is used. + schema: + type: array + items: + type: string + - in: query + name: orgID + description: The organization ID. + schema: + type: string + - in: query + name: org + description: The organization name. + schema: + type: string + responses: + '200': + description: All dashboards + content: + application/json: + schema: + $ref: "#/components/schemas/Dashboards" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}': + get: + operationId: GetDashboardsID + tags: + - Dashboards + summary: Get a Dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The ID of the dashboard to update. + - in: query + name: include + required: false + schema: + type: string + enum: + - properties + description: Includes the cell view properties in the response if set to `properties` + responses: + '200': + description: Get a single dashboard + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/Dashboard" + - $ref: "#/components/schemas/DashboardWithViewProperties" + '404': + description: Dashboard not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchDashboardsID + tags: + - Dashboards + summary: Update a dashboard + requestBody: + description: Patching of a dashboard + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Dashboard" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The ID of the dashboard to update. + responses: + '200': + description: Updated dashboard + content: + application/json: + schema: + $ref: "#/components/schemas/Dashboard" + '404': + description: Dashboard not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteDashboardsID + tags: + - Dashboards + summary: Delete a dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The ID of the dashboard to update. + responses: + '204': + description: Delete has been accepted + '404': + description: Dashboard not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}/cells': + put: + operationId: PutDashboardsIDCells + tags: + - Cells + - Dashboards + summary: Replace cells in a dashboard + description: Replaces all cells in a dashboard. This is used primarily to update the positional information of all cells. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Cells" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The ID of the dashboard to update. + responses: + '201': + description: Replaced dashboard cells + content: + application/json: + schema: + $ref: "#/components/schemas/Dashboard" + '404': + description: Dashboard not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostDashboardsIDCells + tags: + - Cells + - Dashboards + summary: Create a dashboard cell + requestBody: + description: Cell that will be added + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateCell" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The ID of the dashboard to update. + responses: + '201': + description: Cell successfully added + content: + application/json: + schema: + $ref: "#/components/schemas/Cell" + '404': + description: Dashboard not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}/cells/{cellID}': + patch: + operationId: PatchDashboardsIDCellsID + tags: + - Cells + - Dashboards + summary: Update the non-positional information related to a cell + description: Updates the non positional information related to a cell. Updates to a single cell's positional data could cause grid conflicts. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CellUpdate" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The ID of the dashboard to update. + - in: path + name: cellID + schema: + type: string + required: true + description: The ID of the cell to update. + responses: + '200': + description: Updated dashboard cell + content: + application/json: + schema: + $ref: "#/components/schemas/Cell" + '404': + description: Cell or dashboard not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteDashboardsIDCellsID + tags: + - Cells + - Dashboards + summary: Delete a dashboard cell + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The ID of the dashboard to delete. + - in: path + name: cellID + schema: + type: string + required: true + description: The ID of the cell to delete. + responses: + '204': + description: Cell successfully deleted + '404': + description: Cell or dashboard not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}/cells/{cellID}/view': + get: + operationId: GetDashboardsIDCellsIDView + tags: + - Cells + - Dashboards + - Views + summary: Retrieve the view for a cell + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The dashboard ID. + - in: path + name: cellID + schema: + type: string + required: true + description: The cell ID. + responses: + '200': + description: A dashboard cells view + content: + application/json: + schema: + $ref: "#/components/schemas/View" + '404': + description: Cell or dashboard not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchDashboardsIDCellsIDView + tags: + - Cells + - Dashboards + - Views + summary: Update the view for a cell + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/View" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The ID of the dashboard to update. + - in: path + name: cellID + schema: + type: string + required: true + description: The ID of the cell to update. + responses: + '200': + description: Updated cell view + content: + application/json: + schema: + $ref: "#/components/schemas/View" + '404': + description: Cell or dashboard not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}/labels': + get: + operationId: GetDashboardsIDLabels + tags: + - Dashboards + summary: list all labels for a dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The dashboard ID. + responses: + '200': + description: A list of all labels for a dashboard + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostDashboardsIDLabels + tags: + - Dashboards + summary: Add a label to a dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The dashboard ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: The label added to the dashboard + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}/labels/{labelID}': + delete: + operationId: DeleteDashboardsIDLabelsID + tags: + - Dashboards + summary: Delete a label from a dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The dashboard ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The ID of the label to delete. + responses: + '204': + description: Delete has been accepted + '404': + description: Dashboard not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}/members': + get: + operationId: GetDashboardsIDMembers + tags: + - Users + - Dashboards + summary: List all dashboard members + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The dashboard ID. + responses: + '200': + description: A list of users who have member privileges for a dashboard + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMembers" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostDashboardsIDMembers + tags: + - Users + - Dashboards + summary: Add a member to a dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The dashboard ID. + requestBody: + description: User to add as member + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Added to dashboard members + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMember" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}/members/{userID}': + delete: + operationId: DeleteDashboardsIDMembersID + tags: + - Users + - Dashboards + summary: Remove a member from a dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the member to remove. + - in: path + name: dashboardID + schema: + type: string + required: true + description: The dashboard ID. + responses: + '204': + description: Member removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}/owners': + get: + operationId: GetDashboardsIDOwners + tags: + - Users + - Dashboards + summary: List all dashboard owners + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The dashboard ID. + responses: + '200': + description: A list of users who have owner privileges for a dashboard + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwners" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostDashboardsIDOwners + tags: + - Users + - Dashboards + summary: Add an owner to a dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: dashboardID + schema: + type: string + required: true + description: The dashboard ID. + requestBody: + description: User to add as owner + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Added to dashboard owners + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwner" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}/owners/{userID}': + delete: + operationId: DeleteDashboardsIDOwnersID + tags: + - Users + - Dashboards + summary: Remove an owner from a dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the owner to remove. + - in: path + name: dashboardID + schema: + type: string + required: true + description: The dashboard ID. + responses: + '204': + description: Owner removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/dashboards/{dashboardID}/logs': + get: + operationId: GetDashboardsIDLogs + tags: + - Dashboards + - OperationLogs + summary: Retrieve operation logs for a dashboard + parameters: + - $ref: '#/components/parameters/TraceSpan' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Limit' + - in: path + name: dashboardID + required: true + description: The dashboard ID. + schema: + type: string + responses: + '200': + description: Operation logs for the dashboard + content: + application/json: + schema: + $ref: "#/components/schemas/OperationLogs" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /query/ast: + post: + operationId: PostQueryAst + description: Analyzes flux query and generates a query specification. + tags: + - Query + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: header + name: Content-Type + schema: + type: string + enum: + - application/json + requestBody: + description: Analyzed Flux query to generate abstract syntax tree. + content: + application/json: + schema: + $ref: "#/components/schemas/LanguageRequest" + responses: + '200': + description: Abstract syntax tree of flux query. + content: + application/json: + schema: + $ref: "#/components/schemas/ASTResponse" + default: + description: Any response other than 200 is an internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /query/suggestions: + get: + operationId: GetQuerySuggestions + tags: + - Query + parameters: + - $ref: '#/components/parameters/TraceSpan' + responses: + '200': + description: Suggestions for next functions in call chain + content: + application/json: + schema: + $ref: "#/components/schemas/FluxSuggestions" + default: + description: Any response other than 200 is an internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/query/suggestions/{name}': + get: + operationId: GetQuerySuggestionsName + tags: + - Query + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: name + schema: + type: string + required: true + description: The name of the branching suggestion. + responses: + '200': + description: Suggestions for next functions in call chain + content: + application/json: + schema: + $ref: "#/components/schemas/FluxSuggestion" + default: + description: Any response other than 200 is an internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /authorizations: + get: + operationId: GetAuthorizations + tags: + - Authorizations + summary: List all authorizations + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: userID + schema: + type: string + description: Only show authorizations that belong to a user ID. + - in: query + name: user + schema: + type: string + description: Only show authorizations that belong to a user name. + - in: query + name: orgID + schema: + type: string + description: Only show authorizations that belong to an organization ID. + - in: query + name: org + schema: + type: string + description: Only show authorizations that belong to a organization name. + responses: + '200': + description: A list of authorizations + content: + application/json: + schema: + $ref: "#/components/schemas/Authorizations" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostAuthorizations + tags: + - Authorizations + summary: Create an authorization + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Authorization to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Authorization" + responses: + '201': + description: Authorization created + content: + application/json: + schema: + $ref: "#/components/schemas/Authorization" + '400': + description: Invalid request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /authorizations/{authID}: + get: + operationId: GetAuthorizationsID + tags: + - Authorizations + summary: Retrieve an authorization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: authID + schema: + type: string + required: true + description: The ID of the authorization to get. + responses: + '200': + description: Authorization details + content: + application/json: + schema: + $ref: "#/components/schemas/Authorization" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchAuthorizationsID + tags: + - Authorizations + summary: Update an authorization to be active or inactive + requestBody: + description: Authorization to update + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AuthorizationUpdateRequest" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: authID + schema: + type: string + required: true + description: The ID of the authorization to update. + responses: + '200': + description: The active or inactie authorization + content: + application/json: + schema: + $ref: "#/components/schemas/Authorization" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteAuthorizationsID + tags: + - Authorizations + summary: Delete a authorization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: authID + schema: + type: string + required: true + description: The ID of the authorization to delete. + responses: + '204': + description: Authorization deleted + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /query/analyze: + post: + operationId: PostQueryAnalyze + tags: + - Query + summary: Analyze an InfluxQL or Flux query + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: header + name: Content-Type + schema: + type: string + enum: + - application/json + requestBody: + description: Flux or InfluxQL query to analyze + content: + application/json: + schema: + $ref: "#/components/schemas/Query" + responses: + '200': + description: Query analyze results. Errors will be empty if the query is valid. + content: + application/json: + schema: + $ref: "#/components/schemas/AnalyzeQueryResponse" + default: + description: Internal server error + headers: + X-Influx-Error: + description: Error string describing the problem + schema: + type: string + X-Influx-Reference: + description: Reference code unique to the error type + schema: + type: integer + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /query: + post: + operationId: PostQuery + tags: + - Query + summary: Query InfluxDB + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: header + name: Accept-Encoding + description: The Accept-Encoding request HTTP header advertises which content encoding, usually a compression algorithm, the client is able to understand. + schema: + type: string + description: Specifies that the query response in the body should be encoded with gzip or not encoded with identity. + default: identity + enum: + - gzip + - identity + - in: header + name: Content-Type + schema: + type: string + enum: + - application/json + - application/vnd.flux + - in: query + name: org + description: Specifies the name of the organization executing the query. Takes either the ID or Name interchangeably. If both `orgID` and `org` are specified, `org` takes precedence. + schema: + type: string + - in: query + name: orgID + description: Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. + schema: + type: string + requestBody: + description: Flux query or specification to execute + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/Query" + - $ref: "#/components/schemas/InfluxQLQuery" + application/vnd.flux: + schema: + type: string + responses: + '200': + description: Query results + headers: + Content-Encoding: + description: The Content-Encoding entity header is used to compress the media-type. When present, its value indicates which encodings were applied to the entity-body + schema: + type: string + description: Specifies that the response in the body is encoded with gzip or not encoded with identity. + default: identity + enum: + - gzip + - identity + Trace-Id: + description: The Trace-Id header reports the request's trace ID, if one was generated. + schema: + type: string + description: Specifies the request's trace ID. + content: + text/csv: + schema: + type: string + example: > + result,table,_start,_stop,_time,region,host,_value + mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:00Z,east,A,15.43 + mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:20Z,east,B,59.25 + mean,0,2018-05-08T20:50:00Z,2018-05-08T20:51:00Z,2018-05-08T20:50:40Z,east,C,52.62 + application/vnd.influx.arrow: + schema: + type: string + format: binary + '429': + description: Token is temporarily over quota. The Retry-After header describes when to try the read again. + headers: + Retry-After: + description: A non-negative decimal integer indicating the seconds to delay after the response is received. + schema: + type: integer + format: int32 + default: + description: Error processing query + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /buckets: + get: + operationId: GetBuckets + tags: + - Buckets + summary: List all buckets + parameters: + - $ref: '#/components/parameters/TraceSpan' + - $ref: "#/components/parameters/Offset" + - $ref: "#/components/parameters/Limit" + - in: query + name: org + description: The organization name. + schema: + type: string + - in: query + name: orgID + description: The organization ID. + schema: + type: string + - in: query + name: name + description: Only returns buckets with a specific name. + schema: + type: string + responses: + '200': + description: A list of buckets + content: + application/json: + schema: + $ref: "#/components/schemas/Buckets" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostBuckets + tags: + - Buckets + summary: Create a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Bucket to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostBucketRequest" + responses: + '201': + description: Bucket created + content: + application/json: + schema: + $ref: "#/components/schemas/Bucket" + 422: + description: Request body failed validation + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/buckets/{bucketID}': + get: + operationId: GetBucketsID + tags: + - Buckets + summary: Retrieve a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + responses: + '200': + description: Bucket details + content: + application/json: + schema: + $ref: "#/components/schemas/Bucket" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchBucketsID + tags: + - Buckets + summary: Update a bucket + requestBody: + description: Bucket update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Bucket" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + responses: + '200': + description: An updated bucket + content: + application/json: + schema: + $ref: "#/components/schemas/Bucket" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteBucketsID + tags: + - Buckets + summary: Delete a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: bucketID + schema: + type: string + required: true + description: The ID of the bucket to delete. + responses: + '204': + description: Delete has been accepted + '404': + description: Bucket not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/buckets/{bucketID}/labels': + get: + operationId: GetBucketsIDLabels + tags: + - Buckets + summary: List all labels for a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + responses: + '200': + description: A list of all labels for a bucket + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostBucketsIDLabels + tags: + - Buckets + summary: Add a label to a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: The newly added label + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/buckets/{bucketID}/labels/{labelID}': + delete: + operationId: DeleteBucketsIDLabelsID + tags: + - Buckets + summary: delete a label from a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The ID of the label to delete. + responses: + '204': + description: Delete has been accepted + '404': + description: Bucket not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/buckets/{bucketID}/members': + get: + operationId: GetBucketsIDMembers + tags: + - Users + - Buckets + summary: List all users with member privileges for a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + responses: + '200': + description: A list of bucket members + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMembers" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostBucketsIDMembers + tags: + - Users + - Buckets + summary: Add a member to a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + requestBody: + description: User to add as member + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Member added to bucket + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMember" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/buckets/{bucketID}/members/{userID}': + delete: + operationId: DeleteBucketsIDMembersID + tags: + - Users + - Buckets + summary: Remove a member from a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the member to remove. + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + responses: + '204': + description: Member removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/buckets/{bucketID}/owners': + get: + operationId: GetBucketsIDOwners + tags: + - Users + - Buckets + summary: List all owners of a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + responses: + '200': + description: A list of bucket owners + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwners" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostBucketsIDOwners + tags: + - Users + - Buckets + summary: Add an owner to a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + requestBody: + description: User to add as owner + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Bucket owner added + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwner" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/buckets/{bucketID}/owners/{userID}': + delete: + operationId: DeleteBucketsIDOwnersID + tags: + - Users + - Buckets + summary: Remove an owner from a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the owner to remove. + - in: path + name: bucketID + schema: + type: string + required: true + description: The bucket ID. + responses: + '204': + description: Owner removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/buckets/{bucketID}/logs': + get: + operationId: GetBucketsIDLogs + tags: + - Buckets + - OperationLogs + summary: Retrieve operation logs for a bucket + parameters: + - $ref: '#/components/parameters/TraceSpan' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Limit' + - in: path + name: bucketID + required: true + description: The bucket ID. + schema: + type: string + responses: + '200': + description: Operation logs for the bucket + content: + application/json: + schema: + $ref: "#/components/schemas/OperationLogs" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /orgs: + get: + operationId: GetOrgs + tags: + - Organizations + summary: List all organizations + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: org + schema: + type: string + description: Filter organizations to a specific organization name. + - in: query + name: orgID + schema: + type: string + description: Filter organizations to a specific organization ID. + responses: + '200': + description: A list of organizations + content: + application/json: + schema: + $ref: "#/components/schemas/Organizations" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostOrgs + tags: + - Organizations + summary: Create an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Organization to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Organization" + responses: + '201': + description: Organization created + content: + application/json: + schema: + $ref: "#/components/schemas/Organization" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}': + get: + operationId: GetOrgsID + tags: + - Organizations + summary: Retrieve an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The ID of the organization to get. + responses: + '200': + description: Organization details + content: + application/json: + schema: + $ref: "#/components/schemas/Organization" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchOrgsID + tags: + - Organizations + summary: Update an organization + requestBody: + description: Organization update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Organization" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The ID of the organization to get. + responses: + '200': + description: Organization updated + content: + application/json: + schema: + $ref: "#/components/schemas/Organization" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteOrgsID + tags: + - Organizations + summary: Delete an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The ID of the organization to delete. + responses: + '204': + description: Delete has been accepted + '404': + description: Organization not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}/labels': + get: + operationId: GetOrgsIDLabels + tags: + - Organizations + summary: List all labels for a organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + responses: + '200': + description: A list of all labels for an organization + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostOrgsIDLabels + tags: + - Organizations + summary: Add a label to an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: Returns the created label + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}/labels/{labelID}': + delete: + operationId: DeleteOrgsIDLabelsID + tags: + - Organizations + summary: Delete a label from an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The label ID. + responses: + '204': + description: Delete has been accepted + '404': + description: Organization not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}/secrets': + get: + operationId: GetOrgsIDSecrets + tags: + - Secrets + - Organizations + summary: List all secret keys for an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + responses: + '200': + description: A list of all secret keys + content: + application/json: + schema: + $ref: "#/components/schemas/SecretKeysResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchOrgsIDSecrets + tags: + - Secrets + - Organizations + summary: Update secrets in an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + requestBody: + description: Secret key value pairs to update/add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Secrets" + responses: + '204': + description: Keys successfully patched + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}/secrets/delete': # had to make this because swagger wouldn't let me have a request body with a DELETE + post: + operationId: PostOrgsIDSecrets + tags: + - Secrets + - Organizations + summary: Delete secrets from an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + requestBody: + description: Secret key to delete + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SecretKeys" + responses: + '204': + description: Keys successfully patched + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}/members': + get: + operationId: GetOrgsIDMembers + tags: + - Users + - Organizations + summary: List all members of an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + responses: + '200': + description: A list of organization members + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMembers" + '404': + description: Organization not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostOrgsIDMembers + tags: + - Users + - Organizations + summary: Add a member to an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + requestBody: + description: User to add as member + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Added to organization created + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMember" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}/members/{userID}': + delete: + operationId: DeleteOrgsIDMembersID + tags: + - Users + - Organizations + summary: Remove a member from an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the member to remove. + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + responses: + '204': + description: Member removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}/owners': + get: + operationId: GetOrgsIDOwners + tags: + - Users + - Organizations + summary: List all owners of an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + responses: + '200': + description: A list of organization owners + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwners" + '404': + description: Organization not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostOrgsIDOwners + tags: + - Users + - Organizations + summary: Add an owner to an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + requestBody: + description: User to add as owner + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Organization owner added + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwner" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}/owners/{userID}': + delete: + operationId: DeleteOrgsIDOwnersID + tags: + - Users + - Organizations + summary: Remove an owner from an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the owner to remove. + - in: path + name: orgID + schema: + type: string + required: true + description: The organization ID. + responses: + '204': + description: Owner removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/orgs/{orgID}/logs': + get: + operationId: GetOrgsIDLogs + tags: + - Organizations + - OperationLogs + summary: Retrieve operation logs for an organization + parameters: + - $ref: '#/components/parameters/TraceSpan' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Limit' + - in: path + name: orgID + required: true + description: The organization ID. + schema: + type: string + responses: + '200': + description: Operation logs for the organization + content: + application/json: + schema: + $ref: "#/components/schemas/OperationLogs" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /packages: + post: + operationId: CreatePkg + tags: + - InfluxPackages + summary: Create a new Influx package + requestBody: + description: Influx package to create. + required: false + content: + application/json: + schema: + $ref: "#/components/schemas/PkgCreate" + responses: + '200': + description: Influx package created + content: + application/json: + schema: + $ref: "#/components/schemas/Pkg" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /packages/apply: + post: + operationId: ApplyPkg + tags: + - InfluxPackages + summary: Apply or dry-run an Influx package + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PkgApply" + application/x-jsonnet: + schema: + $ref: "#/components/schemas/PkgApply" + text/yml: + schema: + $ref: "#/components/schemas/PkgApply" + responses: + '200': + description: > + Influx package dry-run successful, no new resources created. + The provided diff and summary will not have IDs for resources + that do not exist at the time of the dry run. + content: + application/json: + schema: + $ref: "#/components/schemas/PkgSummary" + '201': + description: > + Influx package applied successfully. Newly created resources created + available in summary. The diff compares the state of the world before + the package is applied with the changes the application will impose. + This corresponds to `"dryRun": true` + content: + application/json: + schema: + $ref: "#/components/schemas/PkgSummary" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /tasks: + get: + operationId: GetTasks + tags: + - Tasks + summary: List all tasks + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: query + name: name + description: Returns task with a specific name. + schema: + type: string + - in: query + name: after + schema: + type: string + description: Return tasks after a specified ID. + - in: query + name: user + schema: + type: string + description: Filter tasks to a specific user ID. + - in: query + name: org + schema: + type: string + description: Filter tasks to a specific organization name. + - in: query + name: orgID + schema: + type: string + description: Filter tasks to a specific organization ID. + - in: query + name: status + schema: + type: string + enum: + - active + - inactive + description: Filter tasks by a status--"inactive" or "active". + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + description: The number of tasks to return + responses: + '200': + description: A list of tasks + content: + application/json: + schema: + $ref: "#/components/schemas/Tasks" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostTasks + tags: + - Tasks + summary: Create a new task + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: Task to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/TaskCreateRequest" + responses: + '201': + description: Task created + content: + application/json: + schema: + $ref: "#/components/schemas/Task" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}': + get: + operationId: GetTasksID + tags: + - Tasks + summary: Retrieve a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + responses: + '200': + description: Task details + content: + application/json: + schema: + $ref: "#/components/schemas/Task" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchTasksID + tags: + - Tasks + summary: Update a task + description: Update a task. This will cancel all queued runs. + requestBody: + description: Task update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/TaskUpdateRequest" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + responses: + '200': + description: Task updated + content: + application/json: + schema: + $ref: "#/components/schemas/Task" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteTasksID + tags: + - Tasks + summary: Delete a task + description: Deletes a task and all associated records + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The ID of the task to delete. + responses: + '204': + description: Task deleted + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/runs': + get: + operationId: GetTasksIDRuns + tags: + - Tasks + summary: List runs for a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The ID of the task to get runs for. + - in: query + name: after + schema: + type: string + description: Returns runs after a specific ID. + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + description: The number of runs to return + - in: query + name: afterTime + schema: + type: string + format: date-time + description: Filter runs to those scheduled after this time, RFC3339 + - in: query + name: beforeTime + schema: + type: string + format: date-time + description: Filter runs to those scheduled before this time, RFC3339 + responses: + '200': + description: A list of task runs + content: + application/json: + schema: + $ref: "#/components/schemas/Runs" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostTasksIDRuns + tags: + - Tasks + summary: Manually start a task run, overriding the current schedule + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/RunManually" + responses: + '201': + description: Run scheduled to start + content: + application/json: + schema: + $ref: "#/components/schemas/Run" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/runs/{runID}': + get: + operationId: GetTasksIDRunsID + tags: + - Tasks + summary: Retrieve a single run for a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + - in: path + name: runID + schema: + type: string + required: true + description: The run ID. + responses: + '200': + description: The run record + content: + application/json: + schema: + $ref: "#/components/schemas/Run" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteTasksIDRunsID + tags: + - Tasks + summary: Cancel a running task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + - in: path + name: runID + schema: + type: string + required: true + description: The run ID. + responses: + '204': + description: Delete has been accepted + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/runs/{runID}/retry': + post: + operationId: PostTasksIDRunsIDRetry + tags: + - Tasks + summary: Retry a task run + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + - in: path + name: runID + schema: + type: string + required: true + description: The run ID. + responses: + '200': + description: Run that has been queued + content: + application/json: + schema: + $ref: "#/components/schemas/Run" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/logs': + get: + operationId: GetTasksIDLogs + tags: + - Tasks + summary: Retrieve all logs for a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + responses: + '200': + description: All logs for a task + content: + application/json: + schema: + $ref: "#/components/schemas/Logs" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/runs/{runID}/logs': + get: + operationId: GetTasksIDRunsIDLogs + tags: + - Tasks + summary: Retrieve all logs for a run + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: ID of task to get logs for. + - in: path + name: runID + schema: + type: string + required: true + description: ID of run to get logs for. + responses: + '200': + description: All logs for a run + content: + application/json: + schema: + $ref: "#/components/schemas/Logs" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/labels': + get: + operationId: GetTasksIDLabels + tags: + - Tasks + summary: List all labels for a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + responses: + '200': + description: A list of all labels for a task + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostTasksIDLabels + tags: + - Tasks + summary: Add a label to a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: A list of all labels for a task + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/labels/{labelID}': + delete: + operationId: DeleteTasksIDLabelsID + tags: + - Tasks + summary: Delete a label from a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The label ID. + responses: + '204': + description: Delete has been accepted + '404': + description: Task not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /me: + get: + operationId: GetMe + tags: + - Users + summary: Return the current authenticated user + parameters: + - $ref: '#/components/parameters/TraceSpan' + responses: + '200': + description: Currently authenticated user + content: + application/json: + schema: + $ref: "#/components/schemas/User" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /me/password: + put: + operationId: PutMePassword + tags: + - Users + summary: Update a password + security: + - BasicAuth: [] + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: New password + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PasswordResetBody" + responses: + '204': + description: Password successfully updated + default: + description: Unsuccessful authentication + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/members': + get: + operationId: GetTasksIDMembers + tags: + - Users + - Tasks + summary: List all task members + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + responses: + '200': + description: A list of users who have member privileges for a task + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMembers" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostTasksIDMembers + tags: + - Users + - Tasks + summary: Add a member to a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + requestBody: + description: User to add as member + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Added to task members + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceMember" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/members/{userID}': + delete: + operationId: DeleteTasksIDMembersID + tags: + - Users + - Tasks + summary: Remove a member from a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the member to remove. + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + responses: + '204': + description: Member removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/owners': + get: + operationId: GetTasksIDOwners + tags: + - Users + - Tasks + summary: List all owners of a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + responses: + '200': + description: A list of users who have owner privileges for a task + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwners" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostTasksIDOwners + tags: + - Users + - Tasks + summary: Add an owner to a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + requestBody: + description: User to add as owner + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AddResourceMemberRequestBody" + responses: + '201': + description: Added to task owners + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceOwner" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/tasks/{taskID}/owners/{userID}': + delete: + operationId: DeleteTasksIDOwnersID + tags: + - Users + - Tasks + summary: Remove an owner from a task + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the owner to remove. + - in: path + name: taskID + schema: + type: string + required: true + description: The task ID. + responses: + '204': + description: Owner removed + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /users: + get: + operationId: GetUsers + tags: + - Users + summary: List all users + parameters: + - $ref: '#/components/parameters/TraceSpan' + responses: + '200': + description: A list of users + content: + application/json: + schema: + $ref: "#/components/schemas/Users" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostUsers + tags: + - Users + summary: Create a user + parameters: + - $ref: '#/components/parameters/TraceSpan' + requestBody: + description: User to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/User" + responses: + '201': + description: User created + content: + application/json: + schema: + $ref: "#/components/schemas/User" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/users/{userID}': + get: + operationId: GetUsersID + tags: + - Users + summary: Retrieve a user + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The user ID. + responses: + '200': + description: User details + content: + application/json: + schema: + $ref: "#/components/schemas/User" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchUsersID + tags: + - Users + summary: Update a user + requestBody: + description: User update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/User" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the user to update. + responses: + '200': + description: User updated + content: + application/json: + schema: + $ref: "#/components/schemas/User" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteUsersID + tags: + - Users + summary: Delete a user + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The ID of the user to delete. + responses: + '204': + description: User deleted + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/users/{userID}/password': + put: + operationId: PutUsersIDPassword + tags: + - Users + summary: Update a password + security: + - BasicAuth: [] + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: userID + schema: + type: string + required: true + description: The user ID. + requestBody: + description: New password + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PasswordResetBody" + responses: + '204': + description: Password successfully updated + default: + description: Unsuccessful authentication + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/users/{userID}/logs': + get: + operationId: GetUsersIDLogs + tags: + - Users + - OperationLogs + summary: Retrieve operation logs for a user + parameters: + - $ref: '#/components/parameters/TraceSpan' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Limit' + - in: path + name: userID + required: true + description: The user ID. + schema: + type: string + responses: + '200': + description: Operation logs for the user + content: + application/json: + schema: + $ref: "#/components/schemas/OperationLogs" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /checks: + get: + operationId: GetChecks + tags: + - Checks + summary: Get all checks + parameters: + - $ref: '#/components/parameters/TraceSpan' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Limit' + - in: query + name: orgID + required: true + description: Only show checks that belong to a specific organization ID. + schema: + type: string + responses: + '200': + description: A list of checks + content: + application/json: + schema: + $ref: "#/components/schemas/Checks" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: CreateCheck + tags: + - Checks + summary: Add new check + requestBody: + description: Check to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostCheck" + responses: + '201': + description: Check created + content: + application/json: + schema: + $ref: "#/components/schemas/Check" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/checks/{checkID}': + get: + operationId: GetChecksID + tags: + - Checks + summary: Get a check + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: The check ID. + responses: + '200': + description: The check requested + content: + application/json: + schema: + $ref: "#/components/schemas/Check" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + put: + operationId: PutChecksID + tags: + - Checks + summary: Update a check + requestBody: + description: Check update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Check" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: The check ID. + responses: + '200': + description: An updated check + content: + application/json: + schema: + $ref: "#/components/schemas/Check" + '404': + description: The check was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchChecksID + tags: + - Checks + summary: Update a check + requestBody: + description: Check update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CheckPatch" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: The check ID. + responses: + '200': + description: An updated check + content: + application/json: + schema: + $ref: "#/components/schemas/Check" + '404': + description: The check was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteChecksID + tags: + - Checks + summary: Delete a check + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: The check ID. + responses: + '204': + description: Delete has been accepted + '404': + description: The check was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/checks/{checkID}/labels': + get: + operationId: GetChecksIDLabels + tags: + - Checks + summary: List all labels for a check + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: The check ID. + responses: + '200': + description: A list of all labels for a check + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostChecksIDLabels + tags: + - Checks + summary: Add a label to a check + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: The check ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: The label was added to the check + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/checks/{checkID}/labels/{labelID}': + delete: + operationId: DeleteChecksIDLabelsID + tags: + - Checks + summary: Delete label from a check + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: The check ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The ID of the label to delete. + responses: + '204': + description: Delete has been accepted + '404': + description: Check or label not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /notificationRules: + get: + operationId: GetNotificationRules + tags: + - NotificationRules + summary: Get all notification rules + parameters: + - $ref: '#/components/parameters/TraceSpan' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Limit' + - in: query + name: orgID + required: true + description: Only show notification rules that belong to a specific organization ID. + schema: + type: string + - in: query + name: checkID + description: Only show notifications that belong to the specific check ID. + schema: + type: string + - in: query + name: tag + description: Only return notification rules that "would match" statuses which contain the tag key value pairs provided. + schema: + type: string + pattern: ^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+$ + example: env:prod + responses: + '200': + description: A list of notification rules + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRules" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: CreateNotificationRule + tags: + - NotificationRules + summary: Add a notification rule + requestBody: + description: Notification rule to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostNotificationRule" + responses: + '201': + description: Notification rule created + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/checks/{checkID}/query': + get: + operationId: GetChecksIDQuery + tags: + - Checks + summary: Get a check query + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: checkID + schema: + type: string + required: true + description: The check ID. + responses: + '200': + description: The check query requested + content: + application/json: + schema: + $ref: "#/components/schemas/FluxResponse" + '400': + description: Invalid request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '404': + description: Check not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/notificationRules/{ruleID}': + get: + operationId: GetNotificationRulesID + tags: + - NotificationRules + summary: Get a notification rule + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: The notification rule ID. + responses: + '200': + description: The notification rule requested + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + put: + operationId: PutNotificationRulesID + tags: + - NotificationRules + summary: Update a notification rule + requestBody: + description: Notification rule update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: The notification rule ID. + responses: + '200': + description: An updated notification rule + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + '404': + description: The notification rule was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchNotificationRulesID + tags: + - NotificationRules + summary: Update a notification rule + requestBody: + description: Notification rule update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRuleUpdate" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: The notification rule ID. + responses: + '200': + description: An updated notification rule + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationRule" + '404': + description: The notification rule was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteNotificationRulesID + tags: + - NotificationRules + summary: Delete a notification rule + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: The notification rule ID. + responses: + '204': + description: Delete has been accepted + '404': + description: The check was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/notificationRules/{ruleID}/labels': + get: + operationId: GetNotificationRulesIDLabels + tags: + - NotificationRules + summary: List all labels for a notification rule + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: The notification rule ID. + responses: + '200': + description: A list of all labels for a notification rule + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostNotificationRuleIDLabels + tags: + - NotificationRules + summary: Add a label to a notification rule + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: The notification rule ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: The label was added to the notification rule + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/notificationRules/{ruleID}/labels/{labelID}': + delete: + operationId: DeleteNotificationRulesIDLabelsID + tags: + - NotificationRules + summary: Delete label from a notification rule + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: The notification rule ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The ID of the label to delete. + responses: + '204': + description: Delete has been accepted + '404': + description: Rule or label not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/notificationRules/{ruleID}/query': + get: + operationId: GetNotificationRulesIDQuery + tags: + - Rules + summary: Get a notification rule query + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: ruleID + schema: + type: string + required: true + description: The notification rule ID. + responses: + '200': + description: The notification rule query requested + content: + application/json: + schema: + $ref: "#/components/schemas/FluxResponse" + '400': + description: Invalid request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '404': + description: Notification rule not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /notificationEndpoints: + get: + operationId: GetNotificationEndpoints + tags: + - NotificationEndpoints + summary: Get all notification endpoints + parameters: + - $ref: '#/components/parameters/TraceSpan' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Limit' + - in: query + name: orgID + required: true + description: Only show notification endpoints that belong to specific organization ID. + schema: + type: string + responses: + '200': + description: A list of notification endpoints + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoints" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: CreateNotificationEndpoint + tags: + - NotificationEndpoints + summary: Add a notification endpoint + requestBody: + description: Notification endpoint to create + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostNotificationEndpoint" + responses: + '201': + description: Notification endpoint created + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoint" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/notificationEndpoints/{endpointID}': + get: + operationId: GetNotificationEndpointsID + tags: + - NotificationEndpoints + summary: Get a notification endpoint + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: endpointID + schema: + type: string + required: true + description: The notification endpoint ID. + responses: + '200': + description: The notification endpoint requested + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoint" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + put: + operationId: PutNotificationEndpointsID + tags: + - NotificationEndpoints + summary: Update a notification endpoint + requestBody: + description: A new notification endpoint to replace the existing endpoint with + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoint" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: endpointID + schema: + type: string + required: true + description: The notification endpoint ID. + responses: + '200': + description: An updated notification endpoint + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoint" + '404': + description: The notification endpoint was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + operationId: PatchNotificationEndpointsID + tags: + - NotificationEndpoints + summary: Update a notification endpoint + requestBody: + description: Check update to apply + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpointUpdate" + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: endpointID + schema: + type: string + required: true + description: The notification endpoint ID. + responses: + '200': + description: An updated notification endpoint + content: + application/json: + schema: + $ref: "#/components/schemas/NotificationEndpoint" + '404': + description: The notification endpoint was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + operationId: DeleteNotificationEndpointsID + tags: + - NotificationEndpoints + summary: Delete a notification endpoint + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: endpointID + schema: + type: string + required: true + description: The notification endpoint ID. + responses: + '204': + description: Delete has been accepted + '404': + description: The endpoint was not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/notificationEndpoints/{endpointID}/labels': + get: + operationId: GetNotificationEndpointsIDLabels + tags: + - NotificationEndpoints + summary: List all labels for a notification endpoint + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: endpointID + schema: + type: string + required: true + description: The notification endpoint ID. + responses: + '200': + description: A list of all labels for a notification endpoint + content: + application/json: + schema: + $ref: "#/components/schemas/LabelsResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: PostNotificationEndpointIDLabels + tags: + - NotificationEndpoints + summary: Add a label to a notification endpoint + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: endpointID + schema: + type: string + required: true + description: The notification endpoint ID. + requestBody: + description: Label to add + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/LabelMapping" + responses: + '201': + description: The label was added to the notification endpoint + content: + application/json: + schema: + $ref: "#/components/schemas/LabelResponse" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '/notificationEndpoints/{endpointID}/labels/{labelID}': + delete: + operationId: DeleteNotificationEndpointsIDLabelsID + tags: + - NotificationEndpoints + summary: Delete a label from a notification endpoint + parameters: + - $ref: '#/components/parameters/TraceSpan' + - in: path + name: endpointID + schema: + type: string + required: true + description: The notification endpoint ID. + - in: path + name: labelID + schema: + type: string + required: true + description: The ID of the label to delete. + responses: + '204': + description: Delete has been accepted + '404': + description: Endpoint or label not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" +components: + parameters: + Offset: + in: query + name: offset + required: false + schema: + type: integer + minimum: 0 + Limit: + in: query + name: limit + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 20 + Descending: + in: query + name: descending + required: false + schema: + type: boolean + default: false + SortBy: + in: query + name: sortBy + required: false + schema: + type: string + TraceSpan: + in: header + name: Zap-Trace-Span + description: OpenTracing span context + example: + trace_id: '1' + span_id: '1' + baggage: + key: value + required: false + schema: + type: string + schemas: + LanguageRequest: + description: Flux query to be analyzed. + type: object + required: + - query + properties: + query: + description: Flux query script to be analyzed + type: string + Query: + description: Query influx using the Flux language + type: object + required: + - query + properties: + extern: + $ref: "#/components/schemas/File" + query: + description: Query script to execute. + type: string + type: + description: The type of query. Must be "flux". + type: string + enum: + - flux + dialect: + $ref: "#/components/schemas/Dialect" + InfluxQLQuery: + description: Query influx using the InfluxQL language + type: object + required: + - query + properties: + query: + description: InfluxQL query execute. + type: string + type: + description: The type of query. Must be "influxql". + type: string + enum: + - influxql + bucket: + description: Bucket is to be used instead of the database and retention policy specified in the InfluxQL query. + type: string + Package: + description: Represents a complete package source tree. + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + path: + description: Package import path + type: string + package: + description: Package name + type: string + files: + description: Package files + type: array + items: + $ref: "#/components/schemas/File" + File: + description: Represents a source from a single file + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + name: + description: The name of the file. + type: string + package: + $ref: "#/components/schemas/PackageClause" + imports: + description: A list of package imports + type: array + items: + $ref: "#/components/schemas/ImportDeclaration" + body: + description: List of Flux statements + type: array + items: + $ref: "#/components/schemas/Statement" + PackageClause: + description: Defines a package identifier + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + name: + $ref: "#/components/schemas/Identifier" + ImportDeclaration: + description: Declares a package import + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + as: + $ref: "#/components/schemas/Identifier" + path: + $ref: "#/components/schemas/StringLiteral" + DeletePredicateRequest: + description: The delete predicate request. + type: object + required: [start, stop] + properties: + start: + description: RFC3339Nano + type: string + format: date-time + stop: + description: RFC3339Nano + type: string + format: date-time + predicate: + description: InfluxQL-like delete statement + example: tag1="value1" and (tag2="value2" and tag3!="value3") + type: string + Node: + oneOf: + - $ref: "#/components/schemas/Expression" + - $ref: "#/components/schemas/Block" + Block: + description: A set of statements + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + body: + description: Block body + type: array + items: + $ref: "#/components/schemas/Statement" + Statement: + oneOf: + - $ref: "#/components/schemas/BadStatement" + - $ref: "#/components/schemas/VariableAssignment" + - $ref: "#/components/schemas/MemberAssignment" + - $ref: "#/components/schemas/ExpressionStatement" + - $ref: "#/components/schemas/ReturnStatement" + - $ref: "#/components/schemas/OptionStatement" + - $ref: "#/components/schemas/BuiltinStatement" + - $ref: "#/components/schemas/TestStatement" + BadStatement: + description: A placeholder for statements for which no correct statement nodes can be created + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + text: + description: Raw source text + type: string + VariableAssignment: + description: Represents the declaration of a variable + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + id: + $ref: "#/components/schemas/Identifier" + init: + $ref: "#/components/schemas/Expression" + MemberAssignment: + description: Object property assignment + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + member: + $ref: "#/components/schemas/MemberExpression" + init: + $ref: "#/components/schemas/Expression" + ExpressionStatement: + description: May consist of an expression that does not return a value and is executed solely for its side-effects + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + expression: + $ref: "#/components/schemas/Expression" + ReturnStatement: + description: Defines an expression to return + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + argument: + $ref: "#/components/schemas/Expression" + OptionStatement: + description: A single variable declaration + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + assignment: + oneOf: + - $ref: "#/components/schemas/VariableAssignment" + - $ref: "#/components/schemas/MemberAssignment" + BuiltinStatement: + description: Declares a builtin identifier and its type + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + id: + $ref: "#/components/schemas/Identifier" + TestStatement: + description: Declares a Flux test case + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + assignment: + $ref: "#/components/schemas/VariableAssignment" + Expression: + oneOf: + - $ref: "#/components/schemas/ArrayExpression" + - $ref: "#/components/schemas/FunctionExpression" + - $ref: "#/components/schemas/BinaryExpression" + - $ref: "#/components/schemas/CallExpression" + - $ref: "#/components/schemas/ConditionalExpression" + - $ref: "#/components/schemas/LogicalExpression" + - $ref: "#/components/schemas/MemberExpression" + - $ref: "#/components/schemas/IndexExpression" + - $ref: "#/components/schemas/ObjectExpression" + - $ref: "#/components/schemas/ParenExpression" + - $ref: "#/components/schemas/PipeExpression" + - $ref: "#/components/schemas/UnaryExpression" + - $ref: "#/components/schemas/BooleanLiteral" + - $ref: "#/components/schemas/DateTimeLiteral" + - $ref: "#/components/schemas/DurationLiteral" + - $ref: "#/components/schemas/FloatLiteral" + - $ref: "#/components/schemas/IntegerLiteral" + - $ref: "#/components/schemas/PipeLiteral" + - $ref: "#/components/schemas/RegexpLiteral" + - $ref: "#/components/schemas/StringLiteral" + - $ref: "#/components/schemas/UnsignedIntegerLiteral" + - $ref: "#/components/schemas/Identifier" + ArrayExpression: + description: Used to create and directly specify the elements of an array object + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + elements: + description: Elements of the array + type: array + items: + $ref: "#/components/schemas/Expression" + FunctionExpression: + description: Function expression + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + params: + description: Function parameters + type: array + items: + $ref: "#/components/schemas/Property" + body: + $ref: "#/components/schemas/Node" + BinaryExpression: + description: uses binary operators to act on two operands in an expression + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + operator: + type: string + left: + $ref: "#/components/schemas/Expression" + right: + $ref: "#/components/schemas/Expression" + CallExpression: + description: Represents a function call + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + callee: + $ref: "#/components/schemas/Expression" + arguments: + description: Function arguments + type: array + items: + $ref: "#/components/schemas/Expression" + ConditionalExpression: + description: Selects one of two expressions, `Alternate` or `Consequent`, depending on a third boolean expression, `Test` + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + test: + $ref: "#/components/schemas/Expression" + alternate: + $ref: "#/components/schemas/Expression" + consequent: + $ref: "#/components/schemas/Expression" + LogicalExpression: + description: Represents the rule conditions that collectively evaluate to either true or false + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + operator: + type: string + left: + $ref: "#/components/schemas/Expression" + right: + $ref: "#/components/schemas/Expression" + MemberExpression: + description: Represents accessing a property of an object + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + object: + $ref: "#/components/schemas/Expression" + property: + $ref: "#/components/schemas/PropertyKey" + IndexExpression: + description: Represents indexing into an array + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + array: + $ref: "#/components/schemas/Expression" + index: + $ref: "#/components/schemas/Expression" + ObjectExpression: + description: Allows the declaration of an anonymous object within a declaration + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + properties: + description: Object properties + type: array + items: + $ref: "#/components/schemas/Property" + ParenExpression: + description: Represents an expression wrapped in parenthesis + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + expression: + $ref: "#/components/schemas/Expression" + PipeExpression: + description: Call expression with pipe argument + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + argument: + $ref: "#/components/schemas/Expression" + call: + $ref: "#/components/schemas/CallExpression" + UnaryExpression: + description: Uses operators to act on a single operand in an expression + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + operator: + type: string + argument: + $ref: "#/components/schemas/Expression" + BooleanLiteral: + description: Represents boolean values + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + value: + type: boolean + DateTimeLiteral: + description: Represents an instant in time with nanosecond precision using the syntax of golang's RFC3339 Nanosecond variant + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + value: + type: string + DurationLiteral: + description: Represents the elapsed time between two instants as an int64 nanosecond count with syntax of golang's time.Duration + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + values: + description: Duration values + type: array + items: + $ref: "#/components/schemas/Duration" + FloatLiteral: + description: Represents floating point numbers according to the double representations defined by the IEEE-754-1985 + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + value: + type: number + IntegerLiteral: + description: Represents integer numbers + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + value: + type: string + PipeLiteral: + description: Represents a specialized literal value, indicating the left hand value of a pipe expression + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + RegexpLiteral: + description: Expressions begin and end with `/` and are regular expressions with syntax accepted by RE2 + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + value: + type: string + StringLiteral: + description: Expressions begin and end with double quote marks + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + value: + type: string + UnsignedIntegerLiteral: + description: Represents integer numbers + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + value: + type: string + Duration: + description: A pair consisting of length of time and the unit of time measured. It is the atomic unit from which all duration literals are composed. + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + magnitude: + type: integer + unit: + type: string + Property: + description: The value associated with a key + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + key: + $ref: "#/components/schemas/PropertyKey" + value: + $ref: "#/components/schemas/Expression" + PropertyKey: + oneOf: + - $ref: "#/components/schemas/Identifier" + - $ref: "#/components/schemas/StringLiteral" + Identifier: + description: A valid Flux identifier + type: object + properties: + type: + $ref: "#/components/schemas/NodeType" + name: + type: string + NodeType: + description: Type of AST node + type: string + Dialect: + description: Dialect are options to change the default CSV output format; https://www.w3.org/TR/2015/REC-tabular-metadata-20151217/#dialect-descriptions + type: object + properties: + header: + description: If true, the results will contain a header row + type: boolean + default: true + delimiter: + description: Separator between cells; the default is , + type: string + default: "," + maxLength: 1 + minLength: 1 + annotations: + description: Https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#columns + type: array + items: + type: string + enum: + - "group" + - "datatype" + - "default" + uniqueItems: true + commentPrefix: + description: Character prefixed to comment strings + type: string + default: "#" + maxLength: 1 + minLength: 0 + dateTimeFormat: + description: Format of timestamps + type: string + default: "RFC3339" + enum: + - RFC3339 + - RFC3339Nano + Permission: + required: [action, resource] + properties: + action: + type: string + enum: + - read + - write + resource: + $ref: "#/components/schemas/Resource" + Resource: + type: object + required: [type] + properties: + type: + type: string + enum: + - authorizations + - buckets + - dashboards + - orgs + - sources + - tasks + - telegrafs + - users + - variables + - scrapers + - secrets + - labels + - views + - documents + - notificationRules + - notificationEndpoints + - checks + id: + type: string + nullable: true + description: If ID is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type. + name: + type: string + nullable: true + description: Optional name of the resource if the resource has a name field. + orgID: + type: string + nullable: true + description: If orgID is set that is a permission for all resources owned my that org. if it is not set it is a permission for all resources of that resource type. + org: + type: string + nullable: true + description: Optional name of the organization of the organization with orgID. + AuthorizationUpdateRequest: + properties: + status: + description: If inactive the token is inactive and requests using the token will be rejected. + default: active + type: string + enum: + - active + - inactive + description: + type: string + description: A description of the token. + Authorization: + required: [orgID, permissions] + allOf: + - $ref: "#/components/schemas/AuthorizationUpdateRequest" + - type: object + properties: + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + orgID: + type: string + description: ID of org that authorization is scoped to. + permissions: + type: array + minLength: 1 + description: List of permissions for an auth. An auth must have at least one Permission. + items: + $ref: "#/components/schemas/Permission" + id: + readOnly: true + type: string + token: + readOnly: true + type: string + description: Passed via the Authorization Header and Token Authentication type. + userID: + readOnly: true + type: string + description: ID of user that created and owns the token. + user: + readOnly: true + type: string + description: Name of user that created and owns the token. + org: + readOnly: true + type: string + description: Name of the org token is scoped to. + links: + type: object + readOnly: true + example: + self: "/api/v2/authorizations/1" + user: "/api/v2/users/12" + properties: + self: + readOnly: true + $ref: "#/components/schemas/Link" + user: + readOnly: true + $ref: "#/components/schemas/Link" + Authorizations: + type: object + properties: + links: + readOnly: true + $ref: "#/components/schemas/Links" + authorizations: + type: array + items: + $ref: "#/components/schemas/Authorization" + PostBucketRequest: + properties: + orgID: + type: string + name: + type: string + description: + type: string + rp: + type: string + retentionRules: + $ref: "#/components/schemas/RetentionRules" + required: [name, retentionRules] + Bucket: + properties: + links: + type: object + readOnly: true + example: + labels: "/api/v2/buckets/1/labels" + logs: "/api/v2/buckets/1/logs" + members: "/api/v2/buckets/1/members" + org: "/api/v2/orgs/2" + owners: "/api/v2/buckets/1/owners" + self: "/api/v2/buckets/1" + write: "/api/v2/write?org=2&bucket=1" + properties: + labels: + description: URL to retrieve labels for this bucket + $ref: "#/components/schemas/Link" + logs: + description: URL to retrieve operation logs for this bucket + $ref: "#/components/schemas/Link" + members: + description: URL to retrieve members that can read this bucket + $ref: "#/components/schemas/Link" + org: + description: URL to retrieve parent organization for this bucket + $ref: "#/components/schemas/Link" + owners: + description: URL to retrieve owners that can read and write to this bucket. + $ref: "#/components/schemas/Link" + self: + description: URL for this bucket + $ref: "#/components/schemas/Link" + write: + description: URL to write line protocol for this bucket + $ref: "#/components/schemas/Link" + id: + readOnly: true + type: string + type: + readOnly: true + type: string + default: user + enum: + - user + - system + name: + type: string + description: + type: string + orgID: + type: string + rp: + type: string + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + retentionRules: + $ref: "#/components/schemas/RetentionRules" + labels: + $ref: "#/components/schemas/Labels" + required: [name, retentionRules] + Buckets: + type: object + properties: + links: + readOnly: true + $ref: "#/components/schemas/Links" + buckets: + type: array + items: + $ref: "#/components/schemas/Bucket" + RetentionRules: + type: array + description: Rules to expire or retain data. No rules means data never expires. + items: + $ref: "#/components/schemas/RetentionRule" + RetentionRule: + type: object + properties: + type: + type: string + default: expire + enum: + - expire + everySeconds: + type: integer + description: Duration in seconds for how long data will be kept in the database. + example: 86400 + minimum: 1 + required: [type, everySeconds] + Link: + type: string + format: uri + readOnly: true + description: URI of resource. + Links: + type: object + properties: + next: + $ref: "#/components/schemas/Link" + self: + $ref: "#/components/schemas/Link" + prev: + $ref: "#/components/schemas/Link" + required: [self] + Logs: + type: object + properties: + events: + readOnly: true + type: array + items: + $ref: "#/components/schemas/LogEvent" + LogEvent: + type: object + properties: + time: + readOnly: true + description: Time event occurred, RFC3339Nano. + type: string + format: date-time + message: + readOnly: true + description: A description of the event that occurred. + type: string + example: Halt and catch fire + OperationLog: + type: object + readOnly: true + properties: + description: + type: string + description: A description of the event that occurred. + example: Bucket Created + time: + type: string + description: Time event occurred, RFC3339Nano. + format: date-time + userID: + type: string + description: ID of the user who operated the event. + links: + type: object + properties: + user: + $ref: "#/components/schemas/Link" + OperationLogs: + type: object + properties: + logs: + type: array + items: + $ref: "#/components/schemas/OperationLog" + links: + $ref: "#/components/schemas/Links" + Organization: + properties: + links: + type: object + readOnly: true + example: + self: "/api/v2/orgs/1" + members: "/api/v2/orgs/1/members" + owners: "/api/v2/orgs/1/owners" + labels: "/api/v2/orgs/1/labels" + secrets: "/api/v2/orgs/1/secrets" + buckets: "/api/v2/buckets?org=myorg" + tasks: "/api/v2/tasks?org=myorg" + dashboards: "/api/v2/dashboards?org=myorg" + logs: "/api/v2/orgs/1/logs" + properties: + self: + $ref: "#/components/schemas/Link" + members: + $ref: "#/components/schemas/Link" + owners: + $ref: "#/components/schemas/Link" + labels: + $ref: "#/components/schemas/Link" + secrets: + $ref: "#/components/schemas/Link" + buckets: + $ref: "#/components/schemas/Link" + tasks: + $ref: "#/components/schemas/Link" + dashboards: + $ref: "#/components/schemas/Link" + logs: + $ref: "#/components/schemas/Link" + id: + readOnly: true + type: string + name: + type: string + description: + type: string + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + status: + description: If inactive the organization is inactive. + default: active + type: string + enum: + - active + - inactive + required: [name] + Organizations: + type: object + properties: + links: + $ref: "#/components/schemas/Links" + orgs: + type: array + items: + $ref: "#/components/schemas/Organization" + PkgApply: + type: object + properties: + dryRun: + type: boolean + orgID: + type: string + package: + $ref: "#/components/schemas/Pkg" + packages: + type: array + items: + $ref: "#/components/schemas/Pkg" + secrets: + type: object + additionalProperties: + type: string + remotes: + type: array + items: + type: object + properties: + url: + type: string + contentType: + type: string + required: ["url"] + PkgCreateKind: + type: string + enum: + - bucket + - check + - dashboard + - label + - notification_endpoint + - notification_rule + - task + - telegraf + - variable + PkgCreate: + type: object + properties: + orgIDs: + type: array + items: + type: object + properties: + orgID: + type: string + resourceFilters: + type: object + properties: + byLabel: + type: array + items: + type: string + byResourceKind: + type: array + items: + $ref: "#/components/schemas/PkgCreateKind" + resources: + type: object + properties: + id: + type: string + kind: + $ref: "#/components/schemas/PkgCreateKind" + name: + type: string + required: [id, kind] + Pkg: + type: array + items: + type: object + properties: + apiVersion: + type: string + kind: + type: string + enum: + - Bucket + - CheckDeadman + - CheckThreshold + - Dashboard + - Label + - NotificationEndpointHTTP + - NotificationEndpointPagerDuty + - NotificationEndpointSlack + - NotificationRule + - Task + - Telegraf + - Variable + meta: + type: object + properties: + name: + type: string + spec: + type: object + PkgSummary: + type: object + properties: + summary: + type: object + properties: + buckets: + type: array + items: + type: object + properties: + id: + type: string + orgID: + type: string + name: + type: string + description: + type: string + retentionPeriod: + type: integer + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + checks: + type: array + items: + allOf: + - $ref: "#/components/schemas/CheckDiscriminator" + - type: object + properties: + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + labels: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + dashboards: + type: array + items: + type: object + properties: + id: + type: "string" + orgID: + type: "string" + name: + type: "string" + description: + type: "string" + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + charts: + type: array + items: + $ref: "#/components/schemas/PkgChart" + labelMappings: + type: array + items: + type: object + properties: + resourceName: + type: string + resourceID: + type: string + resourceType: + type: string + labelName: + type: string + labelID: + type: string + missingEnvRefs: + type: array + items: + type: string + missingSecrets: + type: array + items: + type: string + notificationEndpoints: + type: array + items: + allOf: + - $ref: "#/components/schemas/NotificationEndpointDiscrimator" + - type: object + properties: + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + notificationRules: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + endpointName: + type: string + endpointID: + type: string + endpointType: + type: string + every: + type: string + offset: + type: string + messageTemplate: + type: string + status: + type: string + statusRules: + type: array + items: + type: object + properties: + currentLevel: + type: string + previousLevel: + type: string + tagRules: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + operator: + type: string + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + tasks: + type: array + items: + type: object + properties: + id: + type: string + name: + type: string + cron: + type: string + description: + type: string + every: + type: string + offset: + type: string + query: + type: string + status: + type: string + telegrafConfigs: + type: array + items: + allOf: + - $ref: "#/components/schemas/TelegrafRequest" + - type: object + properties: + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + variables: + type: array + items: + type: object + properties: + id: + type: string + orgID: + type: string + name: + type: string + description: + type: string + arguments: + $ref: "#/components/schemas/VariableProperties" + labelAssociations: + type: array + items: + $ref: "#/components/schemas/PkgSummaryLabel" + diff: + type: object + properties: + buckets: + type: array + items: + type: object + properties: + id: + type: string + name: + type: string + new: + type: object + properties: + description: + type: string + retentionRules: + $ref: "#/components/schemas/RetentionRules" + old: + type: object + properties: + description: + type: string + retentionRules: + $ref: "#/components/schemas/RetentionRules" + checks: + type: array + items: + type: object + properties: + id: + type: string + name: + type: string + new: + $ref: "#/components/schemas/CheckDiscriminator" + old: + $ref: "#/components/schemas/CheckDiscriminator" + dashboards: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + charts: + type: array + items: + $ref: "#/components/schemas/PkgChart" + labels: + type: array + items: + type: object + properties: + id: + type: string + name: + type: string + new: + type: object + properties: + color: + type: string + description: + type: string + old: + type: object + properties: + color: + type: string + description: + type: string + labelMappings: + type: array + items: + type: object + properties: + isNew: + type: boolean + resourceType: + type: string + resourceID: + type: string + resourceName: + type: string + labelID: + type: string + labelName: + type: string + notificationEndpoints: + type: array + items: + type: object + properties: + id: + type: string + name: + type: string + new: + $ref: "#/components/schemas/NotificationEndpointDiscrimator" + old: + $ref: "#/components/schemas/NotificationEndpointDiscrimator" + notificationRules: + type: array + items: + type: object + properties: + name: + type: string + description: + type: string + endpointName: + type: string + endpointID: + type: string + endpointType: + type: string + every: + type: string + offset: + type: string + messageTemplate: + type: string + status: + type: string + statusRules: + type: array + items: + type: object + properties: + currentLevel: + type: string + previousLevel: + type: string + tagRules: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + operator: + type: string + tasks: + type: array + items: + type: object + properties: + name: + type: string + cron: + type: string + description: + type: string + every: + type: string + offset: + type: string + query: + type: string + status: + type: string + telegrafConfigs: + type: array + items: + $ref: "#/components/schemas/TelegrafRequest" + variables: + type: array + items: + type: object + properties: + id: + type: string + name: + type: string + new: + type: object + properties: + description: + type: string + args: + $ref: "#/components/schemas/VariableProperties" + old: + type: object + properties: + description: + type: string + args: + $ref: "#/components/schemas/VariableProperties" + errors: + type: array + items: + type: object + properties: + kind: + type: string + reason: + type: string + fields: + type: array + items: + type: string + indexes: + type: array + items: + type: integer + PkgSummaryLabel: + type: object + properties: + id: + type: string + orgID: + type: string + name: + type: string + description: + type: string + retentionPeriod: + type: string + PkgChart: + type: object + properties: + xPos: + type: integer + yPos: + type: integer + height: + type: integer + width: + type: integer + properties: # field name is properties + $ref: "#/components/schemas/ViewProperties" + Runs: + type: object + properties: + links: + $ref: "#/components/schemas/Links" + runs: + type: array + items: + $ref: "#/components/schemas/Run" + Run: + properties: + id: + readOnly: true + type: string + taskID: + readOnly: true + type: string + status: + readOnly: true + type: string + enum: + - scheduled + - started + - failed + - success + - canceled + scheduledFor: + description: Time used for run's "now" option, RFC3339. + type: string + format: date-time + log: + description: An array of logs associated with the run. + type: array + readOnly: true + items: + type: object + properties: + runID: + type: string + time: + type: string + message: + type: string + startedAt: + readOnly: true + description: Time run started executing, RFC3339Nano. + type: string + format: date-time + finishedAt: + readOnly: true + description: Time run finished executing, RFC3339Nano. + type: string + format: date-time + requestedAt: + readOnly: true + description: Time run was manually requested, RFC3339Nano. + type: string + format: date-time + links: + type: object + readOnly: true + example: + self: "/api/v2/tasks/1/runs/1" + task: "/api/v2/tasks/1" + retry: "/api/v2/tasks/1/runs/1/retry" + logs: "/api/v2/tasks/1/runs/1/logs" + properties: + self: + type: string + format: uri + task: + type: string + format: uri + logs: + type: string + format: uri + retry: + type: string + format: uri + RunManually: + properties: + scheduledFor: + nullable: true + description: Time used for run's "now" option, RFC3339. Default is the server's now time. + type: string + format: date-time + Tasks: + type: object + properties: + links: + readOnly: true + $ref: "#/components/schemas/Links" + tasks: + type: array + items: + $ref: "#/components/schemas/Task" + Task: + type: object + properties: + id: + readOnly: true + type: string + type: + description: The type of task, this can be used for filtering tasks on list actions. + type: string + orgID: + description: The ID of the organization that owns this Task. + type: string + org: + description: The name of the organization that owns this Task. + type: string + name: + description: The name of the task. + type: string + description: + description: An optional description of the task. + type: string + status: + $ref: "#/components/schemas/TaskStatusType" + labels: + $ref: "#/components/schemas/Labels" + authorizationID: + description: The ID of the authorization used when this task communicates with the query engine. + type: string + flux: + description: The Flux script to run for this task. + type: string + every: + description: A simple task repetition schedule; parsed from Flux. + type: string + cron: + description: A task repetition schedule in the form '* * * * * *'; parsed from Flux. + type: string + offset: + description: Duration to delay after the schedule, before executing the task; parsed from flux, if set to zero it will remove this option and use 0 as the default. + type: string + latestCompleted: + description: Timestamp of latest scheduled, completed run, RFC3339. + type: string + format: date-time + readOnly: true + lastRunStatus: + readOnly: true + type: string + enum: + - failed + - success + - canceled + lastRunError: + readOnly: true + type: string + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + links: + type: object + readOnly: true + example: + self: "/api/v2/tasks/1" + owners: "/api/v2/tasks/1/owners" + members: "/api/v2/tasks/1/members" + labels: "/api/v2/tasks/1/labels" + runs: "/api/v2/tasks/1/runs" + logs: "/api/v2/tasks/1/logs" + properties: + self: + $ref: "#/components/schemas/Link" + owners: + $ref: "#/components/schemas/Link" + members: + $ref: "#/components/schemas/Link" + runs: + $ref: "#/components/schemas/Link" + logs: + $ref: "#/components/schemas/Link" + labels: + $ref: "#/components/schemas/Link" + required: [id, name, orgID, flux] + TaskStatusType: + type: string + enum: [active, inactive] + User: + properties: + id: + readOnly: true + type: string + oauthID: + type: string + name: + type: string + status: + description: If inactive the user is inactive. + default: active + type: string + enum: + - active + - inactive + links: + type: object + readOnly: true + example: + self: "/api/v2/users/1" + logs: "/api/v2/users/1/logs" + properties: + self: + type: string + format: uri + logs: + type: string + format: uri + required: [name] + Users: + type: object + properties: + links: + type: object + properties: + self: + type: string + format: uri + users: + type: array + items: + $ref: "#/components/schemas/User" + ResourceMember: + allOf: + - $ref: "#/components/schemas/User" + - type: object + properties: + role: + type: string + default: member + enum: + - member + ResourceMembers: + type: object + properties: + links: + type: object + properties: + self: + type: string + format: uri + users: + type: array + items: + $ref: "#/components/schemas/ResourceMember" + ResourceOwner: + allOf: + - $ref: "#/components/schemas/User" + - type: object + properties: + role: + type: string + default: owner + enum: + - owner + ResourceOwners: + type: object + properties: + links: + type: object + properties: + self: + type: string + format: uri + users: + type: array + items: + $ref: "#/components/schemas/ResourceOwner" + FluxSuggestions: + type: object + properties: + funcs: + type: array + items: + $ref: "#/components/schemas/FluxSuggestion" + FluxSuggestion: + type: object + properties: + name: + type: string + params: + type: object + additionalProperties: + type: string + Routes: + properties: + authorizations: + type: string + format: uri + buckets: + type: string + format: uri + dashboards: + type: string + format: uri + external: + type: object + properties: + statusFeed: + type: string + format: uri + variables: + type: string + format: uri + me: + type: string + format: uri + orgs: + type: string + format: uri + query: + type: object + properties: + self: + type: string + format: uri + ast: + type: string + format: uri + analyze: + type: string + format: uri + suggestions: + type: string + format: uri + setup: + type: string + format: uri + signin: + type: string + format: uri + signout: + type: string + format: uri + sources: + type: string + format: uri + system: + type: object + properties: + metrics: + type: string + format: uri + debug: + type: string + format: uri + health: + type: string + format: uri + tasks: + type: string + format: uri + telegrafs: + type: string + format: uri + users: + type: string + format: uri + write: + type: string + format: uri + Error: + properties: + code: + description: Code is the machine-readable error code. + readOnly: true + type: string + # This set of enumerations must remain in sync with the constants defined in errors.go + enum: + - internal error + - not found + - conflict + - invalid + - unprocessable entity + - empty value + - unavailable + - forbidden + - too many requests + - unauthorized + - method not allowed + message: + readOnly: true + description: Message is a human-readable message. + type: string + required: [code, message] + LineProtocolError: + properties: + code: + description: Code is the machine-readable error code. + readOnly: true + type: string + enum: + - internal error + - not found + - conflict + - invalid + - empty value + - unavailable + message: + readOnly: true + description: Message is a human-readable message. + type: string + op: + readOnly: true + description: Op describes the logical code operation during error. Useful for debugging. + type: string + err: + readOnly: true + description: Err is a stack of errors that occurred during processing of the request. Useful for debugging. + type: string + line: + readOnly: true + description: First line within sent body containing malformed data + type: integer + format: int32 + required: [code, message, op, err] + LineProtocolLengthError: + properties: + code: + description: Code is the machine-readable error code. + readOnly: true + type: string + enum: + - invalid + message: + readOnly: true + description: Message is a human-readable message. + type: string + maxLength: + readOnly: true + description: Max length in bytes for a body of line-protocol. + type: integer + format: int32 + required: [code, message, maxLength] + Field: + type: object + properties: + value: + description: >- + value is the value of the field. Meaning of the value is implied by + the `type` key + type: string + type: + description: >- + `type` describes the field type. `func` is a function. `field` is a field reference. + type: string + enum: + - func + - field + - integer + - number + - regex + - wildcard + alias: + description: >- + Alias overrides the field name in the returned response. Applies only + if type is `func` + type: string + args: + description: Args are the arguments to the function + type: array + items: + $ref: '#/components/schemas/Field' + BuilderConfig: + type: object + properties: + buckets: + type: array + items: + type: string + tags: + type: array + items: + $ref: '#/components/schemas/BuilderTagsType' + functions: + type: array + items: + $ref: '#/components/schemas/BuilderFunctionsType' + aggregateWindow: + type: object + properties: + period: + type: string + BuilderTagsType: + type: object + properties: + key: + type: string + values: + type: array + items: + type: string + aggregateFunctionType: + $ref: '#/components/schemas/BuilderAggregateFunctionType' + BuilderAggregateFunctionType: + type: string + enum: ['filter', 'group'] + BuilderFunctionsType: + type: object + properties: + name: + type: string + DashboardQuery: + type: object + properties: + text: + type: string + description: The text of the Flux query. + editMode: + $ref: '#/components/schemas/QueryEditMode' + name: + type: string + builderConfig: + $ref: '#/components/schemas/BuilderConfig' + QueryEditMode: + type: string + enum: ['builder', 'advanced'] + Axis: + type: object + description: The description of a particular axis for a visualization. + properties: + bounds: + type: array + minItems: 0 + maxItems: 2 + description: >- + The extents of an axis in the form [lower, upper]. Clients determine + whether bounds are to be inclusive or exclusive of their limits + items: + type: string + label: + description: Label is a description of this Axis + type: string + prefix: + description: Prefix represents a label prefix for formatting axis values. + type: string + suffix: + description: Suffix represents a label suffix for formatting axis values. + type: string + base: + description: Base represents the radix for formatting axis values. + type: string + enum: ['', '2', '10'] + scale: + $ref: '#/components/schemas/AxisScale' + AxisScale: + description: 'Scale is the axis formatting scale. Supported: "log", "linear"' + type: string + enum: ['log', 'linear'] + DashboardColor: + type: object + description: Defines an encoding of data value into color space. + required: [id, type, hex, name, value] + properties: + id: + description: The unique ID of the view color. + type: string + type: + description: Type is how the color is used. + type: string + enum: + - min + - max + - threshold + - scale + - text + - background + hex: + description: The hex number of the color + type: string + maxLength: 7 + minLength: 7 + name: + description: The user-facing name of the hex color. + type: string + value: + description: The data value mapped to this color. + type: number + format: float + RenamableField: + description: Describes a field that can be renamed and made visible or invisible. + type: object + properties: + internalName: + description: The calculated name of a field. + readOnly: true + type: string + displayName: + description: The name that a field is renamed to by the user. + type: string + visible: + description: Indicates whether this field should be visible on the table. + type: boolean + XYViewProperties: + type: object + required: + - type + - geom + - queries + - shape + - axes + - colors + - legend + - note + - showNoteWhenEmpty + - position + properties: + timeFormat: + type: string + type: + type: string + enum: [xy] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: If true, will display note when empty + type: boolean + axes: + $ref: '#/components/schemas/Axes' + legend: + $ref: '#/components/schemas/Legend' + xColumn: + type: string + yColumn: + type: string + shadeBelow: + type: boolean + position: + type: string + enum: [overlaid, stacked] + geom: + $ref: '#/components/schemas/XYGeom' + XYGeom: + type: string + enum: [line, step, stacked, bar, monotoneX] + LinePlusSingleStatProperties: + type: object + required: + - type + - queries + - shape + - axes + - colors + - legend + - note + - showNoteWhenEmpty + - prefix + - suffix + - decimalPlaces + - position + properties: + type: + type: string + enum: [line-plus-single-stat] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: If true, will display note when empty + type: boolean + axes: + $ref: '#/components/schemas/Axes' + legend: + $ref: '#/components/schemas/Legend' + xColumn: + type: string + yColumn: + type: string + shadeBelow: + type: boolean + position: + type: string + enum: [overlaid, stacked] + prefix: + type: string + suffix: + type: string + decimalPlaces: + $ref: '#/components/schemas/DecimalPlaces' + ScatterViewProperties: + type: object + required: + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - xColumn + - yColumn + - fillColumns + - symbolColumns + - xDomain + - yDomain + - xAxisLabel + - yAxisLabel + - xPrefix + - yPrefix + - xSuffix + - ySuffix + properties: + timeFormat: + type: string + type: + type: string + enum: [scatter] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + type: string + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: If true, will display note when empty + type: boolean + xColumn: + type: string + yColumn: + type: string + fillColumns: + type: array + items: + type: string + symbolColumns: + type: array + items: + type: string + xDomain: + type: array + items: + type: number + maxItems: 2 + yDomain: + type: array + items: + type: number + maxItems: 2 + xAxisLabel: + type: string + yAxisLabel: + type: string + xPrefix: + type: string + xSuffix: + type: string + yPrefix: + type: string + ySuffix: + type: string + HeatmapViewProperties: + type: object + required: + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - xColumn + - yColumn + - xDomain + - yDomain + - xAxisLabel + - yAxisLabel + - xPrefix + - yPrefix + - xSuffix + - ySuffix + - binSize + properties: + timeFormat: + type: string + type: + type: string + enum: [heatmap] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + type: string + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: If true, will display note when empty + type: boolean + xColumn: + type: string + yColumn: + type: string + xDomain: + type: array + items: + type: number + maxItems: 2 + yDomain: + type: array + items: + type: number + maxItems: 2 + xAxisLabel: + type: string + yAxisLabel: + type: string + xPrefix: + type: string + xSuffix: + type: string + yPrefix: + type: string + ySuffix: + type: string + binSize: + type: number + SingleStatViewProperties: + type: object + required: + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - prefix + - tickPrefix + - suffix + - tickSuffix + - legend + - decimalPlaces + properties: + type: + type: string + enum: [single-stat] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: If true, will display note when empty + type: boolean + prefix: + type: string + tickPrefix: + type: string + suffix: + type: string + tickSuffix: + type: string + legend: + $ref: '#/components/schemas/Legend' + decimalPlaces: + $ref: "#/components/schemas/DecimalPlaces" + HistogramViewProperties: + type: object + required: + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - xColumn + - fillColumns + - xDomain + - xAxisLabel + - position + - binCount + properties: + type: + type: string + enum: [histogram] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: If true, will display note when empty + type: boolean + xColumn: + type: string + fillColumns: + type: array + items: + type: string + xDomain: + type: array + items: + type: number + format: float + xAxisLabel: + type: string + position: + type: string + enum: [overlaid, stacked] + binCount: + type: integer + GaugeViewProperties: + type: object + required: [type, queries, colors, shape, note, showNoteWhenEmpty, prefix, tickPrefix, suffix, tickSuffix, legend, decimalPlaces] + properties: + type: + type: string + enum: [gauge] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: If true, will display note when empty + type: boolean + prefix: + type: string + tickPrefix: + type: string + suffix: + type: string + tickSuffix: + type: string + legend: + $ref: '#/components/schemas/Legend' + decimalPlaces: + $ref: "#/components/schemas/DecimalPlaces" + TableViewProperties: + type: object + required: + - type + - queries + - colors + - shape + - note + - showNoteWhenEmpty + - tableOptions + - fieldOptions + - timeFormat + - decimalPlaces + properties: + type: + type: string + enum: [table] + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + $ref: "#/components/schemas/DashboardColor" + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + showNoteWhenEmpty: + description: If true, will display note when empty + type: boolean + tableOptions: + properties: + verticalTimeAxis: + description: >- + verticalTimeAxis describes the orientation of the table by + indicating whether the time axis will be displayed vertically + type: boolean + sortBy: + $ref: "#/components/schemas/RenamableField" + wrapping: + description: Wrapping describes the text wrapping style to be used in table views + type: string + enum: + - truncate + - wrap + - single-line + fixFirstColumn: + description: >- + fixFirstColumn indicates whether the first column of the table + should be locked + type: boolean + fieldOptions: + description: >- + fieldOptions represent the fields retrieved by the query with + customization options + type: array + items: + $ref: '#/components/schemas/RenamableField' + timeFormat: + description: >- + timeFormat describes the display format for time values according to + moment.js date formatting + type: string + decimalPlaces: + $ref: '#/components/schemas/DecimalPlaces' + MarkdownViewProperties: + type: object + required: + - type + - shape + - note + properties: + type: + type: string + enum: [markdown] + shape: + type: string + enum: ['chronograf-v2'] + note: + type: string + CheckViewProperties: + type: object + required: + - type + - shape + - checkID + - queries + - colors + properties: + type: + type: string + enum: [check] + shape: + type: string + enum: ['chronograf-v2'] + checkID: + type: string + check: + $ref: '#/components/schemas/Check' + queries: + type: array + items: + $ref: "#/components/schemas/DashboardQuery" + colors: + description: Colors define color encoding of data into a visualization + type: array + items: + type: string + Axes: + description: The viewport for a View's visualizations + type: object + required: ['x', 'y'] + properties: + x: + $ref: '#/components/schemas/Axis' + "y": # Quoted to prevent YAML parser from interpreting y as shorthand for true. + $ref: '#/components/schemas/Axis' + Legend: + description: Legend define encoding of data into a view's legend + type: object + properties: + type: + description: The style of the legend. + type: string + enum: + - static + orientation: + description: >- + orientation is the location of the legend with respect to the view + graph + type: string + enum: + - top + - bottom + - left + - right + DecimalPlaces: + description: Indicates whether decimal places should be enforced, and how many digits it should show. + type: object + properties: + isEnforced: + description: Indicates whether decimal point setting should be enforced + type: boolean + digits: + description: The number of digits after decimal to display + type: integer + format: int32 + ConstantVariableProperties: + properties: + type: + type: string + enum: [constant] + values: + type: array + items: + type: string + MapVariableProperties: + properties: + type: + type: string + enum: [map] + values: + type: object + additionalProperties: + type: string + QueryVariableProperties: + properties: + type: + type: string + enum: [query] + values: + type: object + properties: + query: + type: string + language: + type: string + Variable: + type: object + required: + - name + - orgID + - arguments + properties: + links: + type: object + readOnly: true + properties: + self: + type: string + format: uri + org: + type: string + format: uri + labels: + type: string + format: uri + id: + readOnly: true + type: string + orgID: + type: string + name: + type: string + description: + type: string + selected: + type: array + items: + type: string + labels: + $ref: "#/components/schemas/Labels" + arguments: + $ref: "#/components/schemas/VariableProperties" + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + Variables: + type: object + example: + variables: + - id: '1221432' + name: ":ok:" + selected: + - hello + arguments: + type: constant + values: + - howdy + - hello + - hi + - yo + - oy + - id: '1221432' + name: ":ok:" + selected: + - c + arguments: + type: map + values: + a: fdjaklfdjkldsfjlkjdsa + b: dfaksjfkljekfajekdljfas + c: fdjksajfdkfeawfeea + - id: '1221432' + name: ":ok:" + selected: + - host + arguments: + type: query + query: 'from(bucket: "foo") |> showMeasurements()' + language: flux + properties: + variables: + type: array + items: + $ref: "#/components/schemas/Variable" + VariableProperties: + type: object + oneOf: + - $ref: "#/components/schemas/QueryVariableProperties" + - $ref: "#/components/schemas/ConstantVariableProperties" + - $ref: "#/components/schemas/MapVariableProperties" + ViewProperties: + oneOf: + - $ref: "#/components/schemas/LinePlusSingleStatProperties" + - $ref: "#/components/schemas/XYViewProperties" + - $ref: "#/components/schemas/SingleStatViewProperties" + - $ref: "#/components/schemas/HistogramViewProperties" + - $ref: "#/components/schemas/GaugeViewProperties" + - $ref: "#/components/schemas/TableViewProperties" + - $ref: "#/components/schemas/MarkdownViewProperties" + - $ref: "#/components/schemas/CheckViewProperties" + - $ref: "#/components/schemas/ScatterViewProperties" + - $ref: "#/components/schemas/HeatmapViewProperties" + View: + required: + - name + - properties + properties: + links: + type: object + readOnly: true + properties: + self: + type: string + id: + readOnly: true + type: string + name: + type: string + properties: + $ref: '#/components/schemas/ViewProperties' + Views: + type: object + properties: + links: + type: object + properties: + self: + type: string + views: + type: array + items: + $ref: "#/components/schemas/View" + CellUpdate: + type: object + properties: + x: + type: integer + format: int32 + "y": # Quoted to prevent YAML parser from interpreting y as shorthand for true. + type: integer + format: int32 + w: + type: integer + format: int32 + h: + type: integer + format: int32 + CreateCell: + type: object + properties: + name: + type: string + x: + type: integer + format: int32 + "y": # Quoted to prevent YAML parser from interpreting y as shorthand for true. + type: integer + format: int32 + w: + type: integer + format: int32 + h: + type: integer + format: int32 + usingView: + type: string + description: Makes a copy of the provided view. + AnalyzeQueryResponse: + type: object + properties: + errors: + type: array + items: + type: object + properties: + line: + type: integer + column: + type: integer + character: + type: integer + message: + type: string + CellWithViewProperties: + type: object + allOf: + - $ref: "#/components/schemas/Cell" + - type: object + properties: + name: + type: string + properties: + $ref: "#/components/schemas/ViewProperties" + Cell: + type: object + properties: + id: + type: string + links: + type: object + properties: + self: + type: string + view: + type: string + x: + type: integer + format: int32 + "y": # Quoted to prevent YAML parser from interpreting y as shorthand for true. + type: integer + format: int32 + w: + type: integer + format: int32 + h: + type: integer + format: int32 + viewID: + type: string + description: The reference to a view from the views API. + CellsWithViewProperties: + type: array + items: + $ref: "#/components/schemas/CellWithViewProperties" + Cells: + type: array + items: + $ref: "#/components/schemas/Cell" + Secrets: + additionalProperties: + type: string + example: + apikey: abc123xyz + SecretKeys: + type: object + properties: + secrets: + type: array + items: + type: string + SecretKeysResponse: + allOf: + - $ref: "#/components/schemas/SecretKeys" + - type: object + properties: + links: + readOnly: true + type: object + properties: + self: + type: string + org: + type: string + CreateDashboardRequest: + properties: + orgID: + type: string + description: The ID of the organization that owns the dashboard. + name: + type: string + description: The user-facing name of the dashboard. + description: + type: string + description: The user-facing description of the dashboard. + required: + - orgID + - name + DashboardWithViewProperties: + type: object + allOf: + - $ref: "#/components/schemas/CreateDashboardRequest" + - type: object + properties: + links: + type: object + example: + self: "/api/v2/dashboards/1" + cells: "/api/v2/dashboards/1/cells" + owners: "/api/v2/dashboards/1/owners" + members: "/api/v2/dashboards/1/members" + logs: "/api/v2/dashboards/1/logs" + labels: "/api/v2/dashboards/1/labels" + org: "/api/v2/labels/1" + properties: + self: + $ref: "#/components/schemas/Link" + cells: + $ref: "#/components/schemas/Link" + members: + $ref: "#/components/schemas/Link" + owners: + $ref: "#/components/schemas/Link" + logs: + $ref: "#/components/schemas/Link" + labels: + $ref: "#/components/schemas/Link" + org: + $ref: "#/components/schemas/Link" + id: + readOnly: true + type: string + meta: + type: object + properties: + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + cells: + $ref: "#/components/schemas/CellsWithViewProperties" + labels: + $ref: "#/components/schemas/Labels" + Dashboard: + type: object + allOf: + - $ref: "#/components/schemas/CreateDashboardRequest" + - type: object + properties: + links: + type: object + example: + self: "/api/v2/dashboards/1" + cells: "/api/v2/dashboards/1/cells" + owners: "/api/v2/dashboards/1/owners" + members: "/api/v2/dashboards/1/members" + logs: "/api/v2/dashboards/1/logs" + labels: "/api/v2/dashboards/1/labels" + org: "/api/v2/labels/1" + properties: + self: + $ref: "#/components/schemas/Link" + cells: + $ref: "#/components/schemas/Link" + members: + $ref: "#/components/schemas/Link" + owners: + $ref: "#/components/schemas/Link" + logs: + $ref: "#/components/schemas/Link" + labels: + $ref: "#/components/schemas/Link" + org: + $ref: "#/components/schemas/Link" + id: + readOnly: true + type: string + meta: + type: object + properties: + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + cells: + $ref: "#/components/schemas/Cells" + labels: + $ref: "#/components/schemas/Labels" + Dashboards: + type: object + properties: + links: + $ref: "#/components/schemas/Links" + dashboards: + type: array + items: + $ref: "#/components/schemas/Dashboard" + Source: + type: object + properties: + links: + type: object + properties: + self: + type: string + query: + type: string + health: + type: string + buckets: + type: string + id: + type: string + orgID: + type: string + default: + type: boolean + name: + type: string + type: + type: string + enum: ["v1","v2","self"] + url: + type: string + format: uri + insecureSkipVerify: + type: boolean + telegraf: + type: string + token: + type: string + username: + type: string + password: + type: string + sharedSecret: + type: string + metaUrl: + type: string + format: uri + defaultRP: + type: string + languages: + type: array + readOnly: true + items: + type: string + enum: + - flux + - influxql + Sources: + type: object + properties: + links: + type: object + properties: + self: + type: string + format: uri + sources: + type: array + items: + $ref: "#/components/schemas/Source" + ScraperTargetRequest: + type: object + properties: + name: + type: string + description: The name of the scraper target. + type: + type: string + description: The type of the metrics to be parsed. + enum: [prometheus] + url: + type: string + description: The URL of the metrics endpoint. + example: http://localhost:9090/metrics + orgID: + type: string + description: The organization ID. + bucketID: + type: string + description: The ID of the bucket to write to. + ScraperTargetResponse: + type: object + allOf: + - $ref: "#/components/schemas/ScraperTargetRequest" + - type: object + properties: + id: + type: string + readOnly: true + org: + type: string + description: The organization name. + bucket: + type: string + description: The bucket name. + links: + type: object + readOnly: true + example: + self: "/api/v2/scrapers/1" + owners: "/api/v2/scrapers/1/owners" + members: "/api/v2/scrapers/1/members" + bucket: "/api/v2/buckets/1" + organization: "/api/v2/orgs/1" + properties: + self: + $ref: "#/components/schemas/Link" + members: + $ref: "#/components/schemas/Link" + owners: + $ref: "#/components/schemas/Link" + bucket: + $ref: "#/components/schemas/Link" + organization: + $ref: "#/components/schemas/Link" + ScraperTargetResponses: + type: object + properties: + configurations: + type: array + items: + $ref: "#/components/schemas/ScraperTargetResponse" + DocumentMeta: + type: object + properties: + name: + type: string + type: + type: string + templateID: + type: string + description: + type: string + version: + type: string + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + required: + - name + - version + Document: + type: object + properties: + id: + type: string + readOnly: true + meta: + $ref: "#/components/schemas/DocumentMeta" + content: + type: object + labels: + $ref: "#/components/schemas/Labels" + links: + type: object + readOnly: true + example: + self: "/api/v2/documents/templates/1" + properties: + self: + description: The document URL. + $ref: "#/components/schemas/Link" + required: + - id + - meta + - content + DocumentCreate: + type: object + properties: + meta: + $ref: "#/components/schemas/DocumentMeta" + content: + type: object + org: + type: string + description: The organization Name. Specify either `orgID` or `org`. + orgID: + type: string + description: The organization Name. Specify either `orgID` or `org`. + labels: + type: array + description: An array of label IDs to be added as labels to the document. + items: + type: string + required: + - meta + - content + DocumentUpdate: + type: object + properties: + meta: + $ref: "#/components/schemas/DocumentMeta" + content: + type: object + DocumentListEntry: + type: object + properties: + id: + type: string + readOnly: true + meta: + $ref: "#/components/schemas/DocumentMeta" + labels: + $ref: "#/components/schemas/Labels" + links: + type: object + readOnly: true + example: + self: "/api/v2/documents/templates/1" + properties: + self: + description: The document URL. + $ref: "#/components/schemas/Link" + required: + - id + - meta + Documents: + type: object + properties: + documents: + type: array + items: + $ref: "#/components/schemas/DocumentListEntry" + TelegrafRequest: + type: object + properties: + name: + type: string + description: + type: string + metadata: + type: object + properties: + buckets: + type: array + items: + type: string + config: + type: string + orgID: + type: string + TelegrafRequestPlugin: + oneOf: + - $ref: '#/components/schemas/TelegrafPluginInputCpu' + - $ref: '#/components/schemas/TelegrafPluginInputDisk' + - $ref: '#/components/schemas/TelegrafPluginInputDiskio' + - $ref: '#/components/schemas/TelegrafPluginInputDocker' + - $ref: '#/components/schemas/TelegrafPluginInputFile' + - $ref: '#/components/schemas/TelegrafPluginInputKubernetes' + - $ref: '#/components/schemas/TelegrafPluginInputLogParser' + - $ref: '#/components/schemas/TelegrafPluginInputProcstat' + - $ref: '#/components/schemas/TelegrafPluginInputPrometheus' + - $ref: '#/components/schemas/TelegrafPluginInputRedis' + - $ref: '#/components/schemas/TelegrafPluginInputSyslog' + - $ref: '#/components/schemas/TelegrafPluginOutputFile' + - $ref: '#/components/schemas/TelegrafPluginOutputInfluxDBV2' + TelegrafPluginInputCpu: + type: object + required: + - name + - type + properties: + name: + type: string + enum: ["cpu"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputDisk: + type: object + required: + - name + - type + properties: + name: + type: string + enum: ["disk"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputDiskio: + type: + object + required: + - name + - type + properties: + name: + type: string + enum: ["diskio"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputDocker: + type: + object + required: + - name + - type + - config + properties: + name: + type: string + enum: ["docker"] + type: + type: string + enum: ["input"] + comment: + type: string + config: + $ref: '#/components/schemas/TelegrafPluginInputDockerConfig' + TelegrafPluginInputFile: + type: + object + required: + - name + - type + - config + properties: + name: + type: string + enum: ["file"] + type: + type: string + enum: [input] + comment: + type: string + config: + $ref: '#/components/schemas/TelegrafPluginInputFileConfig' + TelegrafPluginInputKernel: + type: + object + required: + - name + - type + properties: + name: + type: string + enum: ["kernel"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputKubernetes: + type: + object + required: + - name + - type + - config + properties: + name: + type: string + enum: ["kubernetes"] + type: + type: string + enum: ["input"] + comment: + type: string + config: + $ref: '#/components/schemas/TelegrafPluginInputKubernetesConfig' + TelegrafPluginInputLogParser: + type: + object + required: + - name + - type + - config + properties: + name: + type: string + enum: ["logparser"] + type: + type: string + enum: ["input"] + comment: + type: string + config: + $ref: '#/components/schemas/TelegrafPluginInputLogParserConfig' + TelegrafPluginInputMem: + type: + object + required: + - name + - type + properties: + name: + type: string + enum: ["mem"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputNetResponse: + type: + object + required: + - name + - type + properties: + name: + type: string + enum: ["net_response"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputNet: + type: + object + required: + - name + - type + properties: + name: + type: string + enum: ["net"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputNginx: + type: + object + required: + - name + - type + properties: + name: + type: string + enum: ["nginx"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputProcesses: + type: + object + required: + - name + - type + properties: + name: + type: string + enum: ["processes"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputProcstat: + type: + object + required: + - name + - type + - config + properties: + name: + type: string + enum: ["procstat"] + type: + type: string + enum: ["input"] + comment: + type: string + config: + $ref: '#/components/schemas/TelegrafPluginInputProcstatConfig' + TelegrafPluginInputPrometheus: + type: + object + required: + - name + - type + - config + properties: + name: + type: string + enum: ["prometheus"] + type: + type: string + enum: ["input"] + comment: + type: string + config: + $ref: '#/components/schemas/TelegrafPluginInputPrometheusConfig' + TelegrafPluginInputRedis: + type: + object + required: + - name + - type + - config + properties: + name: + type: string + enum: ["redis"] + type: + type: string + enum: ["input"] + comment: + type: string + config: + $ref: '#/components/schemas/TelegrafPluginInputRedisConfig' + TelegrafPluginInputSyslog: + type: + object + required: + - name + - type + - config + properties: + name: + type: string + enum: ["syslog"] + type: + type: string + enum: ["input"] + comment: + type: string + config: + $ref: '#/components/schemas/TelegrafPluginInputSyslogConfig' + TelegrafPluginInputSwap: + type: + object + required: + - name + - type + properties: + name: + type: string + enum: ["swap"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputSystem: + type: + object + required: + - name + - type + properties: + name: + type: string + enum: ["system"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginInputTail: + type: + object + required: + - name + - type + properties: + name: + type: string + enum: ["tail"] + type: + type: string + enum: ["input"] + comment: + type: string + TelegrafPluginOutputFile: + type: + object + required: + - name + - type + - config + properties: + name: + type: string + enum: ["file"] + type: + type: string + enum: ["output"] + comment: + type: string + config: + $ref: '#/components/schemas/TelegrafPluginOutputFileConfig' + TelegrafPluginOutputInfluxDBV2: + type: + object + required: + - name + - type + - config + properties: + name: + type: string + enum: ["influxdb_v2"] + type: + type: string + enum: ["output"] + comment: + type: string + config: + $ref: '#/components/schemas/TelegrafPluginOutputInfluxDBV2Config' + Telegraf: + type: object + allOf: + - $ref: "#/components/schemas/TelegrafRequest" + - type: object + properties: + id: + type: string + readOnly: true + links: + type: object + readOnly: true + example: + self: "/api/v2/telegrafs/1" + lables: "/api/v2/telegrafs/1/labels" + owners: "/api/v2/telegrafs/1/owners" + members: "/api/v2/telegrafs/1/members" + properties: + self: + $ref: "#/components/schemas/Link" + labels: + $ref: "#/components/schemas/Link" + members: + $ref: "#/components/schemas/Link" + owners: + $ref: "#/components/schemas/Link" + labels: + readOnly: true + $ref: "#/components/schemas/Labels" + Telegrafs: + type: object + properties: + configurations: + type: array + items: + $ref: "#/components/schemas/Telegraf" + TelegrafPlugin: + type: object + properties: + type: + type: string + name: + type: string + description: + type: string + config: + type: string + TelegrafPlugins: + type: object + properties: + version: + type: string + os: + type: string + plugins: + type: array + items: + $ref: "#/components/schemas/TelegrafPlugin" + TelegrafPluginInputDockerConfig: + type: object + required: + - endpoint + properties: + endpoint: + type: string + TelegrafPluginInputFileConfig: + type: object + properties: + files: + type: array + items: + type: string + TelegrafPluginInputKubernetesConfig: + type: object + properties: + url: + type: string + format: uri + TelegrafPluginInputLogParserConfig: + type: object + properties: + files: + type: array + items: + type: string + TelegrafPluginInputProcstatConfig: + type: object + properties: + exe: + type: string + TelegrafPluginInputPrometheusConfig: + type: object + properties: + urls: + type: array + items: + type: string + format: uri + TelegrafPluginInputRedisConfig: + type: object + properties: + servers: + type: array + items: + type: string + password: + type: string + TelegrafPluginInputSyslogConfig: + type: object + properties: + server: + type: string + TelegrafPluginOutputFileConfig: + type: object + required: + - files + properties: + files: + type: array + items: + type: object + properties: + type: + type: string + enum: [stdout, path] + path: + type: string + TelegrafPluginOutputInfluxDBV2Config: + type: object + required: + - urls + - token + - organization + - bucket + properties: + urls: + type: array + items: + type: string + format: uri + token: + type: string + organization: + type: string + bucket: + type: string + IsOnboarding: + type: object + properties: + allowed: + description: True means that the influxdb instance has NOT had initial setup; false means that the database has been setup. + type: boolean + OnboardingRequest: + type: object + properties: + username: + type: string + password: + type: string + org: + type: string + bucket: + type: string + retentionPeriodHrs: + type: integer + required: + - username + - password + - org + - bucket + OnboardingResponse: + type: object + properties: + user: + $ref: "#/components/schemas/User" + org: + $ref: "#/components/schemas/Organization" + bucket: + $ref: "#/components/schemas/Bucket" + auth: + $ref: "#/components/schemas/Authorization" + PasswordResetBody: + properties: + password: + type: string + required: + - password + AddResourceMemberRequestBody: + type: object + properties: + id: + type: string + name: + type: string + required: + - id + Ready: + type: object + properties: + status: + type: string + enum: + - ready + started: + type: string + format: date-time + example: "2019-03-13T10:09:33.891196-04:00" + up: + type: string + example: "14m45.911966424s" + HealthCheck: + type: object + required: + - name + - status + properties: + name: + type: string + message: + type: string + checks: + type: array + items: + $ref: "#/components/schemas/HealthCheck" + status: + type: string + enum: + - pass + - fail + Labels: + type: array + items: + $ref: "#/components/schemas/Label" + Label: + type: object + properties: + id: + readOnly: true + type: string + orgID: + readOnly: true + type: string + name: + type: string + properties: + type: object + additionalProperties: + type: string + description: Key/Value pairs associated with this label. Keys can be removed by sending an update with an empty value. + example: {"color": "ffb3b3", "description": "this is a description"} + LabelCreateRequest: + type: object + required: [orgID] + properties: + orgID: + type: string + name: + type: string + properties: + type: object + additionalProperties: + type: string + description: Key/Value pairs associated with this label. Keys can be removed by sending an update with an empty value. + example: {"color": "ffb3b3", "description": "this is a description"} + LabelUpdate: + type: object + properties: + name: + type: string + properties: + type: object + description: Key/Value pairs associated with this label. Keys can be removed by sending an update with an empty value. + example: {"color": "ffb3b3", "description": "this is a description"} + LabelMapping: + type: object + properties: + labelID: + type: string + LabelsResponse: + type: object + properties: + labels: + $ref: "#/components/schemas/Labels" + links: + $ref: "#/components/schemas/Links" + LabelResponse: + type: object + properties: + label: + $ref: "#/components/schemas/Label" + links: + $ref: "#/components/schemas/Links" + ASTResponse: + description: Contains the AST for the supplied Flux query + type: object + properties: + ast: + $ref: "#/components/schemas/Package" + WritePrecision: + type: string + enum: + - ms + - s + - us + - ns + TaskCreateRequest: + type: object + properties: + orgID: + description: The ID of the organization that owns this Task. + type: string + org: + description: The name of the organization that owns this Task. + type: string + status: + $ref: "#/components/schemas/TaskStatusType" + flux: + description: The Flux script to run for this task. + type: string + description: + description: An optional description of the task. + type: string + required: [flux] + TaskUpdateRequest: + type: object + properties: + status: + $ref: "#/components/schemas/TaskStatusType" + flux: + description: The Flux script to run for this task. + type: string + name: + description: Override the 'name' option in the flux script. + type: string + every: + description: Override the 'every' option in the flux script. + type: string + cron: + description: Override the 'cron' option in the flux script. + type: string + offset: + description: Override the 'offset' option in the flux script. + type: string + description: + description: An optional description of the task. + type: string + FluxResponse: + description: Rendered flux that backs the check or notification. + properties: + flux: + type: string + CheckPatch: + type: object + properties: + name: + type: string + description: + type: string + status: + type: string + enum: + - active + - inactive + CheckDiscriminator: + oneOf: + - $ref: "#/components/schemas/DeadmanCheck" + - $ref: "#/components/schemas/ThresholdCheck" + - $ref: "#/components/schemas/CustomCheck" + discriminator: + propertyName: type + mapping: + deadman: "#/components/schemas/DeadmanCheck" + threshold: "#/components/schemas/ThresholdCheck" + custom: "#/components/schemas/CustomCheck" + Check: + allOf: + - $ref: "#/components/schemas/CheckDiscriminator" + PostCheck: + allOf: + - $ref: "#/components/schemas/CheckDiscriminator" + Checks: + properties: + checks: + type: array + items: + $ref: "#/components/schemas/Check" + links: + $ref: "#/components/schemas/Links" + CheckBase: + properties: + id: + readOnly: true + type: string + name: + type: string + orgID: + description: The ID of the organization that owns this check. + type: string + ownerID: + description: The ID of creator used to create this check. + type: string + readOnly: true + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + query: + $ref: "#/components/schemas/DashboardQuery" + status: + $ref: "#/components/schemas/TaskStatusType" + description: + description: An optional description of the check. + type: string + latestCompleted: + description: Timestamp of latest scheduled, completed run, RFC3339. + type: string + format: date-time + readOnly: true + lastRunStatus: + readOnly: true + type: string + enum: + - failed + - success + - canceled + lastRunError: + readOnly: true + type: string + labels: + $ref: "#/components/schemas/Labels" + links: + type: object + readOnly: true + example: + self: "/api/v2/checks/1" + labels: "/api/v2/checks/1/labels" + members: "/api/v2/checks/1/members" + owners: "/api/v2/checks/1/owners" + query: "/api/v2/checks/1/query" + properties: + self: + description: URL for this check + $ref: "#/components/schemas/Link" + labels: + description: URL to retrieve labels for this check + $ref: "#/components/schemas/Link" + members: + description: URL to retrieve members for this check + $ref: "#/components/schemas/Link" + owners: + description: URL to retrieve owners for this check + $ref: "#/components/schemas/Link" + query: + description: URL to retrieve flux script for this check + $ref: "#/components/schemas/Link" + required: [name, orgID, query] + ThresholdCheck: + allOf: + - $ref: "#/components/schemas/CheckBase" + - type: object + required: [type] + properties: + type: + type: string + enum: [threshold] + thresholds: + type: array + items: + $ref: "#/components/schemas/Threshold" + every: + description: Check repetition interval. + type: string + offset: + description: Duration to delay after the schedule, before executing check. + type: string + tags: + description: List of tags to write to each status. + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + statusMessageTemplate: + description: The template used to generate and write a status message. + type: string + Threshold: + oneOf: + - $ref: "#/components/schemas/GreaterThreshold" + - $ref: "#/components/schemas/LesserThreshold" + - $ref: "#/components/schemas/RangeThreshold" + discriminator: + propertyName: type + mapping: + greater: "#/components/schemas/GreaterThreshold" + lesser: "#/components/schemas/LesserThreshold" + range: "#/components/schemas/RangeThreshold" + DeadmanCheck: + allOf: + - $ref: "#/components/schemas/CheckBase" + - type: object + required: [type] + properties: + type: + type: string + enum: [deadman] + timeSince: + description: String duration before deadman triggers. + type: string + staleTime: + description: String duration for time that a series is considered stale and should not trigger deadman. + type: string + reportZero: + description: If only zero values reported since time, trigger an alert + type: boolean + level: + $ref: "#/components/schemas/CheckStatusLevel" + every: + description: Check repetition interval. + type: string + offset: + description: Duration to delay after the schedule, before executing check. + type: string + tags: + description: List of tags to write to each status. + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + statusMessageTemplate: + description: The template used to generate and write a status message. + type: string + CustomCheck: + allOf: + - $ref: "#/components/schemas/CheckBase" + - type: object + properties: + type: + type: string + enum: [custom] + required: [type] + ThresholdBase: + properties: + level: + $ref: "#/components/schemas/CheckStatusLevel" + allValues: + description: If true, only alert if all values meet threshold. + type: boolean + GreaterThreshold: + allOf: + - $ref: "#/components/schemas/ThresholdBase" + - type: object + required: [type, value] + properties: + type: + type: string + enum: [greater] + value: + type: number + format: float + LesserThreshold: + allOf: + - $ref: "#/components/schemas/ThresholdBase" + - type: object + required: [type, value] + properties: + type: + type: string + enum: [lesser] + value: + type: number + format: float + RangeThreshold: + allOf: + - $ref: "#/components/schemas/ThresholdBase" + - type: object + required: [type, min, max, within] + properties: + type: + type: string + enum: [range] + min: + type: number + format: float + max: + type: number + format: float + within: + type: boolean + CheckStatusLevel: + description: The state to record if check matches a criteria. + type: string + enum: ["UNKNOWN", "OK", "INFO", "CRIT", "WARN"] + RuleStatusLevel: + description: The state to record if check matches a criteria. + type: string + enum: ["UNKNOWN", "OK", "INFO", "CRIT", "WARN", "ANY"] + NotificationRuleUpdate: + type: object + properties: + name: + type: string + description: + type: string + status: + type: string + enum: + - active + - inactive + NotificationRuleDiscriminator: + oneOf: + - $ref: "#/components/schemas/SlackNotificationRule" + - $ref: "#/components/schemas/SMTPNotificationRule" + - $ref: "#/components/schemas/PagerDutyNotificationRule" + - $ref: "#/components/schemas/HTTPNotificationRule" + discriminator: + propertyName: type + mapping: + slack: "#/components/schemas/SlackNotificationRule" + smtp: "#/components/schemas/SMTPNotificationRule" + pagerduty: "#/components/schemas/PagerDutyNotificationRule" + http: "#/components/schemas/HTTPNotificationRule" + NotificationRule: + allOf: + - $ref: "#/components/schemas/NotificationRuleDiscriminator" + PostNotificationRule: + allOf: + - $ref: "#/components/schemas/NotificationRuleDiscriminator" + NotificationRules: + properties: + notificationRules: + type: array + items: + $ref: "#/components/schemas/NotificationRule" + links: + $ref: "#/components/schemas/Links" + NotificationRuleBase: + type: object + required: + - id + - orgID + - status + - name + - tagRules + - statusRules + - endpointID + properties: + latestCompleted: + description: Timestamp of latest scheduled, completed run, RFC3339. + type: string + format: date-time + readOnly: true + lastRunStatus: + readOnly: true + type: string + enum: + - failed + - success + - canceled + lastRunError: + readOnly: true + type: string + id: + readOnly: true + type: string + endpointID: + type: string + orgID: + description: The ID of the organization that owns this notification rule. + type: string + ownerID: + description: The ID of creator used to create this notification rule. + type: string + readOnly: true + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + status: + $ref: "#/components/schemas/TaskStatusType" + name: + description: Human-readable name describing the notification rule. + type: string + sleepUntil: + type: string + every: + description: The notification repetition interval. + type: string + offset: + description: Duration to delay after the schedule, before executing check. + type: string + runbookLink: + type: string + limitEvery: + description: Don't notify me more than times every seconds. If set, limit cannot be empty. + type: integer + limit: + description: Don't notify me more than times every seconds. If set, limitEvery cannot be empty. + type: integer + tagRules: + description: List of tag rules the notification rule attempts to match. + type: array + items: + $ref: "#/components/schemas/TagRule" + description: + description: An optional description of the notification rule. + type: string + statusRules: + description: List of status rules the notification rule attempts to match. + type: array + minItems: 1 + items: + $ref: "#/components/schemas/StatusRule" + labels: + $ref: "#/components/schemas/Labels" + links: + type: object + readOnly: true + example: + self: "/api/v2/notificationRules/1" + labels: "/api/v2/notificationRules/1/labels" + members: "/api/v2/notificationRules/1/members" + owners: "/api/v2/notificationRules/1/owners" + query: "/api/v2/notificationRules/1/query" + properties: + self: + description: URL for this endpoint. + $ref: "#/components/schemas/Link" + labels: + description: URL to retrieve labels for this notification rule. + $ref: "#/components/schemas/Link" + members: + description: URL to retrieve members for this notification rule. + $ref: "#/components/schemas/Link" + owners: + description: URL to retrieve owners for this notification rule. + $ref: "#/components/schemas/Link" + query: + description: URL to retrieve flux script for this notification rule. + $ref: "#/components/schemas/Link" + TagRule: + type: object + properties: + key: + type: string + value: + type: string + operator: + type: string + enum: ["equal", "notequal", "equalregex","notequalregex"] + StatusRule: + type: object + properties: + currentLevel: + $ref: "#/components/schemas/RuleStatusLevel" + previousLevel: + $ref: "#/components/schemas/RuleStatusLevel" + count: + type: integer + period: + type: string + HTTPNotificationRuleBase: + type: object + required: [type] + properties: + type: + type: string + enum: [http] + url: + type: string + HTTPNotificationRule: + allOf: + - $ref: "#/components/schemas/NotificationRuleBase" + - $ref: "#/components/schemas/HTTPNotificationRuleBase" + SlackNotificationRuleBase: + type: object + required: [type, messageTemplate] + properties: + type: + type: string + enum: [slack] + channel: + type: string + messageTemplate: + type: string + SlackNotificationRule: + allOf: + - $ref: "#/components/schemas/NotificationRuleBase" + - $ref: "#/components/schemas/SlackNotificationRuleBase" + SMTPNotificationRule: + allOf: + - $ref: "#/components/schemas/NotificationRuleBase" + - $ref: "#/components/schemas/SMTPNotificationRuleBase" + SMTPNotificationRuleBase: + type: object + required: [type, subjectTemplate, to] + properties: + type: + type: string + enum: [smtp] + subjectTemplate: + type: string + bodyTemplate: + type: string + to: + type: string + PagerDutyNotificationRule: + allOf: + - $ref: "#/components/schemas/NotificationRuleBase" + - $ref: "#/components/schemas/PagerDutyNotificationRuleBase" + PagerDutyNotificationRuleBase: + type: object + required: [type, messageTemplate] + properties: + type: + type: string + enum: [pagerduty] + messageTemplate: + type: string + NotificationEndpointUpdate: + type: object + + properties: + name: + type: string + description: + type: string + status: + type: string + enum: + - active + - inactive + NotificationEndpointDiscrimator: + oneOf: + - $ref: "#/components/schemas/SlackNotificationEndpoint" + - $ref: "#/components/schemas/PagerDutyNotificationEndpoint" + - $ref: "#/components/schemas/HTTPNotificationEndpoint" + discriminator: + propertyName: type + mapping: + slack: "#/components/schemas/SlackNotificationEndpoint" + pagerduty: "#/components/schemas/PagerDutyNotificationEndpoint" + http: "#/components/schemas/HTTPNotificationEndpoint" + NotificationEndpoint: + allOf: + - $ref: "#/components/schemas/NotificationEndpointDiscrimator" + PostNotificationEndpoint: + allOf: + - $ref: "#/components/schemas/NotificationEndpointDiscrimator" + NotificationEndpoints: + properties: + notificationEndpoints: + type: array + items: + $ref: "#/components/schemas/NotificationEndpoint" + links: + $ref: "#/components/schemas/Links" + NotificationEndpointBase: + type: object + required: [type, name] + properties: + id: + type: string + orgID: + type: string + userID: + type: string + createdAt: + type: string + format: date-time + readOnly: true + updatedAt: + type: string + format: date-time + readOnly: true + description: + description: An optional description of the notification endpoint. + type: string + name: + type: string + status: + description: The status of the endpoint. + default: active + type: string + enum: ["active", "inactive"] + labels: + $ref: "#/components/schemas/Labels" + links: + type: object + readOnly: true + example: + self: "/api/v2/notificationEndpoints/1" + labels: "/api/v2/notificationEndpoints/1/labels" + members: "/api/v2/notificationEndpoints/1/members" + owners: "/api/v2/notificationEndpoints/1/owners" + properties: + self: + description: URL for this endpoint. + $ref: "#/components/schemas/Link" + labels: + description: URL to retrieve labels for this endpoint. + $ref: "#/components/schemas/Link" + members: + description: URL to retrieve members for this endpoint. + $ref: "#/components/schemas/Link" + owners: + description: URL to retrieve owners for this endpoint. + $ref: "#/components/schemas/Link" + type: + $ref: "#/components/schemas/NotificationEndpointType" + SlackNotificationEndpoint: + type: object + allOf: + - $ref: "#/components/schemas/NotificationEndpointBase" + - type: object + properties: + url: + description: Specifies the URL of the Slack endpoint. Specify either `URL` or `Token`. + type: string + token: + description: Specifies the API token string. Specify either `URL` or `Token`. + type: string + PagerDutyNotificationEndpoint: + type: object + allOf: + - $ref: "#/components/schemas/NotificationEndpointBase" + - type: object + required: [routingKey] + properties: + clientURL: + type: string + routingKey: + type: string + HTTPNotificationEndpoint: + type: object + allOf: + - $ref: "#/components/schemas/NotificationEndpointBase" + - type: object + required: [url, authMethod, method] + properties: + url: + type: string + username: + type: string + password: + type: string + token: + type: string + method: + type: string + enum: ['POST', 'GET', 'PUT'] + authMethod: + type: string + enum: ['none', 'basic', 'bearer'] + contentTemplate: + type: string + headers: + type: object + description: Customized headers. + additionalProperties: + type: string + NotificationEndpointType: + type: string + enum: ['slack', 'pagerduty', 'http'] + securitySchemes: + BasicAuth: + type: http + scheme: basic diff --git a/domain/templates/client-with-responses.tmpl b/domain/templates/client-with-responses.tmpl new file mode 100644 index 00000000..fe18e3bb --- /dev/null +++ b/domain/templates/client-with-responses.tmpl @@ -0,0 +1,86 @@ +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(service ihttp.Service) (*ClientWithResponses) { + client := NewClient(service) + return &ClientWithResponses{client} +} + +{{range .}}{{$opid := .OperationId}}{{$op := .}} +type {{$opid | lcFirst}}Response struct { + Body []byte + HTTPResponse *http.Response + {{- range getResponseTypeDefinitions .}} + {{.TypeName}} *{{.Schema.TypeDecl}} + {{- end}} +} + +// Status returns HTTPResponse.Status +func (r {{$opid | lcFirst}}Response) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r {{$opid | lcFirst}}Response) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} +{{end}} + + +{{range .}} +{{$opid := .OperationId -}} +{{/* Generate client methods (with responses)*/}} + +// {{$opid}}{{if .HasBody}}WithBody{{end}}WithResponse request{{if .HasBody}} with arbitrary body{{end}} returning *{{$opid}}Response +func (c *ClientWithResponses) {{$opid}}{{if .HasBody}}WithBody{{end}}WithResponse(ctx context.Context{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params *{{$opid}}Params{{end}}{{if .HasBody}}, contentType string, body io.Reader{{end}}) (*{{genResponseTypeName $opid}}, error){ + rsp, err := c.{{$opid}}{{if .HasBody}}WithBody{{end}}(ctx{{genParamNames .PathParams}}{{if .RequiresParamObject}}, params{{end}}{{if .HasBody}}, contentType, body{{end}}) + if err != nil { + return nil, err + } + return Parse{{genResponseTypeName $opid | ucFirst}}(rsp) +} + +{{$hasParams := .RequiresParamObject -}} +{{$pathParams := .PathParams -}} +{{$bodyRequired := .BodyRequired -}} +{{range .Bodies}} +func (c *ClientWithResponses) {{$opid}}{{.Suffix}}WithResponse(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}, body {{$opid}}{{.NameTag}}RequestBody) (*{{genResponseTypeName $opid}}, error) { + rsp, err := c.{{$opid}}{{.Suffix}}(ctx{{genParamNames $pathParams}}{{if $hasParams}}, params{{end}}, body) + if err != nil { + return nil, err + } + return Parse{{genResponseTypeName $opid | ucFirst}}(rsp) +} +{{end}} + +{{end}}{{/* operations */}} + +{{/* Generate parse functions for responses*/}} +{{range .}}{{$opid := .OperationId}} + +// Parse{{genResponseTypeName $opid | ucFirst}} parses an HTTP response from a {{$opid}}WithResponse call +func Parse{{genResponseTypeName $opid | ucFirst}}(rsp *http.Response) (*{{genResponseTypeName $opid}}, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := {{genResponsePayload $opid}} + + {{genResponseUnmarshal .}} + + return response, nil +} +{{end}}{{/* range . $opid := .OperationId */}} + diff --git a/domain/templates/client.tmpl b/domain/templates/client.tmpl new file mode 100644 index 00000000..a2fdc298 --- /dev/null +++ b/domain/templates/client.tmpl @@ -0,0 +1,224 @@ + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + service ihttp.Service +} + +// Creates a new Client, with reasonable defaults +func NewClient(service ihttp.Service) (*Client) { + // create a client with sane default values + client := Client{ + service: service, + } + return &client +} + + +// The interface specification for the client above. +type ClientInterface interface { +{{range . -}} +{{$hasParams := .RequiresParamObject -}} +{{$pathParams := .PathParams -}} +{{$opid := .OperationId -}} + // {{$opid}} request {{if .HasBody}} with any body{{end}} + {{$opid}}{{if .HasBody}}WithBody{{end}}(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}{{if .HasBody}}, contentType string, body io.Reader{{end}}) (*http.Response, error) +{{range .Bodies}} + {{$opid}}{{.Suffix}}(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}, body {{$opid}}{{.NameTag}}RequestBody) (*http.Response, error) +{{end}}{{/* range .Bodies */}} +{{end}}{{/* range . $opid := .OperationId */}} +} + + +{{/* Generate client methods */}} +{{range . -}} +{{$hasParams := .RequiresParamObject -}} +{{$pathParams := .PathParams -}} +{{$opid := .OperationId -}} + +func (c *Client) {{$opid}}{{if .HasBody}}WithBody{{end}}(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}{{if .HasBody}}, contentType string, body io.Reader{{end}}) (*http.Response, error) { + req, err := New{{$opid}}Request{{if .HasBody}}WithBody{{end}}(c.service.ServerApiUrl(){{genParamNames .PathParams}}{{if $hasParams}}, params{{end}}{{if .HasBody}}, contentType, body{{end}}) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} + +{{range .Bodies}} +func (c *Client) {{$opid}}{{.Suffix}}(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}, body {{$opid}}{{.NameTag}}RequestBody) (*http.Response, error) { + req, err := New{{$opid}}{{.Suffix}}Request(c.service.ServerApiUrl(){{genParamNames $pathParams}}{{if $hasParams}}, params{{end}}, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + var res *http.Response + perr := c.service.DoHttpRequest(req, nil, func(resp *http.Response) error { + res = resp + return nil + }) + if perr != nil { + return nil, perr + } + return res, nil +} +{{end}}{{/* range .Bodies */}} +{{end}} + +{{/* Generate request builders */}} +{{range .}} +{{$hasParams := .RequiresParamObject -}} +{{$pathParams := .PathParams -}} +{{$bodyRequired := .BodyRequired -}} +{{$opid := .OperationId -}} + +{{range .Bodies}} +// New{{$opid}}Request{{.Suffix}} calls the generic {{$opid}} builder with {{.ContentType}} body +func New{{$opid}}Request{{.Suffix}}(server string{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}, body {{$opid}}{{.NameTag}}RequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return New{{$opid}}RequestWithBody(server{{genParamNames $pathParams}}{{if $hasParams}}, params{{end}}, "{{.ContentType}}", bodyReader) +} +{{end}} + +// New{{$opid}}Request{{if .HasBody}}WithBody{{end}} generates requests for {{$opid}}{{if .HasBody}} with any type of body{{end}} +func New{{$opid}}Request{{if .HasBody}}WithBody{{end}}(server string{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}{{if .HasBody}}, contentType string, body io.Reader{{end}}) (*http.Request, error) { + var err error +{{range $paramIdx, $param := .PathParams}} + var pathParam{{$paramIdx}} string + {{if .IsPassThrough}} + pathParam{{$paramIdx}} = {{.ParamName}} + {{end}} + {{if .IsJson}} + var pathParamBuf{{$paramIdx}} []byte + pathParamBuf{{$paramIdx}}, err = json.Marshal({{.ParamName}}) + if err != nil { + return nil, err + } + pathParam{{$paramIdx}} = string(pathParamBuf{{$paramIdx}}) + {{end}} + {{if .IsStyled}} + pathParam{{$paramIdx}}, err = runtime.StyleParam("{{.Style}}", {{.Explode}}, "{{.ParamName}}", {{.GoVariableName}}) + if err != nil { + return nil, err + } + {{end}} +{{end}} + queryUrl, err := url.Parse(server) + if err != nil { + return nil, err + } + + basePath := fmt.Sprintf("{{genParamFmtString .Path}}"{{range $paramIdx, $param := .PathParams}}, pathParam{{$paramIdx}}{{end}}) + if basePath[0] == '/' { + basePath = basePath[1:] + } + + queryUrl, err = queryUrl.Parse(basePath) + if err != nil { + return nil, err + } +{{if .QueryParams}} + queryValues := queryUrl.Query() +{{range $paramIdx, $param := .QueryParams}} + {{if not .Required}} if params.{{.GoName}} != nil { {{end}} + {{if .IsPassThrough}} + queryValues.Add("{{.ParamName}}", {{if not .Required}}*{{end}}params.{{.GoName}}) + {{end}} + {{if .IsJson}} + if queryParamBuf, err := json.Marshal({{if not .Required}}*{{end}}params.{{.GoName}}); err != nil { + return nil, err + } else { + queryValues.Add("{{.ParamName}}", string(queryParamBuf)) + } + + {{end}} + {{if .IsStyled}} + if queryFrag, err := runtime.StyleParam("{{.Style}}", {{.Explode}}, "{{.ParamName}}", {{if not .Required}}*{{end}}params.{{.GoName}}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + {{end}} + {{if not .Required}}}{{end}} +{{end}} + queryUrl.RawQuery = queryValues.Encode() +{{end}}{{/* if .QueryParams */}} + req, err := http.NewRequest("{{.Method}}", queryUrl.String(), {{if .HasBody}}body{{else}}nil{{end}}) + if err != nil { + return nil, err + } + +{{range $paramIdx, $param := .HeaderParams}} + {{if not .Required}} if params.{{.GoName}} != nil { {{end}} + var headerParam{{$paramIdx}} string + {{if .IsPassThrough}} + headerParam{{$paramIdx}} = {{if not .Required}}*{{end}}params.{{.GoName}} + {{end}} + {{if .IsJson}} + var headerParamBuf{{$paramIdx}} []byte + headerParamBuf{{$paramIdx}}, err = json.Marshal({{if not .Required}}*{{end}}params.{{.GoName}}) + if err != nil { + return nil, err + } + headerParam{{$paramIdx}} = string(headerParamBuf{{$paramIdx}}) + {{end}} + {{if .IsStyled}} + headerParam{{$paramIdx}}, err = runtime.StyleParam("{{.Style}}", {{.Explode}}, "{{.ParamName}}", {{if not .Required}}*{{end}}params.{{.GoName}}) + if err != nil { + return nil, err + } + {{end}} + req.Header.Add("{{.ParamName}}", headerParam{{$paramIdx}}) + {{if not .Required}}}{{end}} +{{end}} + +{{range $paramIdx, $param := .CookieParams}} + {{if not .Required}} if params.{{.GoName}} != nil { {{end}} + var cookieParam{{$paramIdx}} string + {{if .IsPassThrough}} + cookieParam{{$paramIdx}} = {{if not .Required}}*{{end}}params.{{.GoName}} + {{end}} + {{if .IsJson}} + var cookieParamBuf{{$paramIdx}} []byte + cookieParamBuf{{$paramIdx}}, err = json.Marshal({{if not .Required}}*{{end}}params.{{.GoName}}) + if err != nil { + return nil, err + } + cookieParam{{$paramIdx}} = url.QueryEscape(string(cookieParamBuf{{$paramIdx}})) + {{end}} + {{if .IsStyled}} + cookieParam{{$paramIdx}}, err = runtime.StyleParam("simple", {{.Explode}}, "{{.ParamName}}", {{if not .Required}}*{{end}}params.{{.GoName}}) + if err != nil { + return nil, err + } + {{end}} + cookie{{$paramIdx}} := &http.Cookie{ + Name:"{{.ParamName}}", + Value:cookieParam{{$paramIdx}}, + } + req.AddCookie(cookie{{$paramIdx}}) + {{if not .Required}}}{{end}} +{{end}} + {{if .HasBody}}req.Header.Add("Content-Type", contentType){{end}} + return req, nil +} + +{{end}}{{/* Range */}} diff --git a/domain/templates/imports.tmpl b/domain/templates/imports.tmpl new file mode 100644 index 00000000..35b1df25 --- /dev/null +++ b/domain/templates/imports.tmpl @@ -0,0 +1,12 @@ +// Package {{.PackageName}} provides primitives to interact the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT. +package {{.PackageName}} + +{{if .Imports}} +import ( +{{range .Imports}} {{ . }} +{{end}} + ihttp "github.com/influxdata/influxdb-client-go/internal/http" +) +{{end}} diff --git a/domain/types.go b/domain/types.gen.go similarity index 73% rename from domain/types.go rename to domain/types.gen.go index 081cd275..fa212b87 100644 --- a/domain/types.go +++ b/domain/types.gen.go @@ -10,6 +10,908 @@ import ( "time" ) +// Defines values for AuthorizationUpdateRequestStatus. +const ( + AuthorizationUpdateRequestStatusActive AuthorizationUpdateRequestStatus = "active" + + AuthorizationUpdateRequestStatusInactive AuthorizationUpdateRequestStatus = "inactive" +) + +// Defines values for AxisBase. +const ( + AxisBase10 AxisBase = "10" + + AxisBase2 AxisBase = "2" + + AxisBaseEmpty AxisBase = "" +) + +// Defines values for AxisScale. +const ( + AxisScaleLinear AxisScale = "linear" + + AxisScaleLog AxisScale = "log" +) + +// Defines values for BucketType. +const ( + BucketTypeSystem BucketType = "system" + + BucketTypeUser BucketType = "user" +) + +// Defines values for BuilderAggregateFunctionType. +const ( + BuilderAggregateFunctionTypeFilter BuilderAggregateFunctionType = "filter" + + BuilderAggregateFunctionTypeGroup BuilderAggregateFunctionType = "group" +) + +// Defines values for CheckBaseLastRunStatus. +const ( + CheckBaseLastRunStatusCanceled CheckBaseLastRunStatus = "canceled" + + CheckBaseLastRunStatusFailed CheckBaseLastRunStatus = "failed" + + CheckBaseLastRunStatusSuccess CheckBaseLastRunStatus = "success" +) + +// Defines values for CheckPatchStatus. +const ( + CheckPatchStatusActive CheckPatchStatus = "active" + + CheckPatchStatusInactive CheckPatchStatus = "inactive" +) + +// Defines values for CheckStatusLevel. +const ( + CheckStatusLevelCRIT CheckStatusLevel = "CRIT" + + CheckStatusLevelINFO CheckStatusLevel = "INFO" + + CheckStatusLevelOK CheckStatusLevel = "OK" + + CheckStatusLevelUNKNOWN CheckStatusLevel = "UNKNOWN" + + CheckStatusLevelWARN CheckStatusLevel = "WARN" +) + +// Defines values for CheckViewPropertiesShape. +const ( + CheckViewPropertiesShapeChronografV2 CheckViewPropertiesShape = "chronograf-v2" +) + +// Defines values for CheckViewPropertiesType. +const ( + CheckViewPropertiesTypeCheck CheckViewPropertiesType = "check" +) + +// Defines values for ConstantVariablePropertiesType. +const ( + ConstantVariablePropertiesTypeConstant ConstantVariablePropertiesType = "constant" +) + +// Defines values for CustomCheckType. +const ( + CustomCheckTypeCustom CustomCheckType = "custom" +) + +// Defines values for DashboardColorType. +const ( + DashboardColorTypeBackground DashboardColorType = "background" + + DashboardColorTypeMax DashboardColorType = "max" + + DashboardColorTypeMin DashboardColorType = "min" + + DashboardColorTypeScale DashboardColorType = "scale" + + DashboardColorTypeText DashboardColorType = "text" + + DashboardColorTypeThreshold DashboardColorType = "threshold" +) + +// Defines values for DeadmanCheckType. +const ( + DeadmanCheckTypeDeadman DeadmanCheckType = "deadman" +) + +// Defines values for DialectAnnotations. +const ( + DialectAnnotationsDatatype DialectAnnotations = "datatype" + + DialectAnnotationsDefault DialectAnnotations = "default" + + DialectAnnotationsGroup DialectAnnotations = "group" +) + +// Defines values for DialectDateTimeFormat. +const ( + DialectDateTimeFormatRFC3339 DialectDateTimeFormat = "RFC3339" + + DialectDateTimeFormatRFC3339Nano DialectDateTimeFormat = "RFC3339Nano" +) + +// Defines values for ErrorCode. +const ( + ErrorCodeConflict ErrorCode = "conflict" + + ErrorCodeEmptyValue ErrorCode = "empty value" + + ErrorCodeForbidden ErrorCode = "forbidden" + + ErrorCodeInternalError ErrorCode = "internal error" + + ErrorCodeInvalid ErrorCode = "invalid" + + ErrorCodeMethodNotAllowed ErrorCode = "method not allowed" + + ErrorCodeNotFound ErrorCode = "not found" + + ErrorCodeTooManyRequests ErrorCode = "too many requests" + + ErrorCodeUnauthorized ErrorCode = "unauthorized" + + ErrorCodeUnavailable ErrorCode = "unavailable" + + ErrorCodeUnprocessableEntity ErrorCode = "unprocessable entity" +) + +// Defines values for FieldType. +const ( + FieldTypeField FieldType = "field" + + FieldTypeFunc FieldType = "func" + + FieldTypeInteger FieldType = "integer" + + FieldTypeNumber FieldType = "number" + + FieldTypeRegex FieldType = "regex" + + FieldTypeWildcard FieldType = "wildcard" +) + +// Defines values for GaugeViewPropertiesShape. +const ( + GaugeViewPropertiesShapeChronografV2 GaugeViewPropertiesShape = "chronograf-v2" +) + +// Defines values for GaugeViewPropertiesType. +const ( + GaugeViewPropertiesTypeGauge GaugeViewPropertiesType = "gauge" +) + +// Defines values for GreaterThresholdType. +const ( + GreaterThresholdTypeGreater GreaterThresholdType = "greater" +) + +// Defines values for HTTPNotificationEndpointAuthMethod. +const ( + HTTPNotificationEndpointAuthMethodBasic HTTPNotificationEndpointAuthMethod = "basic" + + HTTPNotificationEndpointAuthMethodBearer HTTPNotificationEndpointAuthMethod = "bearer" + + HTTPNotificationEndpointAuthMethodNone HTTPNotificationEndpointAuthMethod = "none" +) + +// Defines values for HTTPNotificationEndpointMethod. +const ( + HTTPNotificationEndpointMethodGET HTTPNotificationEndpointMethod = "GET" + + HTTPNotificationEndpointMethodPOST HTTPNotificationEndpointMethod = "POST" + + HTTPNotificationEndpointMethodPUT HTTPNotificationEndpointMethod = "PUT" +) + +// Defines values for HTTPNotificationRuleBaseType. +const ( + HTTPNotificationRuleBaseTypeHttp HTTPNotificationRuleBaseType = "http" +) + +// Defines values for HealthCheckStatus. +const ( + HealthCheckStatusFail HealthCheckStatus = "fail" + + HealthCheckStatusPass HealthCheckStatus = "pass" +) + +// Defines values for HeatmapViewPropertiesShape. +const ( + HeatmapViewPropertiesShapeChronografV2 HeatmapViewPropertiesShape = "chronograf-v2" +) + +// Defines values for HeatmapViewPropertiesType. +const ( + HeatmapViewPropertiesTypeHeatmap HeatmapViewPropertiesType = "heatmap" +) + +// Defines values for HistogramViewPropertiesPosition. +const ( + HistogramViewPropertiesPositionOverlaid HistogramViewPropertiesPosition = "overlaid" + + HistogramViewPropertiesPositionStacked HistogramViewPropertiesPosition = "stacked" +) + +// Defines values for HistogramViewPropertiesShape. +const ( + HistogramViewPropertiesShapeChronografV2 HistogramViewPropertiesShape = "chronograf-v2" +) + +// Defines values for HistogramViewPropertiesType. +const ( + HistogramViewPropertiesTypeHistogram HistogramViewPropertiesType = "histogram" +) + +// Defines values for InfluxQLQueryType. +const ( + InfluxQLQueryTypeInfluxql InfluxQLQueryType = "influxql" +) + +// Defines values for LegendOrientation. +const ( + LegendOrientationBottom LegendOrientation = "bottom" + + LegendOrientationLeft LegendOrientation = "left" + + LegendOrientationRight LegendOrientation = "right" + + LegendOrientationTop LegendOrientation = "top" +) + +// Defines values for LegendType. +const ( + LegendTypeStatic LegendType = "static" +) + +// Defines values for LesserThresholdType. +const ( + LesserThresholdTypeLesser LesserThresholdType = "lesser" +) + +// Defines values for LinePlusSingleStatPropertiesPosition. +const ( + LinePlusSingleStatPropertiesPositionOverlaid LinePlusSingleStatPropertiesPosition = "overlaid" + + LinePlusSingleStatPropertiesPositionStacked LinePlusSingleStatPropertiesPosition = "stacked" +) + +// Defines values for LinePlusSingleStatPropertiesShape. +const ( + LinePlusSingleStatPropertiesShapeChronografV2 LinePlusSingleStatPropertiesShape = "chronograf-v2" +) + +// Defines values for LinePlusSingleStatPropertiesType. +const ( + LinePlusSingleStatPropertiesTypeLinePlusSingleStat LinePlusSingleStatPropertiesType = "line-plus-single-stat" +) + +// Defines values for LineProtocolErrorCode. +const ( + LineProtocolErrorCodeConflict LineProtocolErrorCode = "conflict" + + LineProtocolErrorCodeEmptyValue LineProtocolErrorCode = "empty value" + + LineProtocolErrorCodeInternalError LineProtocolErrorCode = "internal error" + + LineProtocolErrorCodeInvalid LineProtocolErrorCode = "invalid" + + LineProtocolErrorCodeNotFound LineProtocolErrorCode = "not found" + + LineProtocolErrorCodeUnavailable LineProtocolErrorCode = "unavailable" +) + +// Defines values for LineProtocolLengthErrorCode. +const ( + LineProtocolLengthErrorCodeInvalid LineProtocolLengthErrorCode = "invalid" +) + +// Defines values for MapVariablePropertiesType. +const ( + MapVariablePropertiesTypeMap MapVariablePropertiesType = "map" +) + +// Defines values for MarkdownViewPropertiesShape. +const ( + MarkdownViewPropertiesShapeChronografV2 MarkdownViewPropertiesShape = "chronograf-v2" +) + +// Defines values for MarkdownViewPropertiesType. +const ( + MarkdownViewPropertiesTypeMarkdown MarkdownViewPropertiesType = "markdown" +) + +// Defines values for NotificationEndpointBaseStatus. +const ( + NotificationEndpointBaseStatusActive NotificationEndpointBaseStatus = "active" + + NotificationEndpointBaseStatusInactive NotificationEndpointBaseStatus = "inactive" +) + +// Defines values for NotificationEndpointType. +const ( + NotificationEndpointTypeHttp NotificationEndpointType = "http" + + NotificationEndpointTypePagerduty NotificationEndpointType = "pagerduty" + + NotificationEndpointTypeSlack NotificationEndpointType = "slack" +) + +// Defines values for NotificationEndpointUpdateStatus. +const ( + NotificationEndpointUpdateStatusActive NotificationEndpointUpdateStatus = "active" + + NotificationEndpointUpdateStatusInactive NotificationEndpointUpdateStatus = "inactive" +) + +// Defines values for NotificationRuleBaseLastRunStatus. +const ( + NotificationRuleBaseLastRunStatusCanceled NotificationRuleBaseLastRunStatus = "canceled" + + NotificationRuleBaseLastRunStatusFailed NotificationRuleBaseLastRunStatus = "failed" + + NotificationRuleBaseLastRunStatusSuccess NotificationRuleBaseLastRunStatus = "success" +) + +// Defines values for NotificationRuleUpdateStatus. +const ( + NotificationRuleUpdateStatusActive NotificationRuleUpdateStatus = "active" + + NotificationRuleUpdateStatusInactive NotificationRuleUpdateStatus = "inactive" +) + +// Defines values for OrganizationStatus. +const ( + OrganizationStatusActive OrganizationStatus = "active" + + OrganizationStatusInactive OrganizationStatus = "inactive" +) + +// Defines values for PagerDutyNotificationRuleBaseType. +const ( + PagerDutyNotificationRuleBaseTypePagerduty PagerDutyNotificationRuleBaseType = "pagerduty" +) + +// Defines values for PermissionAction. +const ( + PermissionActionRead PermissionAction = "read" + + PermissionActionWrite PermissionAction = "write" +) + +// Defines values for PkgKind. +const ( + PkgKindBucket PkgKind = "Bucket" + + PkgKindCheckDeadman PkgKind = "CheckDeadman" + + PkgKindCheckThreshold PkgKind = "CheckThreshold" + + PkgKindDashboard PkgKind = "Dashboard" + + PkgKindLabel PkgKind = "Label" + + PkgKindNotificationEndpointHTTP PkgKind = "NotificationEndpointHTTP" + + PkgKindNotificationEndpointPagerDuty PkgKind = "NotificationEndpointPagerDuty" + + PkgKindNotificationEndpointSlack PkgKind = "NotificationEndpointSlack" + + PkgKindNotificationRule PkgKind = "NotificationRule" + + PkgKindTask PkgKind = "Task" + + PkgKindTelegraf PkgKind = "Telegraf" + + PkgKindVariable PkgKind = "Variable" +) + +// Defines values for PkgCreateKind. +const ( + PkgCreateKindBucket PkgCreateKind = "bucket" + + PkgCreateKindCheck PkgCreateKind = "check" + + PkgCreateKindDashboard PkgCreateKind = "dashboard" + + PkgCreateKindLabel PkgCreateKind = "label" + + PkgCreateKindNotificationEndpoint PkgCreateKind = "notification_endpoint" + + PkgCreateKindNotificationRule PkgCreateKind = "notification_rule" + + PkgCreateKindTask PkgCreateKind = "task" + + PkgCreateKindTelegraf PkgCreateKind = "telegraf" + + PkgCreateKindVariable PkgCreateKind = "variable" +) + +// Defines values for QueryType. +const ( + QueryTypeFlux QueryType = "flux" +) + +// Defines values for QueryEditMode. +const ( + QueryEditModeAdvanced QueryEditMode = "advanced" + + QueryEditModeBuilder QueryEditMode = "builder" +) + +// Defines values for QueryVariablePropertiesType. +const ( + QueryVariablePropertiesTypeQuery QueryVariablePropertiesType = "query" +) + +// Defines values for RangeThresholdType. +const ( + RangeThresholdTypeRange RangeThresholdType = "range" +) + +// Defines values for ReadyStatus. +const ( + ReadyStatusReady ReadyStatus = "ready" +) + +// Defines values for ResourceType. +const ( + ResourceTypeAuthorizations ResourceType = "authorizations" + + ResourceTypeBuckets ResourceType = "buckets" + + ResourceTypeChecks ResourceType = "checks" + + ResourceTypeDashboards ResourceType = "dashboards" + + ResourceTypeDocuments ResourceType = "documents" + + ResourceTypeLabels ResourceType = "labels" + + ResourceTypeNotificationEndpoints ResourceType = "notificationEndpoints" + + ResourceTypeNotificationRules ResourceType = "notificationRules" + + ResourceTypeOrgs ResourceType = "orgs" + + ResourceTypeScrapers ResourceType = "scrapers" + + ResourceTypeSecrets ResourceType = "secrets" + + ResourceTypeSources ResourceType = "sources" + + ResourceTypeTasks ResourceType = "tasks" + + ResourceTypeTelegrafs ResourceType = "telegrafs" + + ResourceTypeUsers ResourceType = "users" + + ResourceTypeVariables ResourceType = "variables" + + ResourceTypeViews ResourceType = "views" +) + +// Defines values for ResourceMemberRole. +const ( + ResourceMemberRoleMember ResourceMemberRole = "member" +) + +// Defines values for ResourceOwnerRole. +const ( + ResourceOwnerRoleOwner ResourceOwnerRole = "owner" +) + +// Defines values for RetentionRuleType. +const ( + RetentionRuleTypeExpire RetentionRuleType = "expire" +) + +// Defines values for RuleStatusLevel. +const ( + RuleStatusLevelANY RuleStatusLevel = "ANY" + + RuleStatusLevelCRIT RuleStatusLevel = "CRIT" + + RuleStatusLevelINFO RuleStatusLevel = "INFO" + + RuleStatusLevelOK RuleStatusLevel = "OK" + + RuleStatusLevelUNKNOWN RuleStatusLevel = "UNKNOWN" + + RuleStatusLevelWARN RuleStatusLevel = "WARN" +) + +// Defines values for RunStatus. +const ( + RunStatusCanceled RunStatus = "canceled" + + RunStatusFailed RunStatus = "failed" + + RunStatusScheduled RunStatus = "scheduled" + + RunStatusStarted RunStatus = "started" + + RunStatusSuccess RunStatus = "success" +) + +// Defines values for SMTPNotificationRuleBaseType. +const ( + SMTPNotificationRuleBaseTypeSmtp SMTPNotificationRuleBaseType = "smtp" +) + +// Defines values for ScatterViewPropertiesShape. +const ( + ScatterViewPropertiesShapeChronografV2 ScatterViewPropertiesShape = "chronograf-v2" +) + +// Defines values for ScatterViewPropertiesType. +const ( + ScatterViewPropertiesTypeScatter ScatterViewPropertiesType = "scatter" +) + +// Defines values for ScraperTargetRequestType. +const ( + ScraperTargetRequestTypePrometheus ScraperTargetRequestType = "prometheus" +) + +// Defines values for SingleStatViewPropertiesShape. +const ( + SingleStatViewPropertiesShapeChronografV2 SingleStatViewPropertiesShape = "chronograf-v2" +) + +// Defines values for SingleStatViewPropertiesType. +const ( + SingleStatViewPropertiesTypeSingleStat SingleStatViewPropertiesType = "single-stat" +) + +// Defines values for SlackNotificationRuleBaseType. +const ( + SlackNotificationRuleBaseTypeSlack SlackNotificationRuleBaseType = "slack" +) + +// Defines values for SourceLanguages. +const ( + SourceLanguagesFlux SourceLanguages = "flux" + + SourceLanguagesInfluxql SourceLanguages = "influxql" +) + +// Defines values for SourceType. +const ( + SourceTypeSelf SourceType = "self" + + SourceTypeV1 SourceType = "v1" + + SourceTypeV2 SourceType = "v2" +) + +// Defines values for TableViewPropertiesShape. +const ( + TableViewPropertiesShapeChronografV2 TableViewPropertiesShape = "chronograf-v2" +) + +// Defines values for TableViewPropertiesTableOptionsWrapping. +const ( + TableViewPropertiesTableOptionsWrappingSingleLine TableViewPropertiesTableOptionsWrapping = "single-line" + + TableViewPropertiesTableOptionsWrappingTruncate TableViewPropertiesTableOptionsWrapping = "truncate" + + TableViewPropertiesTableOptionsWrappingWrap TableViewPropertiesTableOptionsWrapping = "wrap" +) + +// Defines values for TableViewPropertiesType. +const ( + TableViewPropertiesTypeTable TableViewPropertiesType = "table" +) + +// Defines values for TagRuleOperator. +const ( + TagRuleOperatorEqual TagRuleOperator = "equal" + + TagRuleOperatorEqualregex TagRuleOperator = "equalregex" + + TagRuleOperatorNotequal TagRuleOperator = "notequal" + + TagRuleOperatorNotequalregex TagRuleOperator = "notequalregex" +) + +// Defines values for TaskLastRunStatus. +const ( + TaskLastRunStatusCanceled TaskLastRunStatus = "canceled" + + TaskLastRunStatusFailed TaskLastRunStatus = "failed" + + TaskLastRunStatusSuccess TaskLastRunStatus = "success" +) + +// Defines values for TaskStatusType. +const ( + TaskStatusTypeActive TaskStatusType = "active" + + TaskStatusTypeInactive TaskStatusType = "inactive" +) + +// Defines values for TelegrafPluginInputCpuName. +const ( + TelegrafPluginInputCpuNameCpu TelegrafPluginInputCpuName = "cpu" +) + +// Defines values for TelegrafPluginInputCpuType. +const ( + TelegrafPluginInputCpuTypeInput TelegrafPluginInputCpuType = "input" +) + +// Defines values for TelegrafPluginInputDiskName. +const ( + TelegrafPluginInputDiskNameDisk TelegrafPluginInputDiskName = "disk" +) + +// Defines values for TelegrafPluginInputDiskType. +const ( + TelegrafPluginInputDiskTypeInput TelegrafPluginInputDiskType = "input" +) + +// Defines values for TelegrafPluginInputDiskioName. +const ( + TelegrafPluginInputDiskioNameDiskio TelegrafPluginInputDiskioName = "diskio" +) + +// Defines values for TelegrafPluginInputDiskioType. +const ( + TelegrafPluginInputDiskioTypeInput TelegrafPluginInputDiskioType = "input" +) + +// Defines values for TelegrafPluginInputDockerName. +const ( + TelegrafPluginInputDockerNameDocker TelegrafPluginInputDockerName = "docker" +) + +// Defines values for TelegrafPluginInputDockerType. +const ( + TelegrafPluginInputDockerTypeInput TelegrafPluginInputDockerType = "input" +) + +// Defines values for TelegrafPluginInputFileName. +const ( + TelegrafPluginInputFileNameFile TelegrafPluginInputFileName = "file" +) + +// Defines values for TelegrafPluginInputFileType. +const ( + TelegrafPluginInputFileTypeInput TelegrafPluginInputFileType = "input" +) + +// Defines values for TelegrafPluginInputKernelName. +const ( + TelegrafPluginInputKernelNameKernel TelegrafPluginInputKernelName = "kernel" +) + +// Defines values for TelegrafPluginInputKernelType. +const ( + TelegrafPluginInputKernelTypeInput TelegrafPluginInputKernelType = "input" +) + +// Defines values for TelegrafPluginInputKubernetesName. +const ( + TelegrafPluginInputKubernetesNameKubernetes TelegrafPluginInputKubernetesName = "kubernetes" +) + +// Defines values for TelegrafPluginInputKubernetesType. +const ( + TelegrafPluginInputKubernetesTypeInput TelegrafPluginInputKubernetesType = "input" +) + +// Defines values for TelegrafPluginInputLogParserName. +const ( + TelegrafPluginInputLogParserNameLogparser TelegrafPluginInputLogParserName = "logparser" +) + +// Defines values for TelegrafPluginInputLogParserType. +const ( + TelegrafPluginInputLogParserTypeInput TelegrafPluginInputLogParserType = "input" +) + +// Defines values for TelegrafPluginInputMemName. +const ( + TelegrafPluginInputMemNameMem TelegrafPluginInputMemName = "mem" +) + +// Defines values for TelegrafPluginInputMemType. +const ( + TelegrafPluginInputMemTypeInput TelegrafPluginInputMemType = "input" +) + +// Defines values for TelegrafPluginInputNetName. +const ( + TelegrafPluginInputNetNameNet TelegrafPluginInputNetName = "net" +) + +// Defines values for TelegrafPluginInputNetType. +const ( + TelegrafPluginInputNetTypeInput TelegrafPluginInputNetType = "input" +) + +// Defines values for TelegrafPluginInputNetResponseName. +const ( + TelegrafPluginInputNetResponseNameNetResponse TelegrafPluginInputNetResponseName = "net_response" +) + +// Defines values for TelegrafPluginInputNetResponseType. +const ( + TelegrafPluginInputNetResponseTypeInput TelegrafPluginInputNetResponseType = "input" +) + +// Defines values for TelegrafPluginInputNginxName. +const ( + TelegrafPluginInputNginxNameNginx TelegrafPluginInputNginxName = "nginx" +) + +// Defines values for TelegrafPluginInputNginxType. +const ( + TelegrafPluginInputNginxTypeInput TelegrafPluginInputNginxType = "input" +) + +// Defines values for TelegrafPluginInputProcessesName. +const ( + TelegrafPluginInputProcessesNameProcesses TelegrafPluginInputProcessesName = "processes" +) + +// Defines values for TelegrafPluginInputProcessesType. +const ( + TelegrafPluginInputProcessesTypeInput TelegrafPluginInputProcessesType = "input" +) + +// Defines values for TelegrafPluginInputProcstatName. +const ( + TelegrafPluginInputProcstatNameProcstat TelegrafPluginInputProcstatName = "procstat" +) + +// Defines values for TelegrafPluginInputProcstatType. +const ( + TelegrafPluginInputProcstatTypeInput TelegrafPluginInputProcstatType = "input" +) + +// Defines values for TelegrafPluginInputPrometheusName. +const ( + TelegrafPluginInputPrometheusNamePrometheus TelegrafPluginInputPrometheusName = "prometheus" +) + +// Defines values for TelegrafPluginInputPrometheusType. +const ( + TelegrafPluginInputPrometheusTypeInput TelegrafPluginInputPrometheusType = "input" +) + +// Defines values for TelegrafPluginInputRedisName. +const ( + TelegrafPluginInputRedisNameRedis TelegrafPluginInputRedisName = "redis" +) + +// Defines values for TelegrafPluginInputRedisType. +const ( + TelegrafPluginInputRedisTypeInput TelegrafPluginInputRedisType = "input" +) + +// Defines values for TelegrafPluginInputSwapName. +const ( + TelegrafPluginInputSwapNameSwap TelegrafPluginInputSwapName = "swap" +) + +// Defines values for TelegrafPluginInputSwapType. +const ( + TelegrafPluginInputSwapTypeInput TelegrafPluginInputSwapType = "input" +) + +// Defines values for TelegrafPluginInputSyslogName. +const ( + TelegrafPluginInputSyslogNameSyslog TelegrafPluginInputSyslogName = "syslog" +) + +// Defines values for TelegrafPluginInputSyslogType. +const ( + TelegrafPluginInputSyslogTypeInput TelegrafPluginInputSyslogType = "input" +) + +// Defines values for TelegrafPluginInputSystemName. +const ( + TelegrafPluginInputSystemNameSystem TelegrafPluginInputSystemName = "system" +) + +// Defines values for TelegrafPluginInputSystemType. +const ( + TelegrafPluginInputSystemTypeInput TelegrafPluginInputSystemType = "input" +) + +// Defines values for TelegrafPluginInputTailName. +const ( + TelegrafPluginInputTailNameTail TelegrafPluginInputTailName = "tail" +) + +// Defines values for TelegrafPluginInputTailType. +const ( + TelegrafPluginInputTailTypeInput TelegrafPluginInputTailType = "input" +) + +// Defines values for TelegrafPluginOutputFileName. +const ( + TelegrafPluginOutputFileNameFile TelegrafPluginOutputFileName = "file" +) + +// Defines values for TelegrafPluginOutputFileType. +const ( + TelegrafPluginOutputFileTypeOutput TelegrafPluginOutputFileType = "output" +) + +// Defines values for TelegrafPluginOutputFileConfigFilesType. +const ( + TelegrafPluginOutputFileConfigFilesTypePath TelegrafPluginOutputFileConfigFilesType = "path" + + TelegrafPluginOutputFileConfigFilesTypeStdout TelegrafPluginOutputFileConfigFilesType = "stdout" +) + +// Defines values for TelegrafPluginOutputInfluxDBV2Name. +const ( + TelegrafPluginOutputInfluxDBV2NameInfluxdbV2 TelegrafPluginOutputInfluxDBV2Name = "influxdb_v2" +) + +// Defines values for TelegrafPluginOutputInfluxDBV2Type. +const ( + TelegrafPluginOutputInfluxDBV2TypeOutput TelegrafPluginOutputInfluxDBV2Type = "output" +) + +// Defines values for ThresholdCheckType. +const ( + ThresholdCheckTypeThreshold ThresholdCheckType = "threshold" +) + +// Defines values for UserStatus. +const ( + UserStatusActive UserStatus = "active" + + UserStatusInactive UserStatus = "inactive" +) + +// Defines values for WritePrecision. +const ( + WritePrecisionMs WritePrecision = "ms" + + WritePrecisionNs WritePrecision = "ns" + + WritePrecisionS WritePrecision = "s" + + WritePrecisionUs WritePrecision = "us" +) + +// Defines values for XYGeom. +const ( + XYGeomBar XYGeom = "bar" + + XYGeomLine XYGeom = "line" + + XYGeomMonotoneX XYGeom = "monotoneX" + + XYGeomStacked XYGeom = "stacked" + + XYGeomStep XYGeom = "step" +) + +// Defines values for XYViewPropertiesPosition. +const ( + XYViewPropertiesPositionOverlaid XYViewPropertiesPosition = "overlaid" + + XYViewPropertiesPositionStacked XYViewPropertiesPosition = "stacked" +) + +// Defines values for XYViewPropertiesShape. +const ( + XYViewPropertiesShapeChronografV2 XYViewPropertiesShape = "chronograf-v2" +) + +// Defines values for XYViewPropertiesType. +const ( + XYViewPropertiesTypeXy XYViewPropertiesType = "xy" +) + // ASTResponse defines model for ASTResponse. type ASTResponse struct { @@ -86,9 +988,12 @@ type AuthorizationUpdateRequest struct { Description *string `json:"description,omitempty"` // If inactive the token is inactive and requests using the token will be rejected. - Status *string `json:"status,omitempty"` + Status *AuthorizationUpdateRequestStatus `json:"status,omitempty"` } +// AuthorizationUpdateRequestStatus defines model for AuthorizationUpdateRequest.Status. +type AuthorizationUpdateRequestStatus string + // Authorizations defines model for Authorizations. type Authorizations struct { Authorizations *[]Authorization `json:"authorizations,omitempty"` @@ -109,7 +1014,7 @@ type Axes struct { type Axis struct { // Base represents the radix for formatting axis values. - Base *string `json:"base,omitempty"` + Base *AxisBase `json:"base,omitempty"` // The extents of an axis in the form [lower, upper]. Clients determine whether bounds are to be inclusive or exclusive of their limits Bounds *[]string `json:"bounds,omitempty"` @@ -127,6 +1032,9 @@ type Axis struct { Suffix *string `json:"suffix,omitempty"` } +// AxisBase defines model for Axis.Base. +type AxisBase string + // AxisScale defines model for AxisScale. type AxisScale string @@ -203,10 +1111,13 @@ type Bucket struct { // Rules to expire or retain data. No rules means data never expires. RetentionRules RetentionRules `json:"retentionRules"` Rp *string `json:"rp,omitempty"` - Type *string `json:"type,omitempty"` + Type *BucketType `json:"type,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` } +// BucketType defines model for Bucket.Type. +type BucketType string + // Buckets defines model for Buckets. type Buckets struct { Buckets *[]Bucket `json:"buckets,omitempty"` @@ -309,11 +1220,11 @@ type CheckBase struct { CreatedAt *time.Time `json:"createdAt,omitempty"` // An optional description of the check. - Description *string `json:"description,omitempty"` - Id *string `json:"id,omitempty"` - Labels *Labels `json:"labels,omitempty"` - LastRunError *string `json:"lastRunError,omitempty"` - LastRunStatus *string `json:"lastRunStatus,omitempty"` + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + Labels *Labels `json:"labels,omitempty"` + LastRunError *string `json:"lastRunError,omitempty"` + LastRunStatus *CheckBaseLastRunStatus `json:"lastRunStatus,omitempty"` // Timestamp of latest scheduled, completed run, RFC3339. LatestCompleted *time.Time `json:"latestCompleted,omitempty"` @@ -346,16 +1257,22 @@ type CheckBase struct { UpdatedAt *time.Time `json:"updatedAt,omitempty"` } +// CheckBaseLastRunStatus defines model for CheckBase.LastRunStatus. +type CheckBaseLastRunStatus string + // CheckDiscriminator defines model for CheckDiscriminator. type CheckDiscriminator interface{} // CheckPatch defines model for CheckPatch. type CheckPatch struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - Status *string `json:"status,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Status *CheckPatchStatus `json:"status,omitempty"` } +// CheckPatchStatus defines model for CheckPatch.Status. +type CheckPatchStatus string + // CheckStatusLevel defines model for CheckStatusLevel. type CheckStatusLevel string @@ -365,12 +1282,18 @@ type CheckViewProperties struct { CheckID string `json:"checkID"` // Colors define color encoding of data into a visualization - Colors []string `json:"colors"` - Queries []DashboardQuery `json:"queries"` - Shape string `json:"shape"` - Type string `json:"type"` + Colors []string `json:"colors"` + Queries []DashboardQuery `json:"queries"` + Shape CheckViewPropertiesShape `json:"shape"` + Type CheckViewPropertiesType `json:"type"` } +// CheckViewPropertiesShape defines model for CheckViewProperties.Shape. +type CheckViewPropertiesShape string + +// CheckViewPropertiesType defines model for CheckViewProperties.Type. +type CheckViewPropertiesType string + // Checks defines model for Checks. type Checks struct { Checks *[]Check `json:"checks,omitempty"` @@ -389,10 +1312,13 @@ type ConditionalExpression struct { // ConstantVariableProperties defines model for ConstantVariableProperties. type ConstantVariableProperties struct { - Type *string `json:"type,omitempty"` - Values *[]string `json:"values,omitempty"` + Type *ConstantVariablePropertiesType `json:"type,omitempty"` + Values *[]string `json:"values,omitempty"` } +// ConstantVariablePropertiesType defines model for ConstantVariableProperties.Type. +type ConstantVariablePropertiesType string + // CreateCell defines model for CreateCell. type CreateCell struct { H *int32 `json:"h,omitempty"` @@ -423,9 +1349,12 @@ type CustomCheck struct { // Embedded struct due to allOf(#/components/schemas/CheckBase) CheckBase // Embedded fields due to inline allOf schema - Type string `json:"type"` + Type CustomCheckType `json:"type"` } +// CustomCheckType defines model for CustomCheck.Type. +type CustomCheckType string + // Dashboard defines model for Dashboard. type Dashboard struct { // Embedded struct due to allOf(#/components/schemas/CreateDashboardRequest) @@ -476,12 +1405,15 @@ type DashboardColor struct { Name string `json:"name"` // Type is how the color is used. - Type string `json:"type"` + Type DashboardColorType `json:"type"` // The data value mapped to this color. Value float32 `json:"value"` } +// DashboardColorType defines model for DashboardColor.Type. +type DashboardColorType string + // DashboardQuery defines model for DashboardQuery. type DashboardQuery struct { BuilderConfig *BuilderConfig `json:"builderConfig,omitempty"` @@ -574,10 +1506,13 @@ type DeadmanCheck struct { } `json:"tags,omitempty"` // String duration before deadman triggers. - TimeSince *string `json:"timeSince,omitempty"` - Type string `json:"type"` + TimeSince *string `json:"timeSince,omitempty"` + Type DeadmanCheckType `json:"type"` } +// DeadmanCheckType defines model for DeadmanCheck.Type. +type DeadmanCheckType string + // DecimalPlaces defines model for DecimalPlaces. type DecimalPlaces struct { @@ -605,13 +1540,13 @@ type DeletePredicateRequest struct { type Dialect struct { // Https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#columns - Annotations *[]string `json:"annotations,omitempty"` + Annotations *[]DialectAnnotations `json:"annotations,omitempty"` // Character prefixed to comment strings CommentPrefix *string `json:"commentPrefix,omitempty"` // Format of timestamps - DateTimeFormat *string `json:"dateTimeFormat,omitempty"` + DateTimeFormat *DialectDateTimeFormat `json:"dateTimeFormat,omitempty"` // Separator between cells; the default is , Delimiter *string `json:"delimiter,omitempty"` @@ -620,6 +1555,12 @@ type Dialect struct { Header *bool `json:"header,omitempty"` } +// DialectAnnotations defines model for Dialect.Annotations. +type DialectAnnotations string + +// DialectDateTimeFormat defines model for Dialect.DateTimeFormat. +type DialectDateTimeFormat string + // Document defines model for Document. type Document struct { Content map[string]interface{} `json:"content"` @@ -705,12 +1646,15 @@ type DurationLiteral struct { type Error struct { // Code is the machine-readable error code. - Code string `json:"code"` + Code ErrorCode `json:"code"` // Message is a human-readable message. Message string `json:"message"` } +// ErrorCode defines model for Error.Code. +type ErrorCode string + // Expression defines model for Expression. type Expression interface{} @@ -732,12 +1676,15 @@ type Field struct { Args *[]Field `json:"args,omitempty"` // `type` describes the field type. `func` is a function. `field` is a field reference. - Type *string `json:"type,omitempty"` + Type *FieldType `json:"type,omitempty"` // value is the value of the field. Meaning of the value is implied by the `type` key Value *string `json:"value,omitempty"` } +// FieldType defines model for Field.Type. +type FieldType string + // File defines model for File. type File struct { @@ -807,51 +1754,66 @@ type GaugeViewProperties struct { DecimalPlaces DecimalPlaces `json:"decimalPlaces"` // Legend define encoding of data into a view's legend - Legend Legend `json:"legend"` - Note string `json:"note"` - Prefix string `json:"prefix"` - Queries []DashboardQuery `json:"queries"` - Shape string `json:"shape"` + Legend Legend `json:"legend"` + Note string `json:"note"` + Prefix string `json:"prefix"` + Queries []DashboardQuery `json:"queries"` + Shape GaugeViewPropertiesShape `json:"shape"` // If true, will display note when empty - ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` - Suffix string `json:"suffix"` - TickPrefix string `json:"tickPrefix"` - TickSuffix string `json:"tickSuffix"` - Type string `json:"type"` + ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` + Suffix string `json:"suffix"` + TickPrefix string `json:"tickPrefix"` + TickSuffix string `json:"tickSuffix"` + Type GaugeViewPropertiesType `json:"type"` } +// GaugeViewPropertiesShape defines model for GaugeViewProperties.Shape. +type GaugeViewPropertiesShape string + +// GaugeViewPropertiesType defines model for GaugeViewProperties.Type. +type GaugeViewPropertiesType string + // GreaterThreshold defines model for GreaterThreshold. type GreaterThreshold struct { // Embedded struct due to allOf(#/components/schemas/ThresholdBase) ThresholdBase // Embedded fields due to inline allOf schema - Type string `json:"type"` - Value float32 `json:"value"` + Type GreaterThresholdType `json:"type"` + Value float32 `json:"value"` } +// GreaterThresholdType defines model for GreaterThreshold.Type. +type GreaterThresholdType string + // HTTPNotificationEndpoint defines model for HTTPNotificationEndpoint. type HTTPNotificationEndpoint struct { // Embedded struct due to allOf(#/components/schemas/NotificationEndpointBase) NotificationEndpointBase // Embedded fields due to inline allOf schema - AuthMethod string `json:"authMethod"` - ContentTemplate *string `json:"contentTemplate,omitempty"` + AuthMethod HTTPNotificationEndpointAuthMethod `json:"authMethod"` + ContentTemplate *string `json:"contentTemplate,omitempty"` // Customized headers. Headers *HTTPNotificationEndpoint_Headers `json:"headers,omitempty"` - Method string `json:"method"` + Method HTTPNotificationEndpointMethod `json:"method"` Password *string `json:"password,omitempty"` Token *string `json:"token,omitempty"` Url string `json:"url"` Username *string `json:"username,omitempty"` } +// HTTPNotificationEndpointAuthMethod defines model for HTTPNotificationEndpoint.AuthMethod. +type HTTPNotificationEndpointAuthMethod string + // HTTPNotificationEndpoint_Headers defines model for HTTPNotificationEndpoint.Headers. type HTTPNotificationEndpoint_Headers struct { AdditionalProperties map[string]string `json:"-"` } +// HTTPNotificationEndpointMethod defines model for HTTPNotificationEndpoint.Method. +type HTTPNotificationEndpointMethod string + // HTTPNotificationRule defines model for HTTPNotificationRule. type HTTPNotificationRule struct { // Embedded struct due to allOf(#/components/schemas/NotificationRuleBase) @@ -862,64 +1824,85 @@ type HTTPNotificationRule struct { // HTTPNotificationRuleBase defines model for HTTPNotificationRuleBase. type HTTPNotificationRuleBase struct { - Type string `json:"type"` - Url *string `json:"url,omitempty"` + Type HTTPNotificationRuleBaseType `json:"type"` + Url *string `json:"url,omitempty"` } +// HTTPNotificationRuleBaseType defines model for HTTPNotificationRuleBase.Type. +type HTTPNotificationRuleBaseType string + // HealthCheck defines model for HealthCheck. type HealthCheck struct { - Checks *[]HealthCheck `json:"checks,omitempty"` - Message *string `json:"message,omitempty"` - Name string `json:"name"` - Status string `json:"status"` + Checks *[]HealthCheck `json:"checks,omitempty"` + Message *string `json:"message,omitempty"` + Name string `json:"name"` + Status HealthCheckStatus `json:"status"` } +// HealthCheckStatus defines model for HealthCheck.Status. +type HealthCheckStatus string + // HeatmapViewProperties defines model for HeatmapViewProperties. type HeatmapViewProperties struct { BinSize float32 `json:"binSize"` // Colors define color encoding of data into a visualization - Colors []string `json:"colors"` - Note string `json:"note"` - Queries []DashboardQuery `json:"queries"` - Shape string `json:"shape"` + Colors []string `json:"colors"` + Note string `json:"note"` + Queries []DashboardQuery `json:"queries"` + Shape HeatmapViewPropertiesShape `json:"shape"` // If true, will display note when empty - ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` - TimeFormat *string `json:"timeFormat,omitempty"` - Type string `json:"type"` - XAxisLabel string `json:"xAxisLabel"` - XColumn string `json:"xColumn"` - XDomain []float32 `json:"xDomain"` - XPrefix string `json:"xPrefix"` - XSuffix string `json:"xSuffix"` - YAxisLabel string `json:"yAxisLabel"` - YColumn string `json:"yColumn"` - YDomain []float32 `json:"yDomain"` - YPrefix string `json:"yPrefix"` - YSuffix string `json:"ySuffix"` -} + ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` + TimeFormat *string `json:"timeFormat,omitempty"` + Type HeatmapViewPropertiesType `json:"type"` + XAxisLabel string `json:"xAxisLabel"` + XColumn string `json:"xColumn"` + XDomain []float32 `json:"xDomain"` + XPrefix string `json:"xPrefix"` + XSuffix string `json:"xSuffix"` + YAxisLabel string `json:"yAxisLabel"` + YColumn string `json:"yColumn"` + YDomain []float32 `json:"yDomain"` + YPrefix string `json:"yPrefix"` + YSuffix string `json:"ySuffix"` +} + +// HeatmapViewPropertiesShape defines model for HeatmapViewProperties.Shape. +type HeatmapViewPropertiesShape string + +// HeatmapViewPropertiesType defines model for HeatmapViewProperties.Type. +type HeatmapViewPropertiesType string // HistogramViewProperties defines model for HistogramViewProperties. type HistogramViewProperties struct { BinCount int `json:"binCount"` // Colors define color encoding of data into a visualization - Colors []DashboardColor `json:"colors"` - FillColumns []string `json:"fillColumns"` - Note string `json:"note"` - Position string `json:"position"` - Queries []DashboardQuery `json:"queries"` - Shape string `json:"shape"` + Colors []DashboardColor `json:"colors"` + FillColumns []string `json:"fillColumns"` + Note string `json:"note"` + Position HistogramViewPropertiesPosition `json:"position"` + Queries []DashboardQuery `json:"queries"` + Shape HistogramViewPropertiesShape `json:"shape"` // If true, will display note when empty - ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` - Type string `json:"type"` - XAxisLabel string `json:"xAxisLabel"` - XColumn string `json:"xColumn"` - XDomain []float32 `json:"xDomain"` + ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` + Type HistogramViewPropertiesType `json:"type"` + XAxisLabel string `json:"xAxisLabel"` + XColumn string `json:"xColumn"` + XDomain []float32 `json:"xDomain"` } +// HistogramViewPropertiesPosition defines model for HistogramViewProperties.Position. +type HistogramViewPropertiesPosition string + +// HistogramViewPropertiesShape defines model for HistogramViewProperties.Shape. +type HistogramViewPropertiesShape string + +// HistogramViewPropertiesType defines model for HistogramViewProperties.Type. +type HistogramViewPropertiesType string + // Identifier defines model for Identifier. type Identifier struct { Name *string `json:"name,omitempty"` @@ -960,9 +1943,12 @@ type InfluxQLQuery struct { Query string `json:"query"` // The type of query. Must be "influxql". - Type *string `json:"type,omitempty"` + Type *InfluxQLQueryType `json:"type,omitempty"` } +// InfluxQLQueryType defines model for InfluxQLQuery.Type. +type InfluxQLQueryType string + // IntegerLiteral defines model for IntegerLiteral. type IntegerLiteral struct { @@ -1046,21 +2032,30 @@ type LanguageRequest struct { type Legend struct { // orientation is the location of the legend with respect to the view graph - Orientation *string `json:"orientation,omitempty"` + Orientation *LegendOrientation `json:"orientation,omitempty"` // The style of the legend. - Type *string `json:"type,omitempty"` + Type *LegendType `json:"type,omitempty"` } +// LegendOrientation defines model for Legend.Orientation. +type LegendOrientation string + +// LegendType defines model for Legend.Type. +type LegendType string + // LesserThreshold defines model for LesserThreshold. type LesserThreshold struct { // Embedded struct due to allOf(#/components/schemas/ThresholdBase) ThresholdBase // Embedded fields due to inline allOf schema - Type string `json:"type"` - Value float32 `json:"value"` + Type LesserThresholdType `json:"type"` + Value float32 `json:"value"` } +// LesserThresholdType defines model for LesserThreshold.Type. +type LesserThresholdType string + // LinePlusSingleStatProperties defines model for LinePlusSingleStatProperties. type LinePlusSingleStatProperties struct { @@ -1074,27 +2069,36 @@ type LinePlusSingleStatProperties struct { DecimalPlaces DecimalPlaces `json:"decimalPlaces"` // Legend define encoding of data into a view's legend - Legend Legend `json:"legend"` - Note string `json:"note"` - Position string `json:"position"` - Prefix string `json:"prefix"` - Queries []DashboardQuery `json:"queries"` - ShadeBelow *bool `json:"shadeBelow,omitempty"` - Shape string `json:"shape"` + Legend Legend `json:"legend"` + Note string `json:"note"` + Position LinePlusSingleStatPropertiesPosition `json:"position"` + Prefix string `json:"prefix"` + Queries []DashboardQuery `json:"queries"` + ShadeBelow *bool `json:"shadeBelow,omitempty"` + Shape LinePlusSingleStatPropertiesShape `json:"shape"` // If true, will display note when empty - ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` - Suffix string `json:"suffix"` - Type string `json:"type"` - XColumn *string `json:"xColumn,omitempty"` - YColumn *string `json:"yColumn,omitempty"` + ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` + Suffix string `json:"suffix"` + Type LinePlusSingleStatPropertiesType `json:"type"` + XColumn *string `json:"xColumn,omitempty"` + YColumn *string `json:"yColumn,omitempty"` } +// LinePlusSingleStatPropertiesPosition defines model for LinePlusSingleStatProperties.Position. +type LinePlusSingleStatPropertiesPosition string + +// LinePlusSingleStatPropertiesShape defines model for LinePlusSingleStatProperties.Shape. +type LinePlusSingleStatPropertiesShape string + +// LinePlusSingleStatPropertiesType defines model for LinePlusSingleStatProperties.Type. +type LinePlusSingleStatPropertiesType string + // LineProtocolError defines model for LineProtocolError. type LineProtocolError struct { // Code is the machine-readable error code. - Code string `json:"code"` + Code LineProtocolErrorCode `json:"code"` // Err is a stack of errors that occurred during processing of the request. Useful for debugging. Err string `json:"err"` @@ -1109,11 +2113,14 @@ type LineProtocolError struct { Op string `json:"op"` } +// LineProtocolErrorCode defines model for LineProtocolError.Code. +type LineProtocolErrorCode string + // LineProtocolLengthError defines model for LineProtocolLengthError. type LineProtocolLengthError struct { // Code is the machine-readable error code. - Code string `json:"code"` + Code LineProtocolLengthErrorCode `json:"code"` // Max length in bytes for a body of line-protocol. MaxLength int32 `json:"maxLength"` @@ -1122,6 +2129,9 @@ type LineProtocolLengthError struct { Message string `json:"message"` } +// LineProtocolLengthErrorCode defines model for LineProtocolLengthError.Code. +type LineProtocolLengthErrorCode string + // Link defines model for Link. type Link string @@ -1165,10 +2175,13 @@ type Logs struct { // MapVariableProperties defines model for MapVariableProperties. type MapVariableProperties struct { - Type *string `json:"type,omitempty"` + Type *MapVariablePropertiesType `json:"type,omitempty"` Values *MapVariableProperties_Values `json:"values,omitempty"` } +// MapVariablePropertiesType defines model for MapVariableProperties.Type. +type MapVariablePropertiesType string + // MapVariableProperties_Values defines model for MapVariableProperties.Values. type MapVariableProperties_Values struct { AdditionalProperties map[string]string `json:"-"` @@ -1176,11 +2189,17 @@ type MapVariableProperties_Values struct { // MarkdownViewProperties defines model for MarkdownViewProperties. type MarkdownViewProperties struct { - Note string `json:"note"` - Shape string `json:"shape"` - Type string `json:"type"` + Note string `json:"note"` + Shape MarkdownViewPropertiesShape `json:"shape"` + Type MarkdownViewPropertiesType `json:"type"` } +// MarkdownViewPropertiesShape defines model for MarkdownViewProperties.Shape. +type MarkdownViewPropertiesShape string + +// MarkdownViewPropertiesType defines model for MarkdownViewProperties.Type. +type MarkdownViewPropertiesType string + // MemberAssignment defines model for MemberAssignment. type MemberAssignment struct { Init *Expression `json:"init,omitempty"` @@ -1239,12 +2258,15 @@ type NotificationEndpointBase struct { OrgID *string `json:"orgID,omitempty"` // The status of the endpoint. - Status *string `json:"status,omitempty"` - Type NotificationEndpointType `json:"type"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` - UserID *string `json:"userID,omitempty"` + Status *NotificationEndpointBaseStatus `json:"status,omitempty"` + Type NotificationEndpointType `json:"type"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UserID *string `json:"userID,omitempty"` } +// NotificationEndpointBaseStatus defines model for NotificationEndpointBase.Status. +type NotificationEndpointBaseStatus string + // NotificationEndpointDiscrimator defines model for NotificationEndpointDiscrimator. type NotificationEndpointDiscrimator interface{} @@ -1253,11 +2275,14 @@ type NotificationEndpointType string // NotificationEndpointUpdate defines model for NotificationEndpointUpdate. type NotificationEndpointUpdate struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - Status *string `json:"status,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Status *NotificationEndpointUpdateStatus `json:"status,omitempty"` } +// NotificationEndpointUpdateStatus defines model for NotificationEndpointUpdate.Status. +type NotificationEndpointUpdateStatus string + // NotificationEndpoints defines model for NotificationEndpoints. type NotificationEndpoints struct { Links *Links `json:"links,omitempty"` @@ -1279,11 +2304,11 @@ type NotificationRuleBase struct { EndpointID string `json:"endpointID"` // The notification repetition interval. - Every *string `json:"every,omitempty"` - Id string `json:"id"` - Labels *Labels `json:"labels,omitempty"` - LastRunError *string `json:"lastRunError,omitempty"` - LastRunStatus *string `json:"lastRunStatus,omitempty"` + Every *string `json:"every,omitempty"` + Id string `json:"id"` + Labels *Labels `json:"labels,omitempty"` + LastRunError *string `json:"lastRunError,omitempty"` + LastRunStatus *NotificationRuleBaseLastRunStatus `json:"lastRunStatus,omitempty"` // Timestamp of latest scheduled, completed run, RFC3339. LatestCompleted *time.Time `json:"latestCompleted,omitempty"` @@ -1334,16 +2359,22 @@ type NotificationRuleBase struct { UpdatedAt *time.Time `json:"updatedAt,omitempty"` } +// NotificationRuleBaseLastRunStatus defines model for NotificationRuleBase.LastRunStatus. +type NotificationRuleBaseLastRunStatus string + // NotificationRuleDiscriminator defines model for NotificationRuleDiscriminator. type NotificationRuleDiscriminator interface{} // NotificationRuleUpdate defines model for NotificationRuleUpdate. type NotificationRuleUpdate struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - Status *string `json:"status,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Status *NotificationRuleUpdateStatus `json:"status,omitempty"` } +// NotificationRuleUpdateStatus defines model for NotificationRuleUpdate.Status. +type NotificationRuleUpdateStatus string + // NotificationRules defines model for NotificationRules. type NotificationRules struct { Links *Links `json:"links,omitempty"` @@ -1446,10 +2477,13 @@ type Organization struct { Name string `json:"name"` // If inactive the organization is inactive. - Status *string `json:"status,omitempty"` - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Status *OrganizationStatus `json:"status,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` } +// OrganizationStatus defines model for Organization.Status. +type OrganizationStatus string + // Organizations defines model for Organizations. type Organizations struct { Links *Links `json:"links,omitempty"` @@ -1501,10 +2535,13 @@ type PagerDutyNotificationRule struct { // PagerDutyNotificationRuleBase defines model for PagerDutyNotificationRuleBase. type PagerDutyNotificationRuleBase struct { - MessageTemplate string `json:"messageTemplate"` - Type string `json:"type"` + MessageTemplate string `json:"messageTemplate"` + Type PagerDutyNotificationRuleBaseType `json:"type"` } +// PagerDutyNotificationRuleBaseType defines model for PagerDutyNotificationRuleBase.Type. +type PagerDutyNotificationRuleBaseType string + // ParenExpression defines model for ParenExpression. type ParenExpression struct { Expression *Expression `json:"expression,omitempty"` @@ -1520,24 +2557,13 @@ type PasswordResetBody struct { // Permission defines model for Permission. type Permission struct { - Action string `json:"action"` - Resource struct { - - // If ID is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type. - Id *string `json:"id,omitempty"` - - // Optional name of the resource if the resource has a name field. - Name *string `json:"name,omitempty"` - - // Optional name of the organization of the organization with orgID. - Org *string `json:"org,omitempty"` - - // If orgID is set that is a permission for all resources owned my that org. if it is not set it is a permission for all resources of that resource type. - OrgID *string `json:"orgID,omitempty"` - Type string `json:"type"` - } `json:"resource"` + Action PermissionAction `json:"action"` + Resource Resource `json:"resource"` } +// PermissionAction defines model for Permission.Action. +type PermissionAction string + // PipeExpression defines model for PipeExpression. type PipeExpression struct { Argument *Expression `json:"argument,omitempty"` @@ -1558,14 +2584,17 @@ type PipeLiteral struct { // Pkg defines model for Pkg. type Pkg []struct { - ApiVersion *string `json:"apiVersion,omitempty"` - Kind *string `json:"kind,omitempty"` + ApiVersion *string `json:"apiVersion,omitempty"` + Kind *PkgKind `json:"kind,omitempty"` Meta *struct { Name *string `json:"name,omitempty"` } `json:"meta,omitempty"` Spec *map[string]interface{} `json:"spec,omitempty"` } +// PkgKind defines model for Pkg.Kind. +type PkgKind string + // PkgApply defines model for PkgApply. type PkgApply struct { DryRun *bool `json:"dryRun,omitempty"` @@ -1867,39 +2896,51 @@ type Query struct { Query string `json:"query"` // The type of query. Must be "flux". - Type *string `json:"type,omitempty"` + Type *QueryType `json:"type,omitempty"` } +// QueryType defines model for Query.Type. +type QueryType string + // QueryEditMode defines model for QueryEditMode. type QueryEditMode string // QueryVariableProperties defines model for QueryVariableProperties. type QueryVariableProperties struct { - Type *string `json:"type,omitempty"` + Type *QueryVariablePropertiesType `json:"type,omitempty"` Values *struct { Language *string `json:"language,omitempty"` Query *string `json:"query,omitempty"` } `json:"values,omitempty"` } +// QueryVariablePropertiesType defines model for QueryVariableProperties.Type. +type QueryVariablePropertiesType string + // RangeThreshold defines model for RangeThreshold. type RangeThreshold struct { // Embedded struct due to allOf(#/components/schemas/ThresholdBase) ThresholdBase // Embedded fields due to inline allOf schema - Max float32 `json:"max"` - Min float32 `json:"min"` - Type string `json:"type"` - Within bool `json:"within"` + Max float32 `json:"max"` + Min float32 `json:"min"` + Type RangeThresholdType `json:"type"` + Within bool `json:"within"` } +// RangeThresholdType defines model for RangeThreshold.Type. +type RangeThresholdType string + // Ready defines model for Ready. type Ready struct { - Started *time.Time `json:"started,omitempty"` - Status *string `json:"status,omitempty"` - Up *string `json:"up,omitempty"` + Started *time.Time `json:"started,omitempty"` + Status *ReadyStatus `json:"status,omitempty"` + Up *string `json:"up,omitempty"` } +// ReadyStatus defines model for Ready.Status. +type ReadyStatus string + // RegexpLiteral defines model for RegexpLiteral. type RegexpLiteral struct { @@ -1921,14 +2962,37 @@ type RenamableField struct { Visible *bool `json:"visible,omitempty"` } +// Resource defines model for Resource. +type Resource struct { + + // If ID is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type. + Id *string `json:"id,omitempty"` + + // Optional name of the resource if the resource has a name field. + Name *string `json:"name,omitempty"` + + // Optional name of the organization of the organization with orgID. + Org *string `json:"org,omitempty"` + + // If orgID is set that is a permission for all resources owned my that org. if it is not set it is a permission for all resources of that resource type. + OrgID *string `json:"orgID,omitempty"` + Type ResourceType `json:"type"` +} + +// ResourceType defines model for Resource.Type. +type ResourceType string + // ResourceMember defines model for ResourceMember. type ResourceMember struct { // Embedded struct due to allOf(#/components/schemas/User) User // Embedded fields due to inline allOf schema - Role *string `json:"role,omitempty"` + Role *ResourceMemberRole `json:"role,omitempty"` } +// ResourceMemberRole defines model for ResourceMember.Role. +type ResourceMemberRole string + // ResourceMembers defines model for ResourceMembers. type ResourceMembers struct { Links *struct { @@ -1942,9 +3006,12 @@ type ResourceOwner struct { // Embedded struct due to allOf(#/components/schemas/User) User // Embedded fields due to inline allOf schema - Role *string `json:"role,omitempty"` + Role *ResourceOwnerRole `json:"role,omitempty"` } +// ResourceOwnerRole defines model for ResourceOwner.Role. +type ResourceOwnerRole string + // ResourceOwners defines model for ResourceOwners. type ResourceOwners struct { Links *struct { @@ -1957,10 +3024,13 @@ type ResourceOwners struct { type RetentionRule struct { // Duration in seconds for how long data will be kept in the database. - EverySeconds int `json:"everySeconds"` - Type string `json:"type"` + EverySeconds int `json:"everySeconds"` + Type RetentionRuleType `json:"type"` } +// RetentionRuleType defines model for RetentionRule.Type. +type RetentionRuleType string + // RetentionRules defines model for RetentionRules. type RetentionRules []RetentionRule @@ -2035,10 +3105,13 @@ type Run struct { // Time run started executing, RFC3339Nano. StartedAt *time.Time `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + Status *RunStatus `json:"status,omitempty"` TaskID *string `json:"taskID,omitempty"` } +// RunStatus defines model for Run.Status. +type RunStatus string + // RunManually defines model for RunManually. type RunManually struct { @@ -2062,38 +3135,47 @@ type SMTPNotificationRule struct { // SMTPNotificationRuleBase defines model for SMTPNotificationRuleBase. type SMTPNotificationRuleBase struct { - BodyTemplate *string `json:"bodyTemplate,omitempty"` - SubjectTemplate string `json:"subjectTemplate"` - To string `json:"to"` - Type string `json:"type"` + BodyTemplate *string `json:"bodyTemplate,omitempty"` + SubjectTemplate string `json:"subjectTemplate"` + To string `json:"to"` + Type SMTPNotificationRuleBaseType `json:"type"` } +// SMTPNotificationRuleBaseType defines model for SMTPNotificationRuleBase.Type. +type SMTPNotificationRuleBaseType string + // ScatterViewProperties defines model for ScatterViewProperties. type ScatterViewProperties struct { // Colors define color encoding of data into a visualization - Colors []string `json:"colors"` - FillColumns []string `json:"fillColumns"` - Note string `json:"note"` - Queries []DashboardQuery `json:"queries"` - Shape string `json:"shape"` + Colors []string `json:"colors"` + FillColumns []string `json:"fillColumns"` + Note string `json:"note"` + Queries []DashboardQuery `json:"queries"` + Shape ScatterViewPropertiesShape `json:"shape"` // If true, will display note when empty - ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` - SymbolColumns []string `json:"symbolColumns"` - TimeFormat *string `json:"timeFormat,omitempty"` - Type string `json:"type"` - XAxisLabel string `json:"xAxisLabel"` - XColumn string `json:"xColumn"` - XDomain []float32 `json:"xDomain"` - XPrefix string `json:"xPrefix"` - XSuffix string `json:"xSuffix"` - YAxisLabel string `json:"yAxisLabel"` - YColumn string `json:"yColumn"` - YDomain []float32 `json:"yDomain"` - YPrefix string `json:"yPrefix"` - YSuffix string `json:"ySuffix"` -} + ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` + SymbolColumns []string `json:"symbolColumns"` + TimeFormat *string `json:"timeFormat,omitempty"` + Type ScatterViewPropertiesType `json:"type"` + XAxisLabel string `json:"xAxisLabel"` + XColumn string `json:"xColumn"` + XDomain []float32 `json:"xDomain"` + XPrefix string `json:"xPrefix"` + XSuffix string `json:"xSuffix"` + YAxisLabel string `json:"yAxisLabel"` + YColumn string `json:"yColumn"` + YDomain []float32 `json:"yDomain"` + YPrefix string `json:"yPrefix"` + YSuffix string `json:"ySuffix"` +} + +// ScatterViewPropertiesShape defines model for ScatterViewProperties.Shape. +type ScatterViewPropertiesShape string + +// ScatterViewPropertiesType defines model for ScatterViewProperties.Type. +type ScatterViewPropertiesType string // ScraperTargetRequest defines model for ScraperTargetRequest. type ScraperTargetRequest struct { @@ -2108,12 +3190,15 @@ type ScraperTargetRequest struct { OrgID *string `json:"orgID,omitempty"` // The type of the metrics to be parsed. - Type *string `json:"type,omitempty"` + Type *ScraperTargetRequestType `json:"type,omitempty"` // The URL of the metrics endpoint. Url *string `json:"url,omitempty"` } +// ScraperTargetRequestType defines model for ScraperTargetRequest.Type. +type ScraperTargetRequestType string + // ScraperTargetResponse defines model for ScraperTargetResponse. type ScraperTargetResponse struct { // Embedded struct due to allOf(#/components/schemas/ScraperTargetRequest) @@ -2181,20 +3266,26 @@ type SingleStatViewProperties struct { DecimalPlaces DecimalPlaces `json:"decimalPlaces"` // Legend define encoding of data into a view's legend - Legend Legend `json:"legend"` - Note string `json:"note"` - Prefix string `json:"prefix"` - Queries []DashboardQuery `json:"queries"` - Shape string `json:"shape"` + Legend Legend `json:"legend"` + Note string `json:"note"` + Prefix string `json:"prefix"` + Queries []DashboardQuery `json:"queries"` + Shape SingleStatViewPropertiesShape `json:"shape"` // If true, will display note when empty - ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` - Suffix string `json:"suffix"` - TickPrefix string `json:"tickPrefix"` - TickSuffix string `json:"tickSuffix"` - Type string `json:"type"` + ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` + Suffix string `json:"suffix"` + TickPrefix string `json:"tickPrefix"` + TickSuffix string `json:"tickSuffix"` + Type SingleStatViewPropertiesType `json:"type"` } +// SingleStatViewPropertiesShape defines model for SingleStatViewProperties.Shape. +type SingleStatViewPropertiesShape string + +// SingleStatViewPropertiesType defines model for SingleStatViewProperties.Type. +type SingleStatViewPropertiesType string + // SlackNotificationEndpoint defines model for SlackNotificationEndpoint. type SlackNotificationEndpoint struct { // Embedded struct due to allOf(#/components/schemas/NotificationEndpointBase) @@ -2218,36 +3309,45 @@ type SlackNotificationRule struct { // SlackNotificationRuleBase defines model for SlackNotificationRuleBase. type SlackNotificationRuleBase struct { - Channel *string `json:"channel,omitempty"` - MessageTemplate string `json:"messageTemplate"` - Type string `json:"type"` + Channel *string `json:"channel,omitempty"` + MessageTemplate string `json:"messageTemplate"` + Type SlackNotificationRuleBaseType `json:"type"` } +// SlackNotificationRuleBaseType defines model for SlackNotificationRuleBase.Type. +type SlackNotificationRuleBaseType string + // Source defines model for Source. type Source struct { - Default *bool `json:"default,omitempty"` - DefaultRP *string `json:"defaultRP,omitempty"` - Id *string `json:"id,omitempty"` - InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"` - Languages *[]string `json:"languages,omitempty"` + Default *bool `json:"default,omitempty"` + DefaultRP *string `json:"defaultRP,omitempty"` + Id *string `json:"id,omitempty"` + InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"` + Languages *[]SourceLanguages `json:"languages,omitempty"` Links *struct { Buckets *string `json:"buckets,omitempty"` Health *string `json:"health,omitempty"` Query *string `json:"query,omitempty"` Self *string `json:"self,omitempty"` } `json:"links,omitempty"` - MetaUrl *string `json:"metaUrl,omitempty"` - Name *string `json:"name,omitempty"` - OrgID *string `json:"orgID,omitempty"` - Password *string `json:"password,omitempty"` - SharedSecret *string `json:"sharedSecret,omitempty"` - Telegraf *string `json:"telegraf,omitempty"` - Token *string `json:"token,omitempty"` - Type *string `json:"type,omitempty"` - Url *string `json:"url,omitempty"` - Username *string `json:"username,omitempty"` + MetaUrl *string `json:"metaUrl,omitempty"` + Name *string `json:"name,omitempty"` + OrgID *string `json:"orgID,omitempty"` + Password *string `json:"password,omitempty"` + SharedSecret *string `json:"sharedSecret,omitempty"` + Telegraf *string `json:"telegraf,omitempty"` + Token *string `json:"token,omitempty"` + Type *SourceType `json:"type,omitempty"` + Url *string `json:"url,omitempty"` + Username *string `json:"username,omitempty"` } +// SourceLanguages defines model for Source.Languages. +type SourceLanguages string + +// SourceType defines model for Source.Type. +type SourceType string + // Sources defines model for Sources. type Sources struct { Links *struct { @@ -2289,10 +3389,10 @@ type TableViewProperties struct { DecimalPlaces DecimalPlaces `json:"decimalPlaces"` // fieldOptions represent the fields retrieved by the query with customization options - FieldOptions []RenamableField `json:"fieldOptions"` - Note string `json:"note"` - Queries []DashboardQuery `json:"queries"` - Shape string `json:"shape"` + FieldOptions []RenamableField `json:"fieldOptions"` + Note string `json:"note"` + Queries []DashboardQuery `json:"queries"` + Shape TableViewPropertiesShape `json:"shape"` // If true, will display note when empty ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` @@ -2308,21 +3408,33 @@ type TableViewProperties struct { VerticalTimeAxis *bool `json:"verticalTimeAxis,omitempty"` // Wrapping describes the text wrapping style to be used in table views - Wrapping *string `json:"wrapping,omitempty"` + Wrapping *TableViewPropertiesTableOptionsWrapping `json:"wrapping,omitempty"` } `json:"tableOptions"` // timeFormat describes the display format for time values according to moment.js date formatting - TimeFormat string `json:"timeFormat"` - Type string `json:"type"` + TimeFormat string `json:"timeFormat"` + Type TableViewPropertiesType `json:"type"` } +// TableViewPropertiesShape defines model for TableViewProperties.Shape. +type TableViewPropertiesShape string + +// TableViewPropertiesTableOptionsWrapping defines model for TableViewProperties.TableOptions.Wrapping. +type TableViewPropertiesTableOptionsWrapping string + +// TableViewPropertiesType defines model for TableViewProperties.Type. +type TableViewPropertiesType string + // TagRule defines model for TagRule. type TagRule struct { - Key *string `json:"key,omitempty"` - Operator *string `json:"operator,omitempty"` - Value *string `json:"value,omitempty"` + Key *string `json:"key,omitempty"` + Operator *TagRuleOperator `json:"operator,omitempty"` + Value *string `json:"value,omitempty"` } +// TagRuleOperator defines model for TagRule.Operator. +type TagRuleOperator string + // Task defines model for Task. type Task struct { @@ -2340,11 +3452,11 @@ type Task struct { Every *string `json:"every,omitempty"` // The Flux script to run for this task. - Flux string `json:"flux"` - Id string `json:"id"` - Labels *Labels `json:"labels,omitempty"` - LastRunError *string `json:"lastRunError,omitempty"` - LastRunStatus *string `json:"lastRunStatus,omitempty"` + Flux string `json:"flux"` + Id string `json:"id"` + Labels *Labels `json:"labels,omitempty"` + LastRunError *string `json:"lastRunError,omitempty"` + LastRunStatus *TaskLastRunStatus `json:"lastRunStatus,omitempty"` // Timestamp of latest scheduled, completed run, RFC3339. LatestCompleted *time.Time `json:"latestCompleted,omitempty"` @@ -2387,6 +3499,9 @@ type Task struct { UpdatedAt *time.Time `json:"updatedAt,omitempty"` } +// TaskLastRunStatus defines model for Task.LastRunStatus. +type TaskLastRunStatus string + // TaskCreateRequest defines model for TaskCreateRequest. type TaskCreateRequest struct { @@ -2469,33 +3584,57 @@ type TelegrafPlugin struct { // TelegrafPluginInputCpu defines model for TelegrafPluginInputCpu. type TelegrafPluginInputCpu struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputCpuName `json:"name"` + Type TelegrafPluginInputCpuType `json:"type"` } +// TelegrafPluginInputCpuName defines model for TelegrafPluginInputCpu.Name. +type TelegrafPluginInputCpuName string + +// TelegrafPluginInputCpuType defines model for TelegrafPluginInputCpu.Type. +type TelegrafPluginInputCpuType string + // TelegrafPluginInputDisk defines model for TelegrafPluginInputDisk. type TelegrafPluginInputDisk struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputDiskName `json:"name"` + Type TelegrafPluginInputDiskType `json:"type"` } +// TelegrafPluginInputDiskName defines model for TelegrafPluginInputDisk.Name. +type TelegrafPluginInputDiskName string + +// TelegrafPluginInputDiskType defines model for TelegrafPluginInputDisk.Type. +type TelegrafPluginInputDiskType string + // TelegrafPluginInputDiskio defines model for TelegrafPluginInputDiskio. type TelegrafPluginInputDiskio struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputDiskioName `json:"name"` + Type TelegrafPluginInputDiskioType `json:"type"` } +// TelegrafPluginInputDiskioName defines model for TelegrafPluginInputDiskio.Name. +type TelegrafPluginInputDiskioName string + +// TelegrafPluginInputDiskioType defines model for TelegrafPluginInputDiskio.Type. +type TelegrafPluginInputDiskioType string + // TelegrafPluginInputDocker defines model for TelegrafPluginInputDocker. type TelegrafPluginInputDocker struct { Comment *string `json:"comment,omitempty"` Config TelegrafPluginInputDockerConfig `json:"config"` - Name string `json:"name"` - Type string `json:"type"` + Name TelegrafPluginInputDockerName `json:"name"` + Type TelegrafPluginInputDockerType `json:"type"` } +// TelegrafPluginInputDockerName defines model for TelegrafPluginInputDocker.Name. +type TelegrafPluginInputDockerName string + +// TelegrafPluginInputDockerType defines model for TelegrafPluginInputDocker.Type. +type TelegrafPluginInputDockerType string + // TelegrafPluginInputDockerConfig defines model for TelegrafPluginInputDockerConfig. type TelegrafPluginInputDockerConfig struct { Endpoint string `json:"endpoint"` @@ -2505,10 +3644,16 @@ type TelegrafPluginInputDockerConfig struct { type TelegrafPluginInputFile struct { Comment *string `json:"comment,omitempty"` Config TelegrafPluginInputFileConfig `json:"config"` - Name string `json:"name"` - Type string `json:"type"` + Name TelegrafPluginInputFileName `json:"name"` + Type TelegrafPluginInputFileType `json:"type"` } +// TelegrafPluginInputFileName defines model for TelegrafPluginInputFile.Name. +type TelegrafPluginInputFileName string + +// TelegrafPluginInputFileType defines model for TelegrafPluginInputFile.Type. +type TelegrafPluginInputFileType string + // TelegrafPluginInputFileConfig defines model for TelegrafPluginInputFileConfig. type TelegrafPluginInputFileConfig struct { Files *[]string `json:"files,omitempty"` @@ -2516,19 +3661,31 @@ type TelegrafPluginInputFileConfig struct { // TelegrafPluginInputKernel defines model for TelegrafPluginInputKernel. type TelegrafPluginInputKernel struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputKernelName `json:"name"` + Type TelegrafPluginInputKernelType `json:"type"` } +// TelegrafPluginInputKernelName defines model for TelegrafPluginInputKernel.Name. +type TelegrafPluginInputKernelName string + +// TelegrafPluginInputKernelType defines model for TelegrafPluginInputKernel.Type. +type TelegrafPluginInputKernelType string + // TelegrafPluginInputKubernetes defines model for TelegrafPluginInputKubernetes. type TelegrafPluginInputKubernetes struct { Comment *string `json:"comment,omitempty"` Config TelegrafPluginInputKubernetesConfig `json:"config"` - Name string `json:"name"` - Type string `json:"type"` + Name TelegrafPluginInputKubernetesName `json:"name"` + Type TelegrafPluginInputKubernetesType `json:"type"` } +// TelegrafPluginInputKubernetesName defines model for TelegrafPluginInputKubernetes.Name. +type TelegrafPluginInputKubernetesName string + +// TelegrafPluginInputKubernetesType defines model for TelegrafPluginInputKubernetes.Type. +type TelegrafPluginInputKubernetesType string + // TelegrafPluginInputKubernetesConfig defines model for TelegrafPluginInputKubernetesConfig. type TelegrafPluginInputKubernetesConfig struct { Url *string `json:"url,omitempty"` @@ -2538,10 +3695,16 @@ type TelegrafPluginInputKubernetesConfig struct { type TelegrafPluginInputLogParser struct { Comment *string `json:"comment,omitempty"` Config TelegrafPluginInputLogParserConfig `json:"config"` - Name string `json:"name"` - Type string `json:"type"` + Name TelegrafPluginInputLogParserName `json:"name"` + Type TelegrafPluginInputLogParserType `json:"type"` } +// TelegrafPluginInputLogParserName defines model for TelegrafPluginInputLogParser.Name. +type TelegrafPluginInputLogParserName string + +// TelegrafPluginInputLogParserType defines model for TelegrafPluginInputLogParser.Type. +type TelegrafPluginInputLogParserType string + // TelegrafPluginInputLogParserConfig defines model for TelegrafPluginInputLogParserConfig. type TelegrafPluginInputLogParserConfig struct { Files *[]string `json:"files,omitempty"` @@ -2549,47 +3712,83 @@ type TelegrafPluginInputLogParserConfig struct { // TelegrafPluginInputMem defines model for TelegrafPluginInputMem. type TelegrafPluginInputMem struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputMemName `json:"name"` + Type TelegrafPluginInputMemType `json:"type"` } +// TelegrafPluginInputMemName defines model for TelegrafPluginInputMem.Name. +type TelegrafPluginInputMemName string + +// TelegrafPluginInputMemType defines model for TelegrafPluginInputMem.Type. +type TelegrafPluginInputMemType string + // TelegrafPluginInputNet defines model for TelegrafPluginInputNet. type TelegrafPluginInputNet struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputNetName `json:"name"` + Type TelegrafPluginInputNetType `json:"type"` } +// TelegrafPluginInputNetName defines model for TelegrafPluginInputNet.Name. +type TelegrafPluginInputNetName string + +// TelegrafPluginInputNetType defines model for TelegrafPluginInputNet.Type. +type TelegrafPluginInputNetType string + // TelegrafPluginInputNetResponse defines model for TelegrafPluginInputNetResponse. type TelegrafPluginInputNetResponse struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputNetResponseName `json:"name"` + Type TelegrafPluginInputNetResponseType `json:"type"` } +// TelegrafPluginInputNetResponseName defines model for TelegrafPluginInputNetResponse.Name. +type TelegrafPluginInputNetResponseName string + +// TelegrafPluginInputNetResponseType defines model for TelegrafPluginInputNetResponse.Type. +type TelegrafPluginInputNetResponseType string + // TelegrafPluginInputNginx defines model for TelegrafPluginInputNginx. type TelegrafPluginInputNginx struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputNginxName `json:"name"` + Type TelegrafPluginInputNginxType `json:"type"` } +// TelegrafPluginInputNginxName defines model for TelegrafPluginInputNginx.Name. +type TelegrafPluginInputNginxName string + +// TelegrafPluginInputNginxType defines model for TelegrafPluginInputNginx.Type. +type TelegrafPluginInputNginxType string + // TelegrafPluginInputProcesses defines model for TelegrafPluginInputProcesses. type TelegrafPluginInputProcesses struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputProcessesName `json:"name"` + Type TelegrafPluginInputProcessesType `json:"type"` } +// TelegrafPluginInputProcessesName defines model for TelegrafPluginInputProcesses.Name. +type TelegrafPluginInputProcessesName string + +// TelegrafPluginInputProcessesType defines model for TelegrafPluginInputProcesses.Type. +type TelegrafPluginInputProcessesType string + // TelegrafPluginInputProcstat defines model for TelegrafPluginInputProcstat. type TelegrafPluginInputProcstat struct { Comment *string `json:"comment,omitempty"` Config TelegrafPluginInputProcstatConfig `json:"config"` - Name string `json:"name"` - Type string `json:"type"` + Name TelegrafPluginInputProcstatName `json:"name"` + Type TelegrafPluginInputProcstatType `json:"type"` } +// TelegrafPluginInputProcstatName defines model for TelegrafPluginInputProcstat.Name. +type TelegrafPluginInputProcstatName string + +// TelegrafPluginInputProcstatType defines model for TelegrafPluginInputProcstat.Type. +type TelegrafPluginInputProcstatType string + // TelegrafPluginInputProcstatConfig defines model for TelegrafPluginInputProcstatConfig. type TelegrafPluginInputProcstatConfig struct { Exe *string `json:"exe,omitempty"` @@ -2599,10 +3798,16 @@ type TelegrafPluginInputProcstatConfig struct { type TelegrafPluginInputPrometheus struct { Comment *string `json:"comment,omitempty"` Config TelegrafPluginInputPrometheusConfig `json:"config"` - Name string `json:"name"` - Type string `json:"type"` + Name TelegrafPluginInputPrometheusName `json:"name"` + Type TelegrafPluginInputPrometheusType `json:"type"` } +// TelegrafPluginInputPrometheusName defines model for TelegrafPluginInputPrometheus.Name. +type TelegrafPluginInputPrometheusName string + +// TelegrafPluginInputPrometheusType defines model for TelegrafPluginInputPrometheus.Type. +type TelegrafPluginInputPrometheusType string + // TelegrafPluginInputPrometheusConfig defines model for TelegrafPluginInputPrometheusConfig. type TelegrafPluginInputPrometheusConfig struct { Urls *[]string `json:"urls,omitempty"` @@ -2612,10 +3817,16 @@ type TelegrafPluginInputPrometheusConfig struct { type TelegrafPluginInputRedis struct { Comment *string `json:"comment,omitempty"` Config TelegrafPluginInputRedisConfig `json:"config"` - Name string `json:"name"` - Type string `json:"type"` + Name TelegrafPluginInputRedisName `json:"name"` + Type TelegrafPluginInputRedisType `json:"type"` } +// TelegrafPluginInputRedisName defines model for TelegrafPluginInputRedis.Name. +type TelegrafPluginInputRedisName string + +// TelegrafPluginInputRedisType defines model for TelegrafPluginInputRedis.Type. +type TelegrafPluginInputRedisType string + // TelegrafPluginInputRedisConfig defines model for TelegrafPluginInputRedisConfig. type TelegrafPluginInputRedisConfig struct { Password *string `json:"password,omitempty"` @@ -2624,19 +3835,31 @@ type TelegrafPluginInputRedisConfig struct { // TelegrafPluginInputSwap defines model for TelegrafPluginInputSwap. type TelegrafPluginInputSwap struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputSwapName `json:"name"` + Type TelegrafPluginInputSwapType `json:"type"` } +// TelegrafPluginInputSwapName defines model for TelegrafPluginInputSwap.Name. +type TelegrafPluginInputSwapName string + +// TelegrafPluginInputSwapType defines model for TelegrafPluginInputSwap.Type. +type TelegrafPluginInputSwapType string + // TelegrafPluginInputSyslog defines model for TelegrafPluginInputSyslog. type TelegrafPluginInputSyslog struct { Comment *string `json:"comment,omitempty"` Config TelegrafPluginInputSyslogConfig `json:"config"` - Name string `json:"name"` - Type string `json:"type"` + Name TelegrafPluginInputSyslogName `json:"name"` + Type TelegrafPluginInputSyslogType `json:"type"` } +// TelegrafPluginInputSyslogName defines model for TelegrafPluginInputSyslog.Name. +type TelegrafPluginInputSyslogName string + +// TelegrafPluginInputSyslogType defines model for TelegrafPluginInputSyslog.Type. +type TelegrafPluginInputSyslogType string + // TelegrafPluginInputSyslogConfig defines model for TelegrafPluginInputSyslogConfig. type TelegrafPluginInputSyslogConfig struct { Server *string `json:"server,omitempty"` @@ -2644,42 +3867,69 @@ type TelegrafPluginInputSyslogConfig struct { // TelegrafPluginInputSystem defines model for TelegrafPluginInputSystem. type TelegrafPluginInputSystem struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputSystemName `json:"name"` + Type TelegrafPluginInputSystemType `json:"type"` } +// TelegrafPluginInputSystemName defines model for TelegrafPluginInputSystem.Name. +type TelegrafPluginInputSystemName string + +// TelegrafPluginInputSystemType defines model for TelegrafPluginInputSystem.Type. +type TelegrafPluginInputSystemType string + // TelegrafPluginInputTail defines model for TelegrafPluginInputTail. type TelegrafPluginInputTail struct { - Comment *string `json:"comment,omitempty"` - Name string `json:"name"` - Type string `json:"type"` + Comment *string `json:"comment,omitempty"` + Name TelegrafPluginInputTailName `json:"name"` + Type TelegrafPluginInputTailType `json:"type"` } +// TelegrafPluginInputTailName defines model for TelegrafPluginInputTail.Name. +type TelegrafPluginInputTailName string + +// TelegrafPluginInputTailType defines model for TelegrafPluginInputTail.Type. +type TelegrafPluginInputTailType string + // TelegrafPluginOutputFile defines model for TelegrafPluginOutputFile. type TelegrafPluginOutputFile struct { Comment *string `json:"comment,omitempty"` Config TelegrafPluginOutputFileConfig `json:"config"` - Name string `json:"name"` - Type string `json:"type"` + Name TelegrafPluginOutputFileName `json:"name"` + Type TelegrafPluginOutputFileType `json:"type"` } +// TelegrafPluginOutputFileName defines model for TelegrafPluginOutputFile.Name. +type TelegrafPluginOutputFileName string + +// TelegrafPluginOutputFileType defines model for TelegrafPluginOutputFile.Type. +type TelegrafPluginOutputFileType string + // TelegrafPluginOutputFileConfig defines model for TelegrafPluginOutputFileConfig. type TelegrafPluginOutputFileConfig struct { Files []struct { - Path *string `json:"path,omitempty"` - Type *string `json:"type,omitempty"` + Path *string `json:"path,omitempty"` + Type *TelegrafPluginOutputFileConfigFilesType `json:"type,omitempty"` } `json:"files"` } +// TelegrafPluginOutputFileConfigFilesType defines model for TelegrafPluginOutputFileConfig.Files.Type. +type TelegrafPluginOutputFileConfigFilesType string + // TelegrafPluginOutputInfluxDBV2 defines model for TelegrafPluginOutputInfluxDBV2. type TelegrafPluginOutputInfluxDBV2 struct { Comment *string `json:"comment,omitempty"` Config TelegrafPluginOutputInfluxDBV2Config `json:"config"` - Name string `json:"name"` - Type string `json:"type"` + Name TelegrafPluginOutputInfluxDBV2Name `json:"name"` + Type TelegrafPluginOutputInfluxDBV2Type `json:"type"` } +// TelegrafPluginOutputInfluxDBV2Name defines model for TelegrafPluginOutputInfluxDBV2.Name. +type TelegrafPluginOutputInfluxDBV2Name string + +// TelegrafPluginOutputInfluxDBV2Type defines model for TelegrafPluginOutputInfluxDBV2.Type. +type TelegrafPluginOutputInfluxDBV2Type string + // TelegrafPluginOutputInfluxDBV2Config defines model for TelegrafPluginOutputInfluxDBV2Config. type TelegrafPluginOutputInfluxDBV2Config struct { Bucket string `json:"bucket"` @@ -2757,10 +4007,13 @@ type ThresholdCheck struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` } `json:"tags,omitempty"` - Thresholds *[]Threshold `json:"thresholds,omitempty"` - Type string `json:"type"` + Thresholds *[]Threshold `json:"thresholds,omitempty"` + Type ThresholdCheckType `json:"type"` } +// ThresholdCheckType defines model for ThresholdCheck.Type. +type ThresholdCheckType string + // UnaryExpression defines model for UnaryExpression. type UnaryExpression struct { Argument *Expression `json:"argument,omitempty"` @@ -2789,9 +4042,12 @@ type User struct { OauthID *string `json:"oauthID,omitempty"` // If inactive the user is inactive. - Status *string `json:"status,omitempty"` + Status *UserStatus `json:"status,omitempty"` } +// UserStatus defines model for User.Status. +type UserStatus string + // Users defines model for Users. type Users struct { Links *struct { @@ -2875,21 +4131,30 @@ type XYViewProperties struct { Geom XYGeom `json:"geom"` // Legend define encoding of data into a view's legend - Legend Legend `json:"legend"` - Note string `json:"note"` - Position string `json:"position"` - Queries []DashboardQuery `json:"queries"` - ShadeBelow *bool `json:"shadeBelow,omitempty"` - Shape string `json:"shape"` + Legend Legend `json:"legend"` + Note string `json:"note"` + Position XYViewPropertiesPosition `json:"position"` + Queries []DashboardQuery `json:"queries"` + ShadeBelow *bool `json:"shadeBelow,omitempty"` + Shape XYViewPropertiesShape `json:"shape"` // If true, will display note when empty - ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` - TimeFormat *string `json:"timeFormat,omitempty"` - Type string `json:"type"` - XColumn *string `json:"xColumn,omitempty"` - YColumn *string `json:"yColumn,omitempty"` + ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` + TimeFormat *string `json:"timeFormat,omitempty"` + Type XYViewPropertiesType `json:"type"` + XColumn *string `json:"xColumn,omitempty"` + YColumn *string `json:"yColumn,omitempty"` } +// XYViewPropertiesPosition defines model for XYViewProperties.Position. +type XYViewPropertiesPosition string + +// XYViewPropertiesShape defines model for XYViewProperties.Shape. +type XYViewPropertiesShape string + +// XYViewPropertiesType defines model for XYViewProperties.Type. +type XYViewPropertiesType string + // Descending defines model for Descending. type Descending bool @@ -3185,7 +4450,7 @@ type GetDashboardsParams struct { Owner *string `json:"owner,omitempty"` // The column to sort by. - SortBy *string `json:"sortBy,omitempty"` + SortBy *GetDashboardsParamsSortBy `json:"sortBy,omitempty"` // List of dashboard IDs to return. If both `id and `owner` are specified, only `id` is used. Id *[]string `json:"id,omitempty"` @@ -3200,6 +4465,9 @@ type GetDashboardsParams struct { ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` } +// GetDashboardsParamsSortBy defines parameters for GetDashboards. +type GetDashboardsParamsSortBy string + // PostDashboardsJSONBody defines parameters for PostDashboards. type PostDashboardsJSONBody CreateDashboardRequest @@ -3221,12 +4489,15 @@ type DeleteDashboardsIDParams struct { type GetDashboardsIDParams struct { // Includes the cell view properties in the response if set to `properties` - Include *string `json:"include,omitempty"` + Include *GetDashboardsIDParamsInclude `json:"include,omitempty"` // OpenTracing span context ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` } +// GetDashboardsIDParamsInclude defines parameters for GetDashboardsID. +type GetDashboardsIDParamsInclude string + // PatchDashboardsIDJSONBody defines parameters for PatchDashboardsID. type PatchDashboardsIDJSONBody Dashboard @@ -3862,10 +5133,16 @@ type PostQueryParams struct { ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` // The Accept-Encoding request HTTP header advertises which content encoding, usually a compression algorithm, the client is able to understand. - AcceptEncoding *string `json:"Accept-Encoding,omitempty"` - ContentType *string `json:"Content-Type,omitempty"` + AcceptEncoding *PostQueryParamsAcceptEncoding `json:"Accept-Encoding,omitempty"` + ContentType *PostQueryParamsContentType `json:"Content-Type,omitempty"` } +// PostQueryParamsAcceptEncoding defines parameters for PostQuery. +type PostQueryParamsAcceptEncoding string + +// PostQueryParamsContentType defines parameters for PostQuery. +type PostQueryParamsContentType string + // PostQueryAnalyzeJSONBody defines parameters for PostQueryAnalyze. type PostQueryAnalyzeJSONBody Query @@ -3873,10 +5150,13 @@ type PostQueryAnalyzeJSONBody Query type PostQueryAnalyzeParams struct { // OpenTracing span context - ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` - ContentType *string `json:"Content-Type,omitempty"` + ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` + ContentType *PostQueryAnalyzeParamsContentType `json:"Content-Type,omitempty"` } +// PostQueryAnalyzeParamsContentType defines parameters for PostQueryAnalyze. +type PostQueryAnalyzeParamsContentType string + // PostQueryAstJSONBody defines parameters for PostQueryAst. type PostQueryAstJSONBody LanguageRequest @@ -3884,10 +5164,13 @@ type PostQueryAstJSONBody LanguageRequest type PostQueryAstParams struct { // OpenTracing span context - ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` - ContentType *string `json:"Content-Type,omitempty"` + ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` + ContentType *PostQueryAstParamsContentType `json:"Content-Type,omitempty"` } +// PostQueryAstParamsContentType defines parameters for PostQueryAst. +type PostQueryAstParamsContentType string + // GetQuerySuggestionsParams defines parameters for GetQuerySuggestions. type GetQuerySuggestionsParams struct { @@ -4155,7 +5438,7 @@ type GetTasksParams struct { OrgID *string `json:"orgID,omitempty"` // Filter tasks by a status--"inactive" or "active". - Status *string `json:"status,omitempty"` + Status *GetTasksParamsStatus `json:"status,omitempty"` // The number of tasks to return Limit *int `json:"limit,omitempty"` @@ -4164,6 +5447,9 @@ type GetTasksParams struct { ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` } +// GetTasksParamsStatus defines parameters for GetTasks. +type GetTasksParamsStatus string + // PostTasksJSONBody defines parameters for PostTasks. type PostTasksJSONBody TaskCreateRequest @@ -4375,10 +5661,13 @@ type DeleteTelegrafsIDParams struct { type GetTelegrafsIDParams struct { // OpenTracing span context - ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` - Accept *string `json:"Accept,omitempty"` + ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` + Accept *GetTelegrafsIDParamsAccept `json:"Accept,omitempty"` } +// GetTelegrafsIDParamsAccept defines parameters for GetTelegrafsID. +type GetTelegrafsIDParamsAccept string + // PutTelegrafsIDJSONBody defines parameters for PutTelegrafsID. type PutTelegrafsIDJSONBody TelegrafRequest @@ -4621,18 +5910,27 @@ type PostWriteParams struct { ZapTraceSpan *TraceSpan `json:"Zap-Trace-Span,omitempty"` // When present, its value indicates to the database that compression is applied to the line-protocol body. - ContentEncoding *string `json:"Content-Encoding,omitempty"` + ContentEncoding *PostWriteParamsContentEncoding `json:"Content-Encoding,omitempty"` // Content-Type is used to indicate the format of the data sent to the server. - ContentType *string `json:"Content-Type,omitempty"` + ContentType *PostWriteParamsContentType `json:"Content-Type,omitempty"` // Content-Length is an entity header is indicating the size of the entity-body, in bytes, sent to the database. If the length is greater than the database max body configuration option, a 413 response is sent. ContentLength *int `json:"Content-Length,omitempty"` // Specifies the return content format. - Accept *string `json:"Accept,omitempty"` + Accept *PostWriteParamsAccept `json:"Accept,omitempty"` } +// PostWriteParamsContentEncoding defines parameters for PostWrite. +type PostWriteParamsContentEncoding string + +// PostWriteParamsContentType defines parameters for PostWrite. +type PostWriteParamsContentType string + +// PostWriteParamsAccept defines parameters for PostWrite. +type PostWriteParamsAccept string + // PostAuthorizationsRequestBody defines body for PostAuthorizations for application/json ContentType. type PostAuthorizationsJSONRequestBody PostAuthorizationsJSONBody diff --git a/go.mod b/go.mod index 7dd75f21..b7ffa94c 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/influxdata/influxdb-client-go go 1.13 require ( + github.com/deepmap/oapi-codegen v1.3.6 github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.4.0 // test dependency diff --git a/go.sum b/go.sum index d2c96144..2e192280 100644 --- a/go.sum +++ b/go.sum @@ -1,15 +1,71 @@ +github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deepmap/oapi-codegen v1.3.6 h1:Wj44p9A0V0PJ+AUg0BWdyGcsS1LY18U+0rCuPQgK0+o= +github.com/deepmap/oapi-codegen v1.3.6/go.mod h1:aBozjEveG+33xPiP55Iw/XbVkhtZHEGLq3nxlX0+hfU= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/getkin/kin-openapi v0.2.0/go.mod h1:V1z9xl9oF5Wt7v32ne4FmiF1alpS4dM6mNzoywPOXlk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= +github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/labstack/echo/v4 v4.1.11 h1:z0BZoArY4FqdpUEl+wlHp4hnr/oSR6MTmQmv8OHSoww= +github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= +github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0= +github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= +github.com/valyala/fasttemplate v1.1.0 h1:RZqt0yGBsps8NGvLSGW804QQqCUYYLsaOjTVHy1Ocw4= +github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4= +golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191112182307-2180aed22343 h1:00ohfJ4K98s3m6BGUoBd8nyfp4Yl0GoIKvw5abItTjI= +golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 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/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From e487019c762ac2f6c08f763f00c4f142f19e7b49 Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Thu, 16 Apr 2020 18:14:38 +0200 Subject: [PATCH 05/11] feat: added initial version of AuthorizationApi --- api/authorizations.go | 67 +++++++++++++++++++++++++++++++++++++++++++ client.go | 7 +++++ client_e2e_test.go | 46 +++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 api/authorizations.go diff --git a/api/authorizations.go b/api/authorizations.go new file mode 100644 index 00000000..2a74c60a --- /dev/null +++ b/api/authorizations.go @@ -0,0 +1,67 @@ +package api + +import ( + "context" + "github.com/influxdata/influxdb-client-go/domain" + ihttp "github.com/influxdata/influxdb-client-go/internal/http" +) + +type AuthorizationsApi interface { + ListAuthorizations(ctx context.Context, query *domain.GetAuthorizationsParams) (*domain.Authorizations, error) + CreateAuthorization(ctx context.Context, authorization *domain.Authorization) (*domain.Authorization, error) +} + +type authorizationsApiImpl struct { + apiClient *domain.ClientWithResponses + service ihttp.Service +} + +func NewAuthorizationApi(service ihttp.Service) AuthorizationsApi { + + apiClient := domain.NewClientWithResponses(service) + return &authorizationsApiImpl{ + apiClient: apiClient, + service: service, + } +} + +func (a *authorizationsApiImpl) ListAuthorizations(ctx context.Context, query *domain.GetAuthorizationsParams) (*domain.Authorizations, error) { + if query == nil { + query = &domain.GetAuthorizationsParams{} + } + response, err := a.apiClient.GetAuthorizationsWithResponse(ctx, query) + if err != nil { + return nil, err + } + if response.JSONDefault != nil { + return nil, &ihttp.Error{ + StatusCode: response.HTTPResponse.StatusCode, + Code: string(response.JSONDefault.Code), + Message: response.JSONDefault.Message, + } + } + return response.JSON200, nil +} + +func (a *authorizationsApiImpl) CreateAuthorization(ctx context.Context, authorization *domain.Authorization) (*domain.Authorization, error) { + params := &domain.PostAuthorizationsParams{} + response, err := a.apiClient.PostAuthorizationsWithResponse(ctx, params, domain.PostAuthorizationsJSONRequestBody(*authorization)) + if err != nil { + return nil, err + } + if response.JSONDefault != nil { + return nil, &ihttp.Error{ + StatusCode: response.HTTPResponse.StatusCode, + Code: string(response.JSONDefault.Code), + Message: response.JSONDefault.Message, + } + } + if response.JSON400 != nil { + return nil, &ihttp.Error{ + StatusCode: response.HTTPResponse.StatusCode, + Code: string(response.JSON400.Code), + Message: response.JSON400.Message, + } + } + return response.JSON201, nil +} diff --git a/client.go b/client.go index ee8ebfa3..46e8677c 100644 --- a/client.go +++ b/client.go @@ -8,6 +8,7 @@ package influxdb2 import ( "context" + "github.com/influxdata/influxdb-client-go/api" "io" "io/ioutil" "net/http" @@ -30,6 +31,8 @@ type InfluxDBClient interface { WriteApiBlocking(org, bucket string) WriteApiBlocking // QueryApi returns Query client QueryApi(org string) QueryApi + // AuthorizationsApi returns Authorizations client + AuthorizationsApi() api.AuthorizationsApi // Close ensures all ongoing asynchronous write clients finish Close() // Options returns the options associated with client @@ -121,3 +124,7 @@ func (c *client) Close() { func (c *client) QueryApi(org string) QueryApi { return newQueryApi(org, c.httpService, c) } + +func (c *client) AuthorizationsApi() api.AuthorizationsApi { + return api.NewAuthorizationApi(c.httpService) +} diff --git a/client_e2e_test.go b/client_e2e_test.go index eb86925d..44da4768 100644 --- a/client_e2e_test.go +++ b/client_e2e_test.go @@ -8,6 +8,7 @@ import ( "context" "flag" "fmt" + "github.com/influxdata/influxdb-client-go/domain" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "strconv" @@ -62,6 +63,14 @@ func TestWrite(t *testing.T) { } client := NewClientWithOptions("http://localhost:9999", authToken, DefaultOptions().SetLogLevel(3)) writeApi := client.WriteApi("my-org", "my-bucket") + errCh := writeApi.Errors() + errorsCount := 0 + go func() { + for err := range errCh { + errorsCount++ + fmt.Println("Write error: ", err.Error()) + } + }() for i, f := 0, 3.3; i < 10; i++ { writeApi.WriteRecord(fmt.Sprintf("test,a=%d,b=local f=%.2f,i=%di", i%2, f, i)) //writeApi.Flush() @@ -78,6 +87,7 @@ func TestWrite(t *testing.T) { } client.Close() + assert.Equal(t, 0, errorsCount) } @@ -120,3 +130,39 @@ func TestQuery(t *testing.T) { } } } + +func TestAuthorizationsApi(t *testing.T) { + client := NewClient("http://localhost:9999", "FPPmaTW6dH7P0SXH81N6R9s0HiqJli-0YcPHm9vZpum-O7J-HeRubSSerMtlo3sez4Sekm04BjBCBu7-nPF_7Q==") + authApi := client.AuthorizationsApi() + listRes, err := authApi.ListAuthorizations(context.Background(), nil) + require.Nil(t, err) + require.NotNil(t, listRes) + require.NotNil(t, listRes.Authorizations) + assert.Len(t, *listRes.Authorizations, 1) + + orgName := "my-org" + orgId := "186d9f15433160b4" + permission := &domain.Permission{ + Action: domain.PermissionActionWrite, + Resource: domain.Resource{ + Org: &orgName, + Type: domain.ResourceTypeBuckets, + }, + } + permissions := []domain.Permission{*permission} + auth := &domain.Authorization{ + Org: &orgName, + OrgID: &orgId, + Permissions: &permissions, + } + auth, err = authApi.CreateAuthorization(context.Background(), auth) + require.Nil(t, err) + require.NotNil(t, auth) + + listRes, err = authApi.ListAuthorizations(context.Background(), nil) + require.Nil(t, err) + require.NotNil(t, listRes) + require.NotNil(t, listRes.Authorizations) + assert.Len(t, *listRes.Authorizations, 2) + +} From 0901bb45559abe073af115108fc84d127ac6d06f Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Wed, 22 Apr 2020 16:10:31 +0200 Subject: [PATCH 06/11] feat: added OrganizationApi with just FindOrgannizationByName --- api/organizations.go | 36 ++++++++++++++++++++++++++++++++++++ client.go | 8 +++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 api/organizations.go diff --git a/api/organizations.go b/api/organizations.go new file mode 100644 index 00000000..24edcb04 --- /dev/null +++ b/api/organizations.go @@ -0,0 +1,36 @@ +package api + +import ( + "context" + "github.com/influxdata/influxdb-client-go/domain" + ihttp "github.com/influxdata/influxdb-client-go/internal/http" +) + +type OrganizationsApi interface { + // FindOrganizationByName returns organization found using orgNme + FindOrganizationByName(ctx context.Context, orgName string) (*domain.Organization, error) +} + +type organizationsApiImpl struct { + apiClient *domain.ClientWithResponses +} + +func NewOrganizationsApi(service ihttp.Service) OrganizationsApi { + + apiClient := domain.NewClientWithResponses(service) + return &organizationsApiImpl{ + apiClient: apiClient, + } +} + +func (o *organizationsApiImpl) FindOrganizationByName(ctx context.Context, orgName string) (*domain.Organization, error) { + params := &domain.GetOrgsParams{Org: &orgName} + response, err := o.apiClient.GetOrgsWithResponse(ctx, params) + if err != nil { + return nil, err + } + if response.JSONDefault != nil { + return nil, domain.DomainErrorToError(response.JSONDefault, response.StatusCode()) + } + return &(*response.JSON200.Orgs)[0], nil +} diff --git a/client.go b/client.go index 46e8677c..66580da1 100644 --- a/client.go +++ b/client.go @@ -31,8 +31,10 @@ type InfluxDBClient interface { WriteApiBlocking(org, bucket string) WriteApiBlocking // QueryApi returns Query client QueryApi(org string) QueryApi - // AuthorizationsApi returns Authorizations client + // AuthorizationsApi returns Authorizations API client AuthorizationsApi() api.AuthorizationsApi + // OrganizationsApi returns Organizations API client + OrganizationsApi() api.OrganizationsApi // Close ensures all ongoing asynchronous write clients finish Close() // Options returns the options associated with client @@ -128,3 +130,7 @@ func (c *client) QueryApi(org string) QueryApi { func (c *client) AuthorizationsApi() api.AuthorizationsApi { return api.NewAuthorizationApi(c.httpService) } + +func (c *client) OrganizationsApi() api.OrganizationsApi { + return api.NewOrganizationsApi(c.httpService) +} From 27df6504766121d6204d1b89bf5aa52fdb27ee00 Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Wed, 22 Apr 2020 16:11:52 +0200 Subject: [PATCH 07/11] feat: Finished authorizations API --- api/authorizations.go | 121 +++++++++++++++++++++++++++++++++++------- client_e2e_test.go | 69 ++++++++++++++++++------ domain/utils.go | 11 ++++ 3 files changed, 167 insertions(+), 34 deletions(-) create mode 100644 domain/utils.go diff --git a/api/authorizations.go b/api/authorizations.go index 2a74c60a..e0cb2ccd 100644 --- a/api/authorizations.go +++ b/api/authorizations.go @@ -6,14 +6,30 @@ import ( ihttp "github.com/influxdata/influxdb-client-go/internal/http" ) +// AuthorizationsApi provides methods for organizing Authorization in a InfluxDB server type AuthorizationsApi interface { - ListAuthorizations(ctx context.Context, query *domain.GetAuthorizationsParams) (*domain.Authorizations, error) + // FindAuthorizations returns all authorizations + FindAuthorizations(ctx context.Context) (*[]domain.Authorization, error) + // FindAuthorizationsByUserName returns all authorizations for given userName + FindAuthorizationsByUserName(ctx context.Context, userName string) (*[]domain.Authorization, error) + // FindAuthorizationsByUserID returns all authorizations for given userID + FindAuthorizationsByUserID(ctx context.Context, userID string) (*[]domain.Authorization, error) + // FindAuthorizationsByOrgName returns all authorizations for given organization name + FindAuthorizationsByOrgName(ctx context.Context, orgName string) (*[]domain.Authorization, error) + // FindAuthorizationsByUserID returns all authorizations for given organization id + FindAuthorizationsByOrgID(ctx context.Context, orgID string) (*[]domain.Authorization, error) + // CreateAuthorization creates new authorization CreateAuthorization(ctx context.Context, authorization *domain.Authorization) (*domain.Authorization, error) + // CreateAuthorizationWithOrgID creates new authorization with given permissions scoped to given orgId + CreateAuthorizationWithOrgID(ctx context.Context, orgId string, permissions []domain.Permission) (*domain.Authorization, error) + // UpdateAuthorizationStatus updates status of authorization with authId + UpdateAuthorizationStatus(ctx context.Context, authId string, status domain.AuthorizationUpdateRequestStatus) (*domain.Authorization, error) + // DeleteAuthorization deletes authorization with authId + DeleteAuthorization(ctx context.Context, authId string) error } type authorizationsApiImpl struct { apiClient *domain.ClientWithResponses - service ihttp.Service } func NewAuthorizationApi(service ihttp.Service) AuthorizationsApi { @@ -21,11 +37,55 @@ func NewAuthorizationApi(service ihttp.Service) AuthorizationsApi { apiClient := domain.NewClientWithResponses(service) return &authorizationsApiImpl{ apiClient: apiClient, - service: service, } } -func (a *authorizationsApiImpl) ListAuthorizations(ctx context.Context, query *domain.GetAuthorizationsParams) (*domain.Authorizations, error) { +func (a *authorizationsApiImpl) FindAuthorizations(ctx context.Context) (*[]domain.Authorization, error) { + authQuery := &domain.GetAuthorizationsParams{} + auths, err := a.listAuthorizations(ctx, authQuery) + if err != nil { + return nil, err + } + return auths.Authorizations, nil +} + +func (a *authorizationsApiImpl) FindAuthorizationsByUserName(ctx context.Context, userName string) (*[]domain.Authorization, error) { + authQuery := &domain.GetAuthorizationsParams{User: &userName} + auths, err := a.listAuthorizations(ctx, authQuery) + if err != nil { + return nil, err + } + return auths.Authorizations, nil +} + +func (a *authorizationsApiImpl) FindAuthorizationsByUserID(ctx context.Context, userID string) (*[]domain.Authorization, error) { + authQuery := &domain.GetAuthorizationsParams{UserID: &userID} + auths, err := a.listAuthorizations(ctx, authQuery) + if err != nil { + return nil, err + } + return auths.Authorizations, nil +} + +func (a *authorizationsApiImpl) FindAuthorizationsByOrgName(ctx context.Context, orgName string) (*[]domain.Authorization, error) { + authQuery := &domain.GetAuthorizationsParams{Org: &orgName} + auths, err := a.listAuthorizations(ctx, authQuery) + if err != nil { + return nil, err + } + return auths.Authorizations, nil +} + +func (a *authorizationsApiImpl) FindAuthorizationsByOrgID(ctx context.Context, orgID string) (*[]domain.Authorization, error) { + authQuery := &domain.GetAuthorizationsParams{OrgID: &orgID} + auths, err := a.listAuthorizations(ctx, authQuery) + if err != nil { + return nil, err + } + return auths.Authorizations, nil +} + +func (a *authorizationsApiImpl) listAuthorizations(ctx context.Context, query *domain.GetAuthorizationsParams) (*domain.Authorizations, error) { if query == nil { query = &domain.GetAuthorizationsParams{} } @@ -34,11 +94,7 @@ func (a *authorizationsApiImpl) ListAuthorizations(ctx context.Context, query *d return nil, err } if response.JSONDefault != nil { - return nil, &ihttp.Error{ - StatusCode: response.HTTPResponse.StatusCode, - Code: string(response.JSONDefault.Code), - Message: response.JSONDefault.Message, - } + return nil, domain.DomainErrorToError(response.JSONDefault, response.StatusCode()) } return response.JSON200, nil } @@ -50,18 +106,45 @@ func (a *authorizationsApiImpl) CreateAuthorization(ctx context.Context, authori return nil, err } if response.JSONDefault != nil { - return nil, &ihttp.Error{ - StatusCode: response.HTTPResponse.StatusCode, - Code: string(response.JSONDefault.Code), - Message: response.JSONDefault.Message, - } + return nil, domain.DomainErrorToError(response.JSONDefault, response.StatusCode()) } if response.JSON400 != nil { - return nil, &ihttp.Error{ - StatusCode: response.HTTPResponse.StatusCode, - Code: string(response.JSON400.Code), - Message: response.JSON400.Message, - } + return nil, domain.DomainErrorToError(response.JSON400, response.StatusCode()) } return response.JSON201, nil } + +func (a *authorizationsApiImpl) CreateAuthorizationWithOrgID(ctx context.Context, orgId string, permissions []domain.Permission) (*domain.Authorization, error) { + status := domain.AuthorizationUpdateRequestStatusActive + auth := &domain.Authorization{ + AuthorizationUpdateRequest: domain.AuthorizationUpdateRequest{Status: &status}, + OrgID: &orgId, + Permissions: &permissions, + } + return a.CreateAuthorization(ctx, auth) +} + +func (a *authorizationsApiImpl) UpdateAuthorizationStatus(ctx context.Context, authId string, status domain.AuthorizationUpdateRequestStatus) (*domain.Authorization, error) { + params := &domain.PatchAuthorizationsIDParams{} + body := &domain.PatchAuthorizationsIDJSONRequestBody{Status: &status} + response, err := a.apiClient.PatchAuthorizationsIDWithResponse(ctx, authId, params, *body) + if err != nil { + return nil, err + } + if response.JSONDefault != nil { + return nil, domain.DomainErrorToError(response.JSONDefault, response.StatusCode()) + } + return response.JSON200, nil +} + +func (a *authorizationsApiImpl) DeleteAuthorization(ctx context.Context, authId string) error { + params := &domain.DeleteAuthorizationsIDParams{} + response, err := a.apiClient.DeleteAuthorizationsIDWithResponse(ctx, authId, params) + if err != nil { + return err + } + if response.JSONDefault != nil { + return domain.DomainErrorToError(response.JSONDefault, response.StatusCode()) + } + return nil +} diff --git a/client_e2e_test.go b/client_e2e_test.go index 44da4768..36e3cced 100644 --- a/client_e2e_test.go +++ b/client_e2e_test.go @@ -132,37 +132,76 @@ func TestQuery(t *testing.T) { } func TestAuthorizationsApi(t *testing.T) { - client := NewClient("http://localhost:9999", "FPPmaTW6dH7P0SXH81N6R9s0HiqJli-0YcPHm9vZpum-O7J-HeRubSSerMtlo3sez4Sekm04BjBCBu7-nPF_7Q==") + if !e2e { + t.Skip("e2e not enabled. Launch InfluxDB 2 on localhost and run test with -e2e") + } + client := NewClient("http://localhost:9999", authToken) authApi := client.AuthorizationsApi() - listRes, err := authApi.ListAuthorizations(context.Background(), nil) + listRes, err := authApi.FindAuthorizations(context.Background()) require.Nil(t, err) require.NotNil(t, listRes) - require.NotNil(t, listRes.Authorizations) - assert.Len(t, *listRes.Authorizations, 1) + assert.Len(t, *listRes, 1) orgName := "my-org" - orgId := "186d9f15433160b4" + org, err := client.OrganizationsApi().FindOrganizationByName(context.Background(), orgName) + require.Nil(t, err) + require.NotNil(t, org) + assert.Equal(t, orgName, org.Name) + permission := &domain.Permission{ Action: domain.PermissionActionWrite, Resource: domain.Resource{ - Org: &orgName, Type: domain.ResourceTypeBuckets, }, } permissions := []domain.Permission{*permission} - auth := &domain.Authorization{ - Org: &orgName, - OrgID: &orgId, - Permissions: &permissions, - } - auth, err = authApi.CreateAuthorization(context.Background(), auth) + + auth, err := authApi.CreateAuthorizationWithOrgID(context.Background(), *org.Id, permissions) + require.Nil(t, err) + require.NotNil(t, auth) + assert.Equal(t, domain.AuthorizationUpdateRequestStatusActive, *auth.Status, *auth.Status) + + listRes, err = authApi.FindAuthorizations(context.Background()) + require.Nil(t, err) + require.NotNil(t, listRes) + assert.Len(t, *listRes, 2) + + listRes, err = authApi.FindAuthorizationsByUserName(context.Background(), "my-user") + require.Nil(t, err) + require.NotNil(t, listRes) + assert.Len(t, *listRes, 2) + + listRes, err = authApi.FindAuthorizationsByOrgID(context.Background(), *org.Id) + require.Nil(t, err) + require.NotNil(t, listRes) + assert.Len(t, *listRes, 2) + + listRes, err = authApi.FindAuthorizationsByOrgName(context.Background(), "my-org") + require.Nil(t, err) + require.NotNil(t, listRes) + assert.Len(t, *listRes, 2) + + listRes, err = authApi.FindAuthorizationsByOrgName(context.Background(), "not-existent-org") + require.Nil(t, listRes) + require.NotNil(t, err) + //assert.Len(t, *listRes, 0) + + auth, err = authApi.UpdateAuthorizationStatus(context.Background(), *auth.Id, domain.AuthorizationUpdateRequestStatusInactive) require.Nil(t, err) require.NotNil(t, auth) + assert.Equal(t, domain.AuthorizationUpdateRequestStatusInactive, *auth.Status, *auth.Status) + + listRes, err = authApi.FindAuthorizations(context.Background()) + require.Nil(t, err) + require.NotNil(t, listRes) + assert.Len(t, *listRes, 2) + + err = authApi.DeleteAuthorization(context.Background(), *auth.Id) + require.Nil(t, err) - listRes, err = authApi.ListAuthorizations(context.Background(), nil) + listRes, err = authApi.FindAuthorizations(context.Background()) require.Nil(t, err) require.NotNil(t, listRes) - require.NotNil(t, listRes.Authorizations) - assert.Len(t, *listRes.Authorizations, 2) + assert.Len(t, *listRes, 1) } diff --git a/domain/utils.go b/domain/utils.go new file mode 100644 index 00000000..589a912e --- /dev/null +++ b/domain/utils.go @@ -0,0 +1,11 @@ +package domain + +import ihttp "github.com/influxdata/influxdb-client-go/internal/http" + +func DomainErrorToError(error *Error, statusCode int) *ihttp.Error { + return &ihttp.Error{ + StatusCode: statusCode, + Code: string(error.Code), + Message: error.Message, + } +} From 023b0732b4e52c0ad1c6c42d05752ee84b557c63 Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Wed, 22 Apr 2020 16:12:16 +0200 Subject: [PATCH 08/11] fix: relative parse instead of join --- writeService.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/writeService.go b/writeService.go index cb0e37c9..93303808 100644 --- a/writeService.go +++ b/writeService.go @@ -11,7 +11,6 @@ import ( "io" "net/http" "net/url" - "path" "strings" "sync" "time" @@ -166,8 +165,10 @@ func (w *writeService) writeUrl() (string, error) { if err != nil { return "", err } - u.Path = path.Join(u.Path, "write") - + u, err = u.Parse("write") + if err != nil { + return "", err + } params := u.Query() params.Set("org", w.org) params.Set("bucket", w.bucket) From 52feb08543ca82ee21a453fc48721d9f22c8d088 Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Fri, 24 Apr 2020 14:02:23 +0200 Subject: [PATCH 09/11] refactor: Authorizations API methods better names --- api/authorizations.go | 28 ++++++++++++++-------------- client_e2e_test.go | 12 ++++++------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/api/authorizations.go b/api/authorizations.go index e0cb2ccd..922ab8c9 100644 --- a/api/authorizations.go +++ b/api/authorizations.go @@ -8,20 +8,20 @@ import ( // AuthorizationsApi provides methods for organizing Authorization in a InfluxDB server type AuthorizationsApi interface { - // FindAuthorizations returns all authorizations - FindAuthorizations(ctx context.Context) (*[]domain.Authorization, error) + // GetAuthorizations returns all authorizations + GetAuthorizations(ctx context.Context) (*[]domain.Authorization, error) // FindAuthorizationsByUserName returns all authorizations for given userName FindAuthorizationsByUserName(ctx context.Context, userName string) (*[]domain.Authorization, error) - // FindAuthorizationsByUserID returns all authorizations for given userID - FindAuthorizationsByUserID(ctx context.Context, userID string) (*[]domain.Authorization, error) + // FindAuthorizationsByUserId returns all authorizations for given userID + FindAuthorizationsByUserId(ctx context.Context, userId string) (*[]domain.Authorization, error) // FindAuthorizationsByOrgName returns all authorizations for given organization name FindAuthorizationsByOrgName(ctx context.Context, orgName string) (*[]domain.Authorization, error) - // FindAuthorizationsByUserID returns all authorizations for given organization id - FindAuthorizationsByOrgID(ctx context.Context, orgID string) (*[]domain.Authorization, error) + // FindAuthorizationsByUserId returns all authorizations for given organization id + FindAuthorizationsByOrgId(ctx context.Context, orgId string) (*[]domain.Authorization, error) // CreateAuthorization creates new authorization CreateAuthorization(ctx context.Context, authorization *domain.Authorization) (*domain.Authorization, error) - // CreateAuthorizationWithOrgID creates new authorization with given permissions scoped to given orgId - CreateAuthorizationWithOrgID(ctx context.Context, orgId string, permissions []domain.Permission) (*domain.Authorization, error) + // CreateAuthorizationWithOrgId creates new authorization with given permissions scoped to given orgId + CreateAuthorizationWithOrgId(ctx context.Context, orgId string, permissions []domain.Permission) (*domain.Authorization, error) // UpdateAuthorizationStatus updates status of authorization with authId UpdateAuthorizationStatus(ctx context.Context, authId string, status domain.AuthorizationUpdateRequestStatus) (*domain.Authorization, error) // DeleteAuthorization deletes authorization with authId @@ -40,7 +40,7 @@ func NewAuthorizationApi(service ihttp.Service) AuthorizationsApi { } } -func (a *authorizationsApiImpl) FindAuthorizations(ctx context.Context) (*[]domain.Authorization, error) { +func (a *authorizationsApiImpl) GetAuthorizations(ctx context.Context) (*[]domain.Authorization, error) { authQuery := &domain.GetAuthorizationsParams{} auths, err := a.listAuthorizations(ctx, authQuery) if err != nil { @@ -58,8 +58,8 @@ func (a *authorizationsApiImpl) FindAuthorizationsByUserName(ctx context.Context return auths.Authorizations, nil } -func (a *authorizationsApiImpl) FindAuthorizationsByUserID(ctx context.Context, userID string) (*[]domain.Authorization, error) { - authQuery := &domain.GetAuthorizationsParams{UserID: &userID} +func (a *authorizationsApiImpl) FindAuthorizationsByUserId(ctx context.Context, userId string) (*[]domain.Authorization, error) { + authQuery := &domain.GetAuthorizationsParams{UserID: &userId} auths, err := a.listAuthorizations(ctx, authQuery) if err != nil { return nil, err @@ -76,8 +76,8 @@ func (a *authorizationsApiImpl) FindAuthorizationsByOrgName(ctx context.Context, return auths.Authorizations, nil } -func (a *authorizationsApiImpl) FindAuthorizationsByOrgID(ctx context.Context, orgID string) (*[]domain.Authorization, error) { - authQuery := &domain.GetAuthorizationsParams{OrgID: &orgID} +func (a *authorizationsApiImpl) FindAuthorizationsByOrgId(ctx context.Context, orgId string) (*[]domain.Authorization, error) { + authQuery := &domain.GetAuthorizationsParams{OrgID: &orgId} auths, err := a.listAuthorizations(ctx, authQuery) if err != nil { return nil, err @@ -114,7 +114,7 @@ func (a *authorizationsApiImpl) CreateAuthorization(ctx context.Context, authori return response.JSON201, nil } -func (a *authorizationsApiImpl) CreateAuthorizationWithOrgID(ctx context.Context, orgId string, permissions []domain.Permission) (*domain.Authorization, error) { +func (a *authorizationsApiImpl) CreateAuthorizationWithOrgId(ctx context.Context, orgId string, permissions []domain.Permission) (*domain.Authorization, error) { status := domain.AuthorizationUpdateRequestStatusActive auth := &domain.Authorization{ AuthorizationUpdateRequest: domain.AuthorizationUpdateRequest{Status: &status}, diff --git a/client_e2e_test.go b/client_e2e_test.go index 36e3cced..5bedd2be 100644 --- a/client_e2e_test.go +++ b/client_e2e_test.go @@ -137,7 +137,7 @@ func TestAuthorizationsApi(t *testing.T) { } client := NewClient("http://localhost:9999", authToken) authApi := client.AuthorizationsApi() - listRes, err := authApi.FindAuthorizations(context.Background()) + listRes, err := authApi.GetAuthorizations(context.Background()) require.Nil(t, err) require.NotNil(t, listRes) assert.Len(t, *listRes, 1) @@ -156,12 +156,12 @@ func TestAuthorizationsApi(t *testing.T) { } permissions := []domain.Permission{*permission} - auth, err := authApi.CreateAuthorizationWithOrgID(context.Background(), *org.Id, permissions) + auth, err := authApi.CreateAuthorizationWithOrgId(context.Background(), *org.Id, permissions) require.Nil(t, err) require.NotNil(t, auth) assert.Equal(t, domain.AuthorizationUpdateRequestStatusActive, *auth.Status, *auth.Status) - listRes, err = authApi.FindAuthorizations(context.Background()) + listRes, err = authApi.GetAuthorizations(context.Background()) require.Nil(t, err) require.NotNil(t, listRes) assert.Len(t, *listRes, 2) @@ -171,7 +171,7 @@ func TestAuthorizationsApi(t *testing.T) { require.NotNil(t, listRes) assert.Len(t, *listRes, 2) - listRes, err = authApi.FindAuthorizationsByOrgID(context.Background(), *org.Id) + listRes, err = authApi.FindAuthorizationsByOrgId(context.Background(), *org.Id) require.Nil(t, err) require.NotNil(t, listRes) assert.Len(t, *listRes, 2) @@ -191,7 +191,7 @@ func TestAuthorizationsApi(t *testing.T) { require.NotNil(t, auth) assert.Equal(t, domain.AuthorizationUpdateRequestStatusInactive, *auth.Status, *auth.Status) - listRes, err = authApi.FindAuthorizations(context.Background()) + listRes, err = authApi.GetAuthorizations(context.Background()) require.Nil(t, err) require.NotNil(t, listRes) assert.Len(t, *listRes, 2) @@ -199,7 +199,7 @@ func TestAuthorizationsApi(t *testing.T) { err = authApi.DeleteAuthorization(context.Background(), *auth.Id) require.Nil(t, err) - listRes, err = authApi.FindAuthorizations(context.Background()) + listRes, err = authApi.GetAuthorizations(context.Background()) require.Nil(t, err) require.NotNil(t, listRes) assert.Len(t, *listRes, 1) From 2c8961a9beee6d5c35d1012cae92b119bf3429fd Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Fri, 24 Apr 2020 13:52:48 +0200 Subject: [PATCH 10/11] test: Fixed composing API url --- writeApiBlocking_test.go | 24 +++++------------- write_test.go | 54 +++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 49 deletions(-) diff --git a/writeApiBlocking_test.go b/writeApiBlocking_test.go index 411fa00c..0dbd80f3 100644 --- a/writeApiBlocking_test.go +++ b/writeApiBlocking_test.go @@ -15,12 +15,8 @@ import ( ) func TestWritePoint(t *testing.T) { - client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} - service := &testHttpService{ - t: t, - options: client.Options(), - serverUrl: client.ServerUrl(), - } + client := newTestClient() + service := newTestService(t, client) client.options.SetBatchSize(5) writeApi := newWriteApiBlockingImpl("my-org", "my-bucket", service, client) points := genPoints(10) @@ -36,12 +32,8 @@ func TestWritePoint(t *testing.T) { } func TestWriteRecord(t *testing.T) { - client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} - service := &testHttpService{ - t: t, - options: client.Options(), - serverUrl: client.ServerUrl(), - } + client := newTestClient() + service := newTestService(t, client) client.options.SetBatchSize(5) writeApi := newWriteApiBlockingImpl("my-org", "my-bucket", service, client) lines := genRecords(10) @@ -64,12 +56,8 @@ func TestWriteRecord(t *testing.T) { } func TestWriteContextCancel(t *testing.T) { - client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} - service := &testHttpService{ - t: t, - options: client.Options(), - serverUrl: client.ServerUrl(), - } + client := newTestClient() + service := newTestService(t, client) client.options.SetBatchSize(5) writeApi := newWriteApiBlockingImpl("my-org", "my-bucket", service, client) lines := genRecords(10) diff --git a/write_test.go b/write_test.go index 1a802ab0..46b4c5bb 100644 --- a/write_test.go +++ b/write_test.go @@ -84,7 +84,7 @@ func (t *testHttpService) PostRequest(_ context.Context, url string, body io.Rea body, _ = gzip.NewReader(body) t.wasGzip = true } - assert.Equal(t.t, url, fmt.Sprintf("%s/api/v2/write?bucket=my-bucket&org=my-org&precision=ns", t.serverUrl)) + assert.Equal(t.t, fmt.Sprintf("%swrite?bucket=my-bucket&org=my-org&precision=ns", t.serverUrl), url) if t.ReplyError() != nil { return t.ReplyError() @@ -121,6 +121,18 @@ func (t *testHttpService) Lines() []string { return t.lines } +func newTestClient() *client { + return &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} +} + +func newTestService(t *testing.T, client InfluxDBClient) *testHttpService { + return &testHttpService{ + t: t, + options: client.Options(), + serverUrl: client.ServerUrl() + "/api/v2/", + } +} + func genPoints(num int) []*Point { points := make([]*Point, num) rand.Seed(321) @@ -165,12 +177,8 @@ func genRecords(num int) []string { } func TestWriteApiImpl_Write(t *testing.T) { - client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} - service := &testHttpService{ - t: t, - options: client.Options(), - serverUrl: client.ServerUrl(), - } + client := newTestClient() + service := newTestService(t, client) client.options.SetBatchSize(5) writeApi := newWriteApiImpl("my-org", "my-bucket", service, client) points := genPoints(10) @@ -188,12 +196,8 @@ func TestWriteApiImpl_Write(t *testing.T) { } func TestGzipWithFlushing(t *testing.T) { - client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} - service := &testHttpService{ - t: t, - options: client.Options(), - serverUrl: client.ServerUrl(), - } + client := newTestClient() + service := newTestService(t, client) client.options.SetBatchSize(5).SetUseGZip(true) writeApi := newWriteApiImpl("my-org", "my-bucket", service, client) points := genPoints(5) @@ -216,12 +220,8 @@ func TestGzipWithFlushing(t *testing.T) { writeApi.Close() } func TestFlushInterval(t *testing.T) { - client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} - service := &testHttpService{ - t: t, - options: client.Options(), - serverUrl: client.ServerUrl(), - } + client := newTestClient() + service := newTestService(t, client) client.options.SetBatchSize(10).SetFlushInterval(500) writeApi := newWriteApiImpl("my-org", "my-bucket", service, client) points := genPoints(5) @@ -247,12 +247,8 @@ func TestFlushInterval(t *testing.T) { } func TestRetry(t *testing.T) { - client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} - service := &testHttpService{ - t: t, - options: client.Options(), - serverUrl: client.ServerUrl(), - } + client := newTestClient() + service := newTestService(t, client) client.options.SetLogLevel(3). SetBatchSize(5). SetRetryInterval(10000) @@ -291,12 +287,8 @@ func TestRetry(t *testing.T) { } func TestWriteError(t *testing.T) { - client := &client{serverUrl: "http://locahost:4444", options: DefaultOptions()} - service := &testHttpService{ - t: t, - options: client.Options(), - serverUrl: client.ServerUrl(), - } + client := newTestClient() + service := newTestService(t, client) client.options.SetLogLevel(3).SetBatchSize(5) service.replyError = &ihttp.Error{ StatusCode: 400, From 5353e337ef9043f18848989ec7b297521a414859 Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Fri, 24 Apr 2020 14:18:19 +0200 Subject: [PATCH 11/11] doc: Updated CHANGELOG.md --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3ba82a2..935bac4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ +## 1.1.0 +### Features +1. [#96](https://github.com/influxdata/influxdb-client-go/pull/96) Authorization API + ## 1.0.0 [2020-04-01] - ### Core - initial release of new client version