-
Notifications
You must be signed in to change notification settings - Fork 6
/
http.go
6833 lines (5618 loc) · 246 KB
/
http.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Package api provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.
package api
import (
"bytes"
"compress/gzip"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"path"
"strings"
"time"
"github.com/deepmap/oapi-codegen/pkg/runtime"
"github.com/getkin/kin-openapi/openapi3"
)
const (
BearerAuthScopes = "BearerAuth.Scopes"
)
// Defines values for ErrorCode.
const (
ABORTED ErrorCode = "ABORTED"
ALREADYEXISTS ErrorCode = "ALREADY_EXISTS"
BADGATEWAY ErrorCode = "BAD_GATEWAY"
CANCELLED ErrorCode = "CANCELLED"
CONFLICT ErrorCode = "CONFLICT"
DATALOSS ErrorCode = "DATA_LOSS"
DEADLINEEXCEEDED ErrorCode = "DEADLINE_EXCEEDED"
FAILEDPRECONDITION ErrorCode = "FAILED_PRECONDITION"
INTERNAL ErrorCode = "INTERNAL"
INVALIDARGUMENT ErrorCode = "INVALID_ARGUMENT"
METHODNOTALLOWED ErrorCode = "METHOD_NOT_ALLOWED"
NOTFOUND ErrorCode = "NOT_FOUND"
OK ErrorCode = "OK"
OUTOFRANGE ErrorCode = "OUT_OF_RANGE"
PERMISSIONDENIED ErrorCode = "PERMISSION_DENIED"
RESOURCEEXHAUSTED ErrorCode = "RESOURCE_EXHAUSTED"
UNAUTHENTICATED ErrorCode = "UNAUTHENTICATED"
UNAVAILABLE ErrorCode = "UNAVAILABLE"
UNIMPLEMENTED ErrorCode = "UNIMPLEMENTED"
UNKNOWN ErrorCode = "UNKNOWN"
)
// Defines values for GetAccessTokenRequestGrantType.
const (
CLIENTCREDENTIALS GetAccessTokenRequestGrantType = "CLIENT_CREDENTIALS"
REFRESHTOKEN GetAccessTokenRequestGrantType = "REFRESH_TOKEN"
)
// Defines values for QueryTimeSeriesMetricsRequestFunction.
const (
COUNT QueryTimeSeriesMetricsRequestFunction = "COUNT"
NONE QueryTimeSeriesMetricsRequestFunction = "NONE"
RATE QueryTimeSeriesMetricsRequestFunction = "RATE"
)
// Defines values for QueryTimeSeriesMetricsRequestSpaceAggregation.
const (
AVG QueryTimeSeriesMetricsRequestSpaceAggregation = "AVG"
MAX QueryTimeSeriesMetricsRequestSpaceAggregation = "MAX"
MIN QueryTimeSeriesMetricsRequestSpaceAggregation = "MIN"
SUM QueryTimeSeriesMetricsRequestSpaceAggregation = "SUM"
)
// Defines values for QueryTimeSeriesMetricsRequestTigrisOperation.
const (
ALL QueryTimeSeriesMetricsRequestTigrisOperation = "ALL"
METADATA QueryTimeSeriesMetricsRequestTigrisOperation = "METADATA"
READ QueryTimeSeriesMetricsRequestTigrisOperation = "READ"
WRITE QueryTimeSeriesMetricsRequestTigrisOperation = "WRITE"
)
// Defines values for RollupFunctionAggregator.
const (
ROLLUPAGGREGATORAVG RollupFunctionAggregator = "ROLLUP_AGGREGATOR_AVG"
ROLLUPAGGREGATORCOUNT RollupFunctionAggregator = "ROLLUP_AGGREGATOR_COUNT"
ROLLUPAGGREGATORMAX RollupFunctionAggregator = "ROLLUP_AGGREGATOR_MAX"
ROLLUPAGGREGATORMIN RollupFunctionAggregator = "ROLLUP_AGGREGATOR_MIN"
ROLLUPAGGREGATORSUM RollupFunctionAggregator = "ROLLUP_AGGREGATOR_SUM"
)
// Additional function to apply on metrics query
type AdditionalFunction struct {
// Rollup function aggregates the slices of metrics returned by original query and lets you operate on the slices using aggregator and constructs the bigger slice of your choice of interval (specified in seconds).
Rollup *RollupFunction `json:"rollup,omitempty"`
}
// An user application
type Application struct {
// Created at
CreatedAt *int64 `json:"created_at,omitempty"`
// Created by
CreatedBy *string `json:"created_by,omitempty"`
// A human readable app description
Description *string `json:"description,omitempty"`
// Generated client id
Id *string `json:"id,omitempty"`
// A human readable app name
Name *string `json:"name,omitempty"`
// Generated app secret
Secret *string `json:"secret,omitempty"`
// Updated at
UpdatedAt *int64 `json:"updated_at,omitempty"`
// Updated by
UpdatedBy *string `json:"updated_by,omitempty"`
}
// Start new transaction in database specified by "db".
type BeginTransactionRequest struct {
// Options that can be used to modify the transaction semantics.
Options *TransactionOptions `json:"options,omitempty"`
}
// Start transaction returns transaction context which uniquely identifies the transaction
type BeginTransactionResponse struct {
// Contains ID which uniquely identifies transaction This context is returned by BeginTransaction request and should be passed in the metadata (headers) of subsequent requests in order to run them in the context of the same transaction.
TxCtx *TransactionCtx `json:"tx_ctx,omitempty"`
}
// A collation allows you to specify string comparison rules. Default is case-sensitive, to override it you can set this option to 'ci' that will apply to all the text fields in the filters.
type Collation struct {
Case *string `json:"case,omitempty"`
}
// CollectionDescription defines model for CollectionDescription.
type CollectionDescription struct {
// Name of the collection.
Collection *string `json:"collection,omitempty"`
Metadata *CollectionMetadata `json:"metadata,omitempty"`
// Collections schema
Schema json.RawMessage `json:"schema,omitempty"`
// Collection size in bytes
Size *int64 `json:"size,omitempty"`
}
// CollectionInfo defines model for CollectionInfo.
type CollectionInfo struct {
// Collection name.
Collection *string `json:"collection,omitempty"`
Metadata *CollectionMetadata `json:"metadata,omitempty"`
}
// CollectionMetadata defines model for CollectionMetadata.
type CollectionMetadata = map[string]interface{}
// Collection requests modifying options.
type CollectionOptions = map[string]interface{}
// Commit transaction with the given ID
type CommitTransactionRequest = map[string]interface{}
// CommitTransactionResponse defines model for CommitTransactionResponse.
type CommitTransactionResponse struct {
// Status of commit transaction operation.
Status *string `json:"status,omitempty"`
}
// Request creation of user application
type CreateApplicationRequest struct {
// A human readable app description
Description *string `json:"description,omitempty"`
// A human readable app name
Name *string `json:"name,omitempty"`
}
// CreateApplication returns created application
type CreateApplicationResponse struct {
// An user application
CreatedApplication *Application `json:"created_application,omitempty"`
}
// CreateDatabaseRequest defines model for CreateDatabaseRequest.
type CreateDatabaseRequest struct {
// Database requests modifying options.
Options *DatabaseOptions `json:"options,omitempty"`
}
// CreateDatabaseResponse defines model for CreateDatabaseResponse.
type CreateDatabaseResponse struct {
// A detailed response message.
Message *string `json:"message,omitempty"`
// An enum with value set as "created".
Status *string `json:"status,omitempty"`
}
// CreateNamespaceRequest defines model for CreateNamespaceRequest.
type CreateNamespaceRequest struct {
// A unique namespace id.
Id *int32 `json:"id,omitempty"`
}
// CreateNamespaceResponse defines model for CreateNamespaceResponse.
type CreateNamespaceResponse struct {
// A detailed response message.
Message *string `json:"message,omitempty"`
// An enum with value set as "created".
Status *string `json:"status,omitempty"`
}
// CreateOrUpdateCollectionRequest defines model for CreateOrUpdateCollectionRequest.
type CreateOrUpdateCollectionRequest struct {
// If set to `true` then the update schema request to the collection will fail by returning a conflict with HTTP Status code 409. The default is false.
OnlyCreate *bool `json:"only_create,omitempty"`
// Collection requests modifying options.
Options *CollectionOptions `json:"options,omitempty"`
// The schema specifications are same as JSON schema specification defined <a href="https://json-schema.org/specification.html" title="here">here</a>. The schema of the `documents` collection differs from the schema of `topic` collection as `topic` collection does not have any concept of `primary_key`. The server recognizes type of the collection by the `collection_type` set in the schema.<p></p> Schema example of `documents`: `{ "title": "user", "description": "Collection of documents with details of users", "properties": { "id": { "description": "A unique identifier for the user", "type": "integer" }, "name": { "description": "Name of the user", "type": "string", "maxLength": 100 }, "balance": { "description": "User account balance", "type": "number" } }, "primary_key": ["id"] }` <p></p>*Note: The `collection_type` is not set as default is documents.* <p></p>Schema example of `topic`: `{ "title": "user_events", "description": "Topic for user events", "properties": { "event_id": { "description": "A id for the event", "type": "integer" }, "event_type": { "description": "Type of the Event", "type": "string", "maxLength": 100 } "event_details": { "description": "Details about the Event", "type": "string" } }, "collection_type": "topic" }` <p></p> *Note: The `collection_type` is set as "topic".*
Schema json.RawMessage `json:"schema,omitempty"`
}
// CreateOrUpdateCollectionResponse defines model for CreateOrUpdateCollectionResponse.
type CreateOrUpdateCollectionResponse struct {
// A detailed response message.
Message *string `json:"message,omitempty"`
// An enum with value set as "created" or "updated"
Status *string `json:"status,omitempty"`
}
// Represents the data point in timeseries.
type DataPoint struct {
Timestamp *int64 `json:"timestamp,omitempty"`
Value *float64 `json:"value,omitempty"`
}
// DatabaseInfo defines model for DatabaseInfo.
type DatabaseInfo struct {
// Database name.
Db *string `json:"db,omitempty"`
Metadata *DatabaseMetadata `json:"metadata,omitempty"`
}
// DatabaseMetadata defines model for DatabaseMetadata.
type DatabaseMetadata = map[string]interface{}
// Database requests modifying options.
type DatabaseOptions = map[string]interface{}
// DeleteApplication returns the flag to convey if application was deleted
type DeleteApplicationResponse struct {
// status flag for delete operation
Deleted *bool `json:"deleted,omitempty"`
}
// Request deletion of an application
type DeleteApplicationsRequest struct {
// application id
Id *string `json:"id,omitempty"`
}
// DeleteRequest defines model for DeleteRequest.
type DeleteRequest struct {
// Delete documents which matching specified filter. A filter can simply be key, value where key is the field name and value would be the value for this field. Or a filter can be logical where two or more fields can be logically joined using $or and $and. A few examples of filter: <li> To delete a user document where the id has a value 1: ```{"id": 1 }``` <li> To delete all the user documents where the key "id" has a value 1 or 2 or 3: `{"$or": [{"id": 1}, {"id": 2}, {"id": 3}]}`
Filter json.RawMessage `json:"filter,omitempty"`
// Additional options for deleted requests.
Options *DeleteRequestOptions `json:"options,omitempty"`
}
// Additional options for deleted requests.
type DeleteRequestOptions struct {
// A collation allows you to specify string comparison rules. Default is case-sensitive, to override it you can set this option to 'ci' that will apply to all the text fields in the filters.
Collation *Collation `json:"collation,omitempty"`
// Additional options to modify write requests.
WriteOptions *WriteOptions `json:"write_options,omitempty"`
}
// DeleteResponse defines model for DeleteResponse.
type DeleteResponse struct {
// Has metadata related to the documents stored.
Metadata *ResponseMetadata `json:"metadata,omitempty"`
// an enum with value set as "deleted"
Status *string `json:"status,omitempty"`
}
// DescribeCollectionRequest defines model for DescribeCollectionRequest.
type DescribeCollectionRequest struct {
// Name of the collection.
Collection *string `json:"collection,omitempty"`
// Name of the database.
Db *string `json:"db,omitempty"`
// Collection requests modifying options.
Options *CollectionOptions `json:"options,omitempty"`
}
// A detailed description of the collection. The description returns collection metadata and the schema.
type DescribeCollectionResponse struct {
// Name of the collection.
Collection *string `json:"collection,omitempty"`
Metadata *CollectionMetadata `json:"metadata,omitempty"`
// Schema of this collection.
Schema json.RawMessage `json:"schema,omitempty"`
// The size of this collection in bytes.
Size *int64 `json:"size,omitempty"`
}
// DescribeDatabaseRequest defines model for DescribeDatabaseRequest.
type DescribeDatabaseRequest struct {
// Name of the database.
Db *string `json:"db,omitempty"`
}
// A detailed description of the database and all the associated collections. Description of the collection includes schema details as well.
type DescribeDatabaseResponse struct {
// A detailed description about all the collections. The description returns collection metadata and the schema.
Collections *[]CollectionDescription `json:"collections,omitempty"`
// Name of the database.
Db *string `json:"db,omitempty"`
Metadata *DatabaseMetadata `json:"metadata,omitempty"`
// Sum of all the collections sizes present in this database
Size *int64 `json:"size,omitempty"`
}
// DropCollectionRequest defines model for DropCollectionRequest.
type DropCollectionRequest struct {
// Collection requests modifying options.
Options *CollectionOptions `json:"options,omitempty"`
}
// DropCollectionResponse defines model for DropCollectionResponse.
type DropCollectionResponse struct {
// A detailed response message.
Message *string `json:"message,omitempty"`
// An enum with value set as "dropped".
Status *string `json:"status,omitempty"`
}
// DropDatabaseRequest defines model for DropDatabaseRequest.
type DropDatabaseRequest struct {
// Database requests modifying options.
Options *DatabaseOptions `json:"options,omitempty"`
}
// DropDatabaseResponse defines model for DropDatabaseResponse.
type DropDatabaseResponse struct {
// A detailed response message.
Message *string `json:"message,omitempty"`
// An enum with value set as "dropped".
Status *string `json:"status,omitempty"`
}
// The Error type defines a logical error model
type Error struct {
// The status code is a short, machine parsable string, which uniquely identifies the error type. Tigris to HTTP code mapping [here](/reference/http-code)
Code *ErrorCode `json:"code,omitempty"`
// A developer-facing descriptive error message
Message *string `json:"message,omitempty"`
}
// The status code is a short, machine parsable string, which uniquely identifies the error type. Tigris to HTTP code mapping [here](/reference/http-code)
type ErrorCode string
// FacetCount defines model for FacetCount.
type FacetCount struct {
Count *int64 `json:"count,omitempty"`
Value *string `json:"value,omitempty"`
}
// Additional stats for faceted field
type FacetStats struct {
// Average of all values in a field. Only available for numeric fields
Avg *float64 `json:"avg,omitempty"`
// Total number of values in a field
Count *int64 `json:"count,omitempty"`
// Maximum of all values in a field. Only available for numeric fields
Max *float64 `json:"max,omitempty"`
// Minimum of all values in a field. Only available for numeric fields
Min *float64 `json:"min,omitempty"`
// Sum of all values in a field. Only available for numeric fields
Sum *float64 `json:"sum,omitempty"`
}
// The Request message for the GetAccessToken. The grant type is a required field and based on the grant type the other fields are used as mentioned below.
type GetAccessTokenRequest struct {
// Client Id is required when grant type is set as `CLIENT_CREDENTIALS`.
ClientId *string `json:"client_id,omitempty"`
// Your Tigris API Key is required when grant type is set as `CLIENT_CREDENTIALS`.
ClientSecret *string `json:"client_secret,omitempty"`
GrantType *GetAccessTokenRequestGrantType `json:"grant_type,omitempty"`
// Refresh token is required when grant type is set as `REFRESH_TOKEN`.
RefreshToken *string `json:"refresh_token,omitempty"`
}
// GetAccessTokenRequestGrantType defines model for GetAccessTokenRequest.GrantType.
type GetAccessTokenRequestGrantType string
// The response of GetAccessToken which contains access_token and optionally refresh_token.
type GetAccessTokenResponse struct {
// An Access Token.
AccessToken *string `json:"access_token,omitempty"`
// Access token expiration timeout in seconds.
ExpiresIn *int32 `json:"expires_in,omitempty"`
// The Refresh Token.
RefreshToken *string `json:"refresh_token,omitempty"`
}
// GetInfoResponse defines model for GetInfoResponse.
type GetInfoResponse struct {
ServerVersion *string `json:"server_version,omitempty"`
}
// Request user metadata
type GetUserMetadataRequest struct {
MetadataKey *string `json:"metadataKey,omitempty"`
Value *map[string]interface{} `json:"value,omitempty"`
}
// User metadata response
type GetUserMetadataResponse struct {
MetadataKey *string `json:"metadataKey,omitempty"`
NamespaceId *uint32 `json:"namespaceId,omitempty"`
UserId *string `json:"userId,omitempty"`
Value *map[string]interface{} `json:"value,omitempty"`
}
// HealthCheckResponse defines model for HealthCheckResponse.
type HealthCheckResponse struct {
Response *string `json:"response,omitempty"`
}
// InsertRequest defines model for InsertRequest.
type InsertRequest struct {
// Array of documents to insert. Each document is a JSON object.
Documents *[]json.RawMessage `json:"documents,omitempty"`
// additional options for insert requests.
Options *InsertRequestOptions `json:"options,omitempty"`
}
// additional options for insert requests.
type InsertRequestOptions struct {
// Additional options to modify write requests.
WriteOptions *WriteOptions `json:"write_options,omitempty"`
}
// InsertResponse defines model for InsertResponse.
type InsertResponse struct {
// an array returns the value of the primary keys.
Keys *[][]byte `json:"keys,omitempty"`
// Has metadata related to the documents stored.
Metadata *ResponseMetadata `json:"metadata,omitempty"`
// An enum with value set as "inserted"
Status *string `json:"status,omitempty"`
}
// Request insertion of user metadata
type InsertUserMetadataRequest struct {
MetadataKey *string `json:"metadataKey,omitempty"`
Value *map[string]interface{} `json:"value,omitempty"`
}
// Insertion of user metadata response
type InsertUserMetadataResponse struct {
MetadataKey *string `json:"metadataKey,omitempty"`
NamespaceId *uint32 `json:"namespaceId,omitempty"`
UserId *string `json:"userId,omitempty"`
Value *map[string]interface{} `json:"value,omitempty"`
}
// Request listing of all the application those are visible to requesting actor
type ListApplicationsRequest = map[string]interface{}
// ListApplication returns one or more visible application to user
type ListApplicationsResponse struct {
Applications *[]Application `json:"applications,omitempty"`
}
// ListCollectionsRequest defines model for ListCollectionsRequest.
type ListCollectionsRequest struct {
// Collection requests modifying options.
Options *CollectionOptions `json:"options,omitempty"`
}
// ListCollectionsResponse defines model for ListCollectionsResponse.
type ListCollectionsResponse struct {
// List of the collections info in the database.
Collections *[]CollectionInfo `json:"collections,omitempty"`
// Name of the database.
Db *string `json:"db,omitempty"`
}
// ListDatabasesResponse defines model for ListDatabasesResponse.
type ListDatabasesResponse struct {
// List of the databases.
Databases *[]DatabaseInfo `json:"databases,omitempty"`
}
// ListNamespacesResponse defines model for ListNamespacesResponse.
type ListNamespacesResponse struct {
Namespaces *[]NamespaceInfo `json:"namespaces,omitempty"`
}
// Represents series in timeseries based on input query.
type MetricSeries struct {
DataPoints *[]DataPoint `json:"dataPoints,omitempty"`
From *int64 `json:"from,omitempty"`
Metric *string `json:"metric,omitempty"`
Scope *string `json:"scope,omitempty"`
To *int64 `json:"to,omitempty"`
}
// NamespaceInfo defines model for NamespaceInfo.
type NamespaceInfo struct {
// A unique namespace id.
Id *int32 `json:"id,omitempty"`
// A namespace name.
Name *string `json:"name,omitempty"`
}
// Pagination metadata for SearchResponse
type Page struct {
// Number representing the current page of results
Current *int32 `json:"current,omitempty"`
// Maximum number of results per page
Size *int32 `json:"size,omitempty"`
}
// PublishRequest defines model for PublishRequest.
type PublishRequest struct {
// Topic name where to publish messages.
Collection *string `json:"collection,omitempty"`
// Database name where to publish messages.
Db *string `json:"db,omitempty"`
// An array of JSON messages to publish.
Messages *[]json.RawMessage `json:"messages,omitempty"`
Options *PublishRequestOptions `json:"options,omitempty"`
}
// PublishRequestOptions defines model for PublishRequestOptions.
type PublishRequestOptions struct {
Partition *int32 `json:"partition,omitempty"`
}
// PublishResponse defines model for PublishResponse.
type PublishResponse struct {
Keys *[][]byte `json:"keys,omitempty"`
// Has metadata related to the documents stored.
Metadata *ResponseMetadata `json:"metadata,omitempty"`
Status *string `json:"status,omitempty"`
}
// Requests the time series metrics
type QueryTimeSeriesMetricsRequest struct {
AdditionalFunctions *[]AdditionalFunction `json:"additionalFunctions,omitempty"`
Collection *string `json:"collection,omitempty"`
Db *string `json:"db,omitempty"`
From *int64 `json:"from,omitempty"`
Function *QueryTimeSeriesMetricsRequestFunction `json:"function,omitempty"`
MetricName *string `json:"metric_name,omitempty"`
Quantile *float32 `json:"quantile,omitempty"`
SpaceAggregatedBy *[]string `json:"space_aggregated_by,omitempty"`
SpaceAggregation *QueryTimeSeriesMetricsRequestSpaceAggregation `json:"space_aggregation,omitempty"`
TigrisOperation *QueryTimeSeriesMetricsRequestTigrisOperation `json:"tigris_operation,omitempty"`
To *int64 `json:"to,omitempty"`
}
// QueryTimeSeriesMetricsRequestFunction defines model for QueryTimeSeriesMetricsRequest.Function.
type QueryTimeSeriesMetricsRequestFunction string
// QueryTimeSeriesMetricsRequestSpaceAggregation defines model for QueryTimeSeriesMetricsRequest.SpaceAggregation.
type QueryTimeSeriesMetricsRequestSpaceAggregation string
// QueryTimeSeriesMetricsRequestTigrisOperation defines model for QueryTimeSeriesMetricsRequest.TigrisOperation.
type QueryTimeSeriesMetricsRequestTigrisOperation string
// QueryTimeSeriesMetric responds with this type.
type QueryTimeSeriesMetricsResponse struct {
From *int64 `json:"from,omitempty"`
Query *string `json:"query,omitempty"`
Series *[]MetricSeries `json:"series,omitempty"`
To *int64 `json:"to,omitempty"`
}
// Request current namespace quota limits
type QuotaLimitsRequest = map[string]interface{}
// Contains current quota limits
type QuotaLimitsResponse struct {
// Number of allowed read units per second
ReadUnits *int64 `json:"ReadUnits,omitempty"`
// Maximum number of bytes allowed to store
StorageSize *int64 `json:"StorageSize,omitempty"`
// Number of allowed write units per second
WriteUnits *int64 `json:"WriteUnits,omitempty"`
}
// Request current namespace quota usage
type QuotaUsageRequest = map[string]interface{}
// Contains current quota usage
type QuotaUsageResponse struct {
// Number of read units used per second
ReadUnits *int64 `json:"ReadUnits,omitempty"`
// Number of read units throttled per second. Units which was rejected with "resource exhausted error".
ReadUnitsThrottled *int64 `json:"ReadUnitsThrottled,omitempty"`
// Number of bytes stored
StorageSize *int64 `json:"StorageSize,omitempty"`
// Number of bytes throttled. Number of bytes which were attempted to write in excess of quota and were rejected.
StorageSizeThrottled *int64 `json:"StorageSizeThrottled,omitempty"`
// Number of write units used per second
WriteUnits *int64 `json:"WriteUnits,omitempty"`
// Number of write units throttled per second. Units which was rejected with "resource exhausted error".
WriteUnitsThrottled *int64 `json:"WriteUnitsThrottled,omitempty"`
}
// ReadRequest defines model for ReadRequest.
type ReadRequest struct {
// To read specific fields from a document. Default is all.
Fields json.RawMessage `json:"fields,omitempty"`
// Returns documents matching this filter. A filter can simply be a key, value pair where a key is the field name and the value would be the value for this field. Tigris also allows complex filtering by passing logical expressions. Logical filters are applied on two or more fields using `$or` and `$and`. A few examples of filters: <li> To read a user document where the id has a value 1: ```{"id": 1 }``` <li> To read all the user documents where the key "id" has a value 1 or 2 or 3: `{"$or": [{"id": 1}, {"id": 2}, {"id": 3}]}` Filter allows setting collation on an individual field level. To set collation for all the fields see options. The detailed documentation of the filter is <a href="https://docs.tigrisdata.com/overview/query#specification-1" title="here">here</a>.
Filter json.RawMessage `json:"filter,omitempty"`
// Options that can be used to modify the results, for example "limit" to control the number of documents returned by the server.
Options *ReadRequestOptions `json:"options,omitempty"`
}
// Options that can be used to modify the results, for example "limit" to control the number of documents returned by the server.
type ReadRequestOptions struct {
// A collation allows you to specify string comparison rules. Default is case-sensitive, to override it you can set this option to 'ci' that will apply to all the text fields in the filters.
Collation *Collation `json:"collation,omitempty"`
// Limit the number of documents returned by the read operation.
Limit *int64 `json:"limit,omitempty"`
// A cursor for use in pagination. The next streams will return documents after this offset.
Offset *[]byte `json:"offset,omitempty"`
// Number of documents to skip before starting to return resulting documents.
Skip *int64 `json:"skip,omitempty"`
}
// ReadResponse defines model for ReadResponse.
type ReadResponse struct {
// Object containing the collection document.
Data json.RawMessage `json:"data,omitempty"`
// Has metadata related to the documents stored.
Metadata *ResponseMetadata `json:"metadata,omitempty"`
// An internal key, used for pagination.
ResumeToken *[]byte `json:"resume_token,omitempty"`
}
// ReplaceRequest defines model for ReplaceRequest.
type ReplaceRequest struct {
// Array of documents to be replaced. Each document is a JSON object.
Documents *[]json.RawMessage `json:"documents,omitempty"`
// Additional options for replace requests.
Options *ReplaceRequestOptions `json:"options,omitempty"`
}
// Additional options for replace requests.
type ReplaceRequestOptions struct {
// Additional options to modify write requests.
WriteOptions *WriteOptions `json:"write_options,omitempty"`
}
// ReplaceResponse defines model for ReplaceResponse.
type ReplaceResponse struct {
// an array returns the value of the primary keys.
Keys *[][]byte `json:"keys,omitempty"`
// Has metadata related to the documents stored.
Metadata *ResponseMetadata `json:"metadata,omitempty"`
// an enum with value set as "replaced"
Status *string `json:"status,omitempty"`
}
// Has metadata related to the documents stored.
type ResponseMetadata struct {
// Time at which the document was inserted/replaced. Measured in nano-seconds since the Unix epoch.
CreatedAt *time.Time `json:"created_at,omitempty"`
// Time at which the document was deleted. Measured in nano-seconds since the Unix epoch.
DeletedAt *time.Time `json:"deleted_at,omitempty"`
// Time at which the document was updated. Measured in nano-seconds since the Unix epoch.
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
// Rollback transaction with the given ID
type RollbackTransactionRequest = map[string]interface{}
// RollbackTransactionResponse defines model for RollbackTransactionResponse.
type RollbackTransactionResponse struct {
// Status of rollback transaction operation.
Status *string `json:"status,omitempty"`
}
// Rollup function aggregates the slices of metrics returned by original query and lets you operate on the slices using aggregator and constructs the bigger slice of your choice of interval (specified in seconds).
type RollupFunction struct {
Aggregator *RollupFunctionAggregator `json:"aggregator,omitempty"`
Interval *int64 `json:"interval,omitempty"`
}
// RollupFunctionAggregator defines model for RollupFunction.Aggregator.
type RollupFunctionAggregator string
// Request rotation of an application secret
type RotateApplicationSecretRequest struct {
// application id
Id *string `json:"id,omitempty"`
}
// RotateApplicationRequest returns the new application with rotated secret
type RotateApplicationSecretResponse struct {
// An user application
Application *Application `json:"application,omitempty"`
}
// SearchFacet defines model for SearchFacet.
type SearchFacet struct {
Counts *[]FacetCount `json:"counts,omitempty"`
// Additional stats for faceted field
Stats *FacetStats `json:"stats,omitempty"`
}
// SearchHit defines model for SearchHit.
type SearchHit struct {
// Actual search document
Data json.RawMessage `json:"data,omitempty"`
// Contains metadata related to the search hit, has information about document created_at/updated_at as well.
Metadata *SearchHitMeta `json:"metadata,omitempty"`
}
// Contains metadata related to the search hit, has information about document created_at/updated_at as well.
type SearchHitMeta struct {
// Time at which the document was inserted/replaced. Measured in nano-seconds since the Unix epoch.
CreatedAt *time.Time `json:"created_at,omitempty"`
// Time at which the document was updated. Measured in nano-seconds since the Unix epoch.
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
// SearchMetadata defines model for SearchMetadata.
type SearchMetadata struct {
// Total number of search results across all pages
Found *int64 `json:"found,omitempty"`
// Pagination metadata for SearchResponse
Page *Page `json:"page,omitempty"`
// Number representing the total pages of results
TotalPages *int32 `json:"total_pages,omitempty"`
}
// SearchRequest defines model for SearchRequest.
type SearchRequest struct {
// A collation allows you to specify string comparison rules. Default is case-sensitive, to override it you can set this option to 'ci' that will apply to all the text fields in the filters.
Collation *Collation `json:"collation,omitempty"`
// Array of document field names to exclude from results. `include_fields`, if specified, takes precedence over `exclude_fields`.
ExcludeFields *[]string `json:"exclude_fields,omitempty"`
// Facet query to aggregate results on given fields. The field name for the facet search can be passed like this `{"brand": { "size": 10 }}` where the size controls the total facets for this field.
Facet json.RawMessage `json:"facet,omitempty"`
Fields json.RawMessage `json:"fields,omitempty"`
// Filter stacks on top of query results to further narrow down the results. Similar to `ReadRequest.filter`
Filter json.RawMessage `json:"filter,omitempty"`
// Array of document field names to include in results. By default, all fields are included.
IncludeFields *[]string `json:"include_fields,omitempty"`
// Optionally can specify the page to retrieve. If page is set then only hits for this page is returned
Page *int32 `json:"page,omitempty"`
// Optionally can set the number of hits to be returned per page, default is 20.
PageSize *int32 `json:"page_size,omitempty"`
// Query string for searching across text fields
Q *string `json:"q,omitempty"`
// Array of fields to project search query against
SearchFields *[]string `json:"search_fields,omitempty"`
// Array of fields and corresponding sort orders to order the results `[{ "salary": "$desc" }]`
Sort json.RawMessage `json:"sort,omitempty"`
}
// Response struct for search
type SearchResponse struct {
Facets *SearchResponse_Facets `json:"facets,omitempty"`
Hits *[]SearchHit `json:"hits,omitempty"`
Meta *SearchMetadata `json:"meta,omitempty"`
}
// SearchResponse_Facets defines model for SearchResponse.Facets.
type SearchResponse_Facets struct {
AdditionalProperties map[string]SearchFacet `json:"-"`
}
// Status defines model for Status.
type Status struct {
// The Error type defines a logical error model
Error *Error `json:"error,omitempty"`
}
// StreamingReadResponse defines model for StreamingReadResponse.
type StreamingReadResponse struct {
// The Error type defines a logical error model
Error *Error `json:"error,omitempty"`
Result *ReadResponse `json:"result,omitempty"`
}
// StreamingSearchResponse defines model for StreamingSearchResponse.
type StreamingSearchResponse struct {
// The Error type defines a logical error model
Error *Error `json:"error,omitempty"`
// Response struct for search
Result *SearchResponse `json:"result,omitempty"`
}
// StreamingSubscribeResponse defines model for StreamingSubscribeResponse.
type StreamingSubscribeResponse struct {
// The Error type defines a logical error model
Error *Error `json:"error,omitempty"`
Result *SubscribeResponse `json:"result,omitempty"`
}
// SubscribeRequest defines model for SubscribeRequest.
type SubscribeRequest struct {
// Topic name.
Collection *string `json:"collection,omitempty"`
// Database name.
Db *string `json:"db,omitempty"`
// Filter allows you to subscribe only for events that you need. Filter syntax is similar to `ReadRequest.filter`.
Filter json.RawMessage `json:"filter,omitempty"`
Options *SubscribeRequestOptions `json:"options,omitempty"`
}
// SubscribeRequestOptions defines model for SubscribeRequestOptions.
type SubscribeRequestOptions struct {
Partitions *[]int32 `json:"partitions,omitempty"`
}
// SubscribeResponse defines model for SubscribeResponse.
type SubscribeResponse struct {
Message json.RawMessage `json:"message,omitempty"`
}
// Contains ID which uniquely identifies transaction This context is returned by BeginTransaction request and should be passed in the metadata (headers) of subsequent requests in order to run them in the context of the same transaction.
type TransactionCtx struct {
// Unique for a single transactional request.
Id *string `json:"id,omitempty"`
// Serves as an internal identifier.
Origin *string `json:"origin,omitempty"`
}
// Options that can be used to modify the transaction semantics.
type TransactionOptions = map[string]interface{}
// Request creation of user application
type UpdateApplicationRequest struct {
// A new human readable app description
Description *string `json:"description,omitempty"`
// application id
Id *string `json:"id,omitempty"`
// A new human readable app name
Name *string `json:"name,omitempty"`
}
// CreateApplication returns created application
type UpdateApplicationResponse struct {
// An user application
UpdatedApplication *Application `json:"updated_application,omitempty"`
}
// UpdateRequest defines model for UpdateRequest.
type UpdateRequest struct {
// Fields contains set of fields with the values which need to be updated. Should be proper JSON object.
Fields json.RawMessage `json:"fields,omitempty"`
// Update documents which matching specified filter. A filter can simply be key, value where key is the field name and value would be the value for this field. Or a filter can be logical where two or more fields can be logically joined using $or and $and. A few examples of filter: <li> To update a user document where the id has a value 1: ```{"id": 1 }``` <li> To update all the user documents where the key "id" has a value 1 or 2 or 3: `{"$or": [{"id": 1}, {"id": 2}, {"id": 3}]}`
Filter json.RawMessage `json:"filter,omitempty"`
// Additional options for update requests.
Options *UpdateRequestOptions `json:"options,omitempty"`
}
// Additional options for update requests.
type UpdateRequestOptions struct {
// A collation allows you to specify string comparison rules. Default is case-sensitive, to override it you can set this option to 'ci' that will apply to all the text fields in the filters.
Collation *Collation `json:"collation,omitempty"`
// Additional options to modify write requests.
WriteOptions *WriteOptions `json:"write_options,omitempty"`
}
// UpdateResponse defines model for UpdateResponse.
type UpdateResponse struct {
// Has metadata related to the documents stored.
Metadata *ResponseMetadata `json:"metadata,omitempty"`
// Returns the number of documents modified.
ModifiedCount *int32 `json:"modified_count,omitempty"`
// an enum with value set as "updated".
Status *string `json:"status,omitempty"`
}
// Request update of user metadata
type UpdateUserMetadataRequest struct {
MetadataKey *string `json:"metadataKey,omitempty"`
Value *map[string]interface{} `json:"value,omitempty"`
}
// Update of user metadata response
type UpdateUserMetadataResponse struct {
MetadataKey *string `json:"metadataKey,omitempty"`
NamespaceId *uint32 `json:"namespaceId,omitempty"`
UserId *string `json:"userId,omitempty"`
Value *map[string]interface{} `json:"value,omitempty"`
}
// Additional options to modify write requests.
type WriteOptions = map[string]interface{}
// AuthGetAccessTokenJSONBody defines parameters for AuthGetAccessToken.
type AuthGetAccessTokenJSONBody = GetAccessTokenRequest
// TigrisListCollectionsJSONBody defines parameters for TigrisListCollections.
type TigrisListCollectionsJSONBody = ListCollectionsRequest
// TigrisCreateOrUpdateCollectionJSONBody defines parameters for TigrisCreateOrUpdateCollection.
type TigrisCreateOrUpdateCollectionJSONBody = CreateOrUpdateCollectionRequest
// TigrisDescribeCollectionJSONBody defines parameters for TigrisDescribeCollection.
type TigrisDescribeCollectionJSONBody = DescribeCollectionRequest
// TigrisDeleteJSONBody defines parameters for TigrisDelete.
type TigrisDeleteJSONBody = DeleteRequest