forked from Azure/azure-sdk-for-go
/
models.go
205 lines (183 loc) · 7.73 KB
/
models.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
package search
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"encoding/json"
"github.com/Azure/go-autorest/autorest"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-02-28/search"
// AdminKeyResult response containing the primary and secondary API keys for a given Azure Search service.
type AdminKeyResult struct {
autorest.Response `json:"-"`
// PrimaryKey - READ-ONLY; The primary API key of the Search service.
PrimaryKey *string `json:"primaryKey,omitempty"`
// SecondaryKey - READ-ONLY; The secondary API key of the Search service.
SecondaryKey *string `json:"secondaryKey,omitempty"`
}
// MarshalJSON is the custom marshaler for AdminKeyResult.
func (akr AdminKeyResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ListQueryKeysResult response containing the query API keys for a given Azure Search service.
type ListQueryKeysResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The query keys for the Azure Search service.
Value *[]QueryKey `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for ListQueryKeysResult.
func (lqkr ListQueryKeysResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// QueryKey describes an API key for a given Azure Search service that has permissions for query operations
// only.
type QueryKey struct {
// Name - READ-ONLY; The name of the query API key; may be empty.
Name *string `json:"name,omitempty"`
// Key - READ-ONLY; The value of the query API key.
Key *string `json:"key,omitempty"`
}
// MarshalJSON is the custom marshaler for QueryKey.
func (qk QueryKey) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// Resource ...
type Resource struct {
// ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Location - Resource location
Location *string `json:"location,omitempty"`
// Tags - Resource tags
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if r.Location != nil {
objectMap["location"] = r.Location
}
if r.Tags != nil {
objectMap["tags"] = r.Tags
}
return json.Marshal(objectMap)
}
// ServiceCreateOrUpdateParameters properties that describe an Azure Search service.
type ServiceCreateOrUpdateParameters struct {
// Location - The geographic location of the Search service.
Location *string `json:"location,omitempty"`
// Tags - Tags to help categorize the Search service in the Azure Portal.
Tags map[string]*string `json:"tags"`
// Properties - Properties of the Search service.
Properties *ServiceProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for ServiceCreateOrUpdateParameters.
func (scoup ServiceCreateOrUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if scoup.Location != nil {
objectMap["location"] = scoup.Location
}
if scoup.Tags != nil {
objectMap["tags"] = scoup.Tags
}
if scoup.Properties != nil {
objectMap["properties"] = scoup.Properties
}
return json.Marshal(objectMap)
}
// ServiceListResult response containing a list of Azure Search services for a given resource group.
type ServiceListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The Search services in the resource group.
Value *[]ServiceResource `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for ServiceListResult.
func (slr ServiceListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ServiceProperties defines properties of an Azure Search service that can be modified.
type ServiceProperties struct {
// Sku - The SKU of the Search Service, which determines price tier and capacity limits.
Sku *Sku `json:"sku,omitempty"`
// ReplicaCount - The number of replicas in the Search service. If specified, it must be a value between 1 and 6 inclusive.
ReplicaCount *int32 `json:"replicaCount,omitempty"`
// PartitionCount - The number of partitions in the Search service; if specified, it can be 1, 2, 3, 4, 6, or 12.
PartitionCount *int32 `json:"partitionCount,omitempty"`
}
// ServiceReadableProperties defines all the properties of an Azure Search service.
type ServiceReadableProperties struct {
// Status - READ-ONLY; The status of the Search service. Possible values include: 'ServiceStatusRunning', 'ServiceStatusProvisioning', 'ServiceStatusDeleting', 'ServiceStatusDegraded', 'ServiceStatusDisabled', 'ServiceStatusError'
Status ServiceStatus `json:"status,omitempty"`
// StatusDetails - READ-ONLY; The details of the Search service status.
StatusDetails *string `json:"statusDetails,omitempty"`
// ProvisioningState - READ-ONLY; The state of the last provisioning operation performed on the Search service. Possible values include: 'Succeeded', 'Provisioning', 'Failed'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
// Sku - The SKU of the Search Service, which determines price tier and capacity limits.
Sku *Sku `json:"sku,omitempty"`
// ReplicaCount - The number of replicas in the Search service. If specified, it must be a value between 1 and 6 inclusive.
ReplicaCount *int32 `json:"replicaCount,omitempty"`
// PartitionCount - The number of partitions in the Search service; if specified, it can be 1, 2, 3, 4, 6, or 12.
PartitionCount *int32 `json:"partitionCount,omitempty"`
}
// MarshalJSON is the custom marshaler for ServiceReadableProperties.
func (srp ServiceReadableProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if srp.Sku != nil {
objectMap["sku"] = srp.Sku
}
if srp.ReplicaCount != nil {
objectMap["replicaCount"] = srp.ReplicaCount
}
if srp.PartitionCount != nil {
objectMap["partitionCount"] = srp.PartitionCount
}
return json.Marshal(objectMap)
}
// ServiceResource describes an Azure Search service and its current state.
type ServiceResource struct {
autorest.Response `json:"-"`
// ID - READ-ONLY; The resource Id of the Azure Search service.
ID *string `json:"id,omitempty"`
// Name - The name of the Search service.
Name *string `json:"name,omitempty"`
// Location - The geographic location of the Search service.
Location *string `json:"location,omitempty"`
// Tags - Tags to help categorize the Search service in the Azure Portal.
Tags map[string]*string `json:"tags"`
// Properties - READ-ONLY; Properties of the Search service.
Properties *ServiceReadableProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for ServiceResource.
func (sr ServiceResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if sr.Name != nil {
objectMap["name"] = sr.Name
}
if sr.Location != nil {
objectMap["location"] = sr.Location
}
if sr.Tags != nil {
objectMap["tags"] = sr.Tags
}
return json.Marshal(objectMap)
}
// Sku defines the SKU of an Azure Search Service, which determines price tier and capacity limits.
type Sku struct {
// Name - The SKU of the Search service. Possible values include: 'Free', 'Standard', 'Standard2'
Name SkuType `json:"name,omitempty"`
}
// SubResource ...
type SubResource struct {
// ID - Resource Id
ID *string `json:"id,omitempty"`
}