-
Notifications
You must be signed in to change notification settings - Fork 804
/
models.go
234 lines (208 loc) · 8.76 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
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
package search
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// 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"
// ProvisioningState enumerates the values for provisioning state.
type ProvisioningState string
const (
// Failed ...
Failed ProvisioningState = "failed"
// Provisioning ...
Provisioning ProvisioningState = "provisioning"
// Succeeded ...
Succeeded ProvisioningState = "succeeded"
)
// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
func PossibleProvisioningStateValues() []ProvisioningState {
return []ProvisioningState{Failed, Provisioning, Succeeded}
}
// ServiceStatus enumerates the values for service status.
type ServiceStatus string
const (
// ServiceStatusDegraded ...
ServiceStatusDegraded ServiceStatus = "degraded"
// ServiceStatusDeleting ...
ServiceStatusDeleting ServiceStatus = "deleting"
// ServiceStatusDisabled ...
ServiceStatusDisabled ServiceStatus = "disabled"
// ServiceStatusError ...
ServiceStatusError ServiceStatus = "error"
// ServiceStatusProvisioning ...
ServiceStatusProvisioning ServiceStatus = "provisioning"
// ServiceStatusRunning ...
ServiceStatusRunning ServiceStatus = "running"
)
// PossibleServiceStatusValues returns an array of possible values for the ServiceStatus const type.
func PossibleServiceStatusValues() []ServiceStatus {
return []ServiceStatus{ServiceStatusDegraded, ServiceStatusDeleting, ServiceStatusDisabled, ServiceStatusError, ServiceStatusProvisioning, ServiceStatusRunning}
}
// SkuType enumerates the values for sku type.
type SkuType string
const (
// Free ...
Free SkuType = "free"
// Standard ...
Standard SkuType = "standard"
// Standard2 ...
Standard2 SkuType = "standard2"
)
// PossibleSkuTypeValues returns an array of possible values for the SkuType const type.
func PossibleSkuTypeValues() []SkuType {
return []SkuType{Free, Standard, Standard2}
}
// 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"`
}
// 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"`
}
// 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"`
}
// 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"`
}
// 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"`
}
// 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"`
}