1package hanaonazure
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"encoding/json"
22	"github.com/Azure/go-autorest/autorest"
23	"github.com/Azure/go-autorest/autorest/to"
24	"net/http"
25)
26
27// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
28// HanaHardwareTypeNamesEnum enumerates the values for hana hardware type names enum.
29type HanaHardwareTypeNamesEnum string
30
31const (
32	// CiscoUCS ...
33	CiscoUCS HanaHardwareTypeNamesEnum = "Cisco_UCS"
34)
35
36// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
37// PossibleHanaHardwareTypeNamesEnumValues returns an array of possible values for the HanaHardwareTypeNamesEnum const type.
38func PossibleHanaHardwareTypeNamesEnumValues() []HanaHardwareTypeNamesEnum {
39	return []HanaHardwareTypeNamesEnum{CiscoUCS}
40}
41
42// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
43// HanaInstanceSizeNamesEnum enumerates the values for hana instance size names enum.
44type HanaInstanceSizeNamesEnum string
45
46const (
47	// S144 ...
48	S144 HanaInstanceSizeNamesEnum = "S144"
49	// S144m ...
50	S144m HanaInstanceSizeNamesEnum = "S144m"
51	// S192 ...
52	S192 HanaInstanceSizeNamesEnum = "S192"
53	// S192m ...
54	S192m HanaInstanceSizeNamesEnum = "S192m"
55	// S72 ...
56	S72 HanaInstanceSizeNamesEnum = "S72"
57	// S72m ...
58	S72m HanaInstanceSizeNamesEnum = "S72m"
59)
60
61// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
62// PossibleHanaInstanceSizeNamesEnumValues returns an array of possible values for the HanaInstanceSizeNamesEnum const type.
63func PossibleHanaInstanceSizeNamesEnumValues() []HanaInstanceSizeNamesEnum {
64	return []HanaInstanceSizeNamesEnum{S144, S144m, S192, S192m, S72, S72m}
65}
66
67// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
68// Disk specifies the disk information fo the HANA instance
69type Disk struct {
70	// Name - The disk name.
71	Name *string `json:"name,omitempty"`
72	// DiskSizeGB - Specifies the size of an empty data disk in gigabytes.
73	DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
74	// Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
75	Lun *int32 `json:"lun,omitempty"`
76}
77
78// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
79// Display detailed HANA operation information
80type Display struct {
81	// Provider - The localized friendly form of the resource provider name. This form is also expected to include the publisher/company responsible. Use Title Casing. Begin with “Microsoft” for 1st party services.
82	Provider *string `json:"provider,omitempty"`
83	// Resource - The localized friendly form of the resource type related to this action/operation. This form should match the public documentation for the resource provider. Use Title Casing. For examples, refer to the “name” section.
84	Resource *string `json:"resource,omitempty"`
85	// Operation - The localized friendly name for the operation as shown to the user. This name should be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the entity/resource to which it applies.
86	Operation *string `json:"operation,omitempty"`
87	// Description - The localized friendly description for the operation as shown to the user. This description should be thorough, yet concise. It will be used in tool-tips and detailed views.
88	Description *string `json:"description,omitempty"`
89	// Origin - The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is 'user,system'
90	Origin *string `json:"origin,omitempty"`
91}
92
93// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
94// ErrorResponse describes the format of Error response.
95type ErrorResponse struct {
96	// Code - Error code
97	Code *string `json:"code,omitempty"`
98	// Message - Error message indicating why the operation failed.
99	Message *string `json:"message,omitempty"`
100}
101
102// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
103// HanaInstance HANA instance info on Azure (ARM properties and HANA properties)
104type HanaInstance struct {
105	autorest.Response `json:"-"`
106	// HanaInstanceProperties - HANA instance properties
107	*HanaInstanceProperties `json:"properties,omitempty"`
108	// ID - Resource ID
109	ID *string `json:"id,omitempty"`
110	// Name - Resource name
111	Name *string `json:"name,omitempty"`
112	// Type - Resource type
113	Type *string `json:"type,omitempty"`
114	// Location - Resource location
115	Location *string `json:"location,omitempty"`
116	// Tags - Resource tags
117	Tags map[string]*string `json:"tags"`
118}
119
120// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
121// MarshalJSON is the custom marshaler for HanaInstance.
122func (hi HanaInstance) MarshalJSON() ([]byte, error) {
123	objectMap := make(map[string]interface{})
124	if hi.HanaInstanceProperties != nil {
125		objectMap["properties"] = hi.HanaInstanceProperties
126	}
127	if hi.ID != nil {
128		objectMap["id"] = hi.ID
129	}
130	if hi.Name != nil {
131		objectMap["name"] = hi.Name
132	}
133	if hi.Type != nil {
134		objectMap["type"] = hi.Type
135	}
136	if hi.Location != nil {
137		objectMap["location"] = hi.Location
138	}
139	if hi.Tags != nil {
140		objectMap["tags"] = hi.Tags
141	}
142	return json.Marshal(objectMap)
143}
144
145// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
146// UnmarshalJSON is the custom unmarshaler for HanaInstance struct.
147func (hi *HanaInstance) UnmarshalJSON(body []byte) error {
148	var m map[string]*json.RawMessage
149	err := json.Unmarshal(body, &m)
150	if err != nil {
151		return err
152	}
153	for k, v := range m {
154		switch k {
155		case "properties":
156			if v != nil {
157				var hanaInstanceProperties HanaInstanceProperties
158				err = json.Unmarshal(*v, &hanaInstanceProperties)
159				if err != nil {
160					return err
161				}
162				hi.HanaInstanceProperties = &hanaInstanceProperties
163			}
164		case "id":
165			if v != nil {
166				var ID string
167				err = json.Unmarshal(*v, &ID)
168				if err != nil {
169					return err
170				}
171				hi.ID = &ID
172			}
173		case "name":
174			if v != nil {
175				var name string
176				err = json.Unmarshal(*v, &name)
177				if err != nil {
178					return err
179				}
180				hi.Name = &name
181			}
182		case "type":
183			if v != nil {
184				var typeVar string
185				err = json.Unmarshal(*v, &typeVar)
186				if err != nil {
187					return err
188				}
189				hi.Type = &typeVar
190			}
191		case "location":
192			if v != nil {
193				var location string
194				err = json.Unmarshal(*v, &location)
195				if err != nil {
196					return err
197				}
198				hi.Location = &location
199			}
200		case "tags":
201			if v != nil {
202				var tags map[string]*string
203				err = json.Unmarshal(*v, &tags)
204				if err != nil {
205					return err
206				}
207				hi.Tags = tags
208			}
209		}
210	}
211
212	return nil
213}
214
215// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
216// HanaInstanceProperties describes the properties of a HANA instance.
217type HanaInstanceProperties struct {
218	// HardwareProfile - Specifies the hardware settings for the HANA instance.
219	HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"`
220	// StorageProfile - Specifies the storage settings for the HANA instance disks.
221	StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
222	// OsProfile - Specifies the operating system settings for the HANA instance.
223	OsProfile *OSProfile `json:"osProfile,omitempty"`
224	// NetworkProfile - Specifies the network settings for the HANA instance.
225	NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"`
226	// HanaInstanceID - Specifies the HANA instance unique ID.
227	HanaInstanceID *string `json:"hanaInstanceId,omitempty"`
228}
229
230// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
231// HanaInstancesListResult the response from the List HANA Instances operation.
232type HanaInstancesListResult struct {
233	autorest.Response `json:"-"`
234	// Value - The list of SAP HANA on Azure instances.
235	Value *[]HanaInstance `json:"value,omitempty"`
236	// NextLink - The URL to get the next set of HANA instances.
237	NextLink *string `json:"nextLink,omitempty"`
238}
239
240// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
241// HanaInstancesListResultIterator provides access to a complete listing of HanaInstance values.
242type HanaInstancesListResultIterator struct {
243	i    int
244	page HanaInstancesListResultPage
245}
246
247// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
248// Next advances to the next value.  If there was an error making
249// the request the iterator does not advance and the error is returned.
250func (iter *HanaInstancesListResultIterator) Next() error {
251	iter.i++
252	if iter.i < len(iter.page.Values()) {
253		return nil
254	}
255	err := iter.page.Next()
256	if err != nil {
257		iter.i--
258		return err
259	}
260	iter.i = 0
261	return nil
262}
263
264// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
265// NotDone returns true if the enumeration should be started or is not yet complete.
266func (iter HanaInstancesListResultIterator) NotDone() bool {
267	return iter.page.NotDone() && iter.i < len(iter.page.Values())
268}
269
270// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
271// Response returns the raw server response from the last page request.
272func (iter HanaInstancesListResultIterator) Response() HanaInstancesListResult {
273	return iter.page.Response()
274}
275
276// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
277// Value returns the current value or a zero-initialized value if the
278// iterator has advanced beyond the end of the collection.
279func (iter HanaInstancesListResultIterator) Value() HanaInstance {
280	if !iter.page.NotDone() {
281		return HanaInstance{}
282	}
283	return iter.page.Values()[iter.i]
284}
285
286// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
287// IsEmpty returns true if the ListResult contains no values.
288func (hilr HanaInstancesListResult) IsEmpty() bool {
289	return hilr.Value == nil || len(*hilr.Value) == 0
290}
291
292// hanaInstancesListResultPreparer prepares a request to retrieve the next set of results.
293// It returns nil if no more results exist.
294func (hilr HanaInstancesListResult) hanaInstancesListResultPreparer() (*http.Request, error) {
295	if hilr.NextLink == nil || len(to.String(hilr.NextLink)) < 1 {
296		return nil, nil
297	}
298	return autorest.Prepare(&http.Request{},
299		autorest.AsJSON(),
300		autorest.AsGet(),
301		autorest.WithBaseURL(to.String(hilr.NextLink)))
302}
303
304// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
305// HanaInstancesListResultPage contains a page of HanaInstance values.
306type HanaInstancesListResultPage struct {
307	fn   func(HanaInstancesListResult) (HanaInstancesListResult, error)
308	hilr HanaInstancesListResult
309}
310
311// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
312// Next advances to the next page of values.  If there was an error making
313// the request the page does not advance and the error is returned.
314func (page *HanaInstancesListResultPage) Next() error {
315	next, err := page.fn(page.hilr)
316	if err != nil {
317		return err
318	}
319	page.hilr = next
320	return nil
321}
322
323// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
324// NotDone returns true if the page enumeration should be started or is not yet complete.
325func (page HanaInstancesListResultPage) NotDone() bool {
326	return !page.hilr.IsEmpty()
327}
328
329// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
330// Response returns the raw server response from the last page request.
331func (page HanaInstancesListResultPage) Response() HanaInstancesListResult {
332	return page.hilr
333}
334
335// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
336// Values returns the slice of values for the current page or nil if there are no values.
337func (page HanaInstancesListResultPage) Values() []HanaInstance {
338	if page.hilr.IsEmpty() {
339		return nil
340	}
341	return *page.hilr.Value
342}
343
344// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
345// HardwareProfile specifies the hardware settings for the HANA instance.
346type HardwareProfile struct {
347	// HardwareType - Name of the hardware type (vendor and/or thrie product name). Possible values include: 'CiscoUCS'
348	HardwareType HanaHardwareTypeNamesEnum `json:"hardwareType,omitempty"`
349	// HanaInstanceSize - Specifies the HANA instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m'
350	HanaInstanceSize HanaInstanceSizeNamesEnum `json:"hanaInstanceSize,omitempty"`
351}
352
353// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
354// IPAddress specifies the IP address of the network interaface.
355type IPAddress struct {
356	// IPAddress - Specifies the IP address of the network interface.
357	IPAddress *string `json:"ipAddress,omitempty"`
358}
359
360// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
361// NetworkProfile specifies the network settings for the HANA instance disks.
362type NetworkProfile struct {
363	// NetworkInterfaces - Specifies the network interfaces for the HANA instance.
364	NetworkInterfaces *[]IPAddress `json:"networkInterfaces,omitempty"`
365	// CircuitID - Specifies the circuit id for connecting to express route.
366	CircuitID *string `json:"circuitId,omitempty"`
367}
368
369// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
370// Operation HANA operation information
371type Operation struct {
372	// Name - The name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service.
373	Name *string `json:"name,omitempty"`
374	// Display - Displayed HANA operation information
375	Display *Display `json:"display,omitempty"`
376}
377
378// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
379// OperationList list of HANA operations
380type OperationList struct {
381	autorest.Response `json:"-"`
382	// Value - List of HANA operations
383	Value *[]Operation `json:"value,omitempty"`
384}
385
386// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
387// OSProfile specifies the operating system settings for the HANA instance.
388type OSProfile struct {
389	// ComputerName - Specifies the host OS name of the HANA instance.
390	ComputerName *string `json:"computerName,omitempty"`
391	// OsType - This property allows you to specify the type of the OS.
392	OsType *string `json:"osType,omitempty"`
393	// Version - Specifies version of operating system.
394	Version *string `json:"version,omitempty"`
395}
396
397// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
398// Resource the resource model definition.
399type Resource struct {
400	// ID - Resource ID
401	ID *string `json:"id,omitempty"`
402	// Name - Resource name
403	Name *string `json:"name,omitempty"`
404	// Type - Resource type
405	Type *string `json:"type,omitempty"`
406	// Location - Resource location
407	Location *string `json:"location,omitempty"`
408	// Tags - Resource tags
409	Tags map[string]*string `json:"tags"`
410}
411
412// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
413// MarshalJSON is the custom marshaler for Resource.
414func (r Resource) MarshalJSON() ([]byte, error) {
415	objectMap := make(map[string]interface{})
416	if r.ID != nil {
417		objectMap["id"] = r.ID
418	}
419	if r.Name != nil {
420		objectMap["name"] = r.Name
421	}
422	if r.Type != nil {
423		objectMap["type"] = r.Type
424	}
425	if r.Location != nil {
426		objectMap["location"] = r.Location
427	}
428	if r.Tags != nil {
429		objectMap["tags"] = r.Tags
430	}
431	return json.Marshal(objectMap)
432}
433
434// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure instead.
435// StorageProfile specifies the storage settings for the HANA instance disks.
436type StorageProfile struct {
437	// NfsIPAddress - IP Address to connect to storage.
438	NfsIPAddress *string `json:"nfsIpAddress,omitempty"`
439	// OsDisks - Specifies information about the operating system disk used by the hana instance.
440	OsDisks *[]Disk `json:"osDisks,omitempty"`
441}
442