/
cosmos_database_request_options.go
54 lines (45 loc) · 1.5 KB
/
cosmos_database_request_options.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package azcosmos
import "github.com/Azure/azure-sdk-for-go/sdk/azcore"
// ReadDatabaseOptions includes options ReadDatabase operation.
type ReadDatabaseOptions struct {
IfMatchEtag *azcore.ETag
IfNoneMatchEtag *azcore.ETag
}
func (options *ReadDatabaseOptions) toHeaders() *map[string]string {
if options.IfMatchEtag == nil && options.IfNoneMatchEtag == nil {
return nil
}
headers := make(map[string]string)
if options.IfMatchEtag != nil {
headers[headerIfMatch] = string(*options.IfMatchEtag)
}
if options.IfNoneMatchEtag != nil {
headers[headerIfNoneMatch] = string(*options.IfNoneMatchEtag)
}
return &headers
}
// DeleteDatabaseOptions includes options DeleteDatabase operation.
type DeleteDatabaseOptions struct {
IfMatchEtag *azcore.ETag
IfNoneMatchEtag *azcore.ETag
}
func (options *DeleteDatabaseOptions) toHeaders() *map[string]string {
if options.IfMatchEtag == nil && options.IfNoneMatchEtag == nil {
return nil
}
headers := make(map[string]string)
if options.IfMatchEtag != nil {
headers[headerIfMatch] = string(*options.IfMatchEtag)
}
if options.IfNoneMatchEtag != nil {
headers[headerIfNoneMatch] = string(*options.IfNoneMatchEtag)
}
return &headers
}
// CreateDatabaseOptions are options for the CreateDatabase operation
type CreateDatabaseOptions struct {
// ThroughputProperties: Optional throughput configuration of the database
ThroughputProperties *ThroughputProperties
}