forked from Azure/aks-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resultPageClient.go
185 lines (158 loc) · 6.78 KB
/
resultPageClient.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
package azurestack
import (
"context"
"fmt"
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute"
azcompute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute"
)
//VirtualMachineListResultPageClient Virtual Machine List Result Page Client
type VirtualMachineListResultPageClient struct {
vmlrp compute.VirtualMachineListResultPage
err error
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *VirtualMachineListResultPageClient) NextWithContext(ctx context.Context) (err error) {
return page.vmlrp.NextWithContext(ctx)
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *VirtualMachineListResultPageClient) Next() error {
return page.vmlrp.Next()
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page VirtualMachineListResultPageClient) NotDone() bool {
return page.vmlrp.NotDone()
}
// Response returns the raw server response from the last page request.
func (page VirtualMachineListResultPageClient) Response() azcompute.VirtualMachineListResult {
r := azcompute.VirtualMachineListResult{}
err := DeepCopy(&r, page.vmlrp.Response())
if err != nil {
page.err = fmt.Errorf("fail to get virtual machine list result, %s", err)
}
return r
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page VirtualMachineListResultPageClient) Values() []azcompute.VirtualMachine {
r := []azcompute.VirtualMachine{}
err := DeepCopy(&r, page.vmlrp.Values())
if err != nil {
page.err = fmt.Errorf("fail to get virtual machine list, %s", err)
}
return r
}
// VirtualMachineScaleSetListResultPageClient Virtual Machine Scale Set List Result Page Client
type VirtualMachineScaleSetListResultPageClient struct {
vmsslrp compute.VirtualMachineScaleSetListResultPage
err error
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *VirtualMachineScaleSetListResultPageClient) NextWithContext(ctx context.Context) (err error) {
return page.vmsslrp.NextWithContext(ctx)
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *VirtualMachineScaleSetListResultPageClient) Next() error {
return page.vmsslrp.Next()
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page VirtualMachineScaleSetListResultPageClient) NotDone() bool {
return page.vmsslrp.NotDone()
}
// Response returns the raw server response from the last page request.
func (page VirtualMachineScaleSetListResultPageClient) Response() azcompute.VirtualMachineScaleSetListResult {
r := azcompute.VirtualMachineScaleSetListResult{}
err := DeepCopy(&r, page.vmsslrp.Response())
if err != nil {
page.err = fmt.Errorf("fail to get virtual machine scale set list result, %s", err)
}
return r
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page VirtualMachineScaleSetListResultPageClient) Values() []azcompute.VirtualMachineScaleSet {
r := []azcompute.VirtualMachineScaleSet{}
err := DeepCopy(&r, page.vmsslrp.Values())
if err != nil {
page.err = fmt.Errorf("fail to get virtual machine scale set list, %s", err)
}
return r
}
// VirtualMachineScaleSetVMListResultPageClient Virtual Machine Scale Set VM List Result Page Client
type VirtualMachineScaleSetVMListResultPageClient struct {
vmssvlrp compute.VirtualMachineScaleSetVMListResultPage
err error
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *VirtualMachineScaleSetVMListResultPageClient) NextWithContext(ctx context.Context) (err error) {
return page.vmssvlrp.NextWithContext(ctx)
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *VirtualMachineScaleSetVMListResultPageClient) Next() error {
return page.vmssvlrp.Next()
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page VirtualMachineScaleSetVMListResultPageClient) NotDone() bool {
return page.vmssvlrp.NotDone()
}
// Response returns the raw server response from the last page request.
func (page VirtualMachineScaleSetVMListResultPageClient) Response() azcompute.VirtualMachineScaleSetVMListResult {
r := azcompute.VirtualMachineScaleSetVMListResult{}
err := DeepCopy(&r, page.vmssvlrp.Response())
if err != nil {
page.err = fmt.Errorf("fail to get virtual machine scale set VM list result, %s", err)
}
return r
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page VirtualMachineScaleSetVMListResultPageClient) Values() []azcompute.VirtualMachineScaleSetVM {
r := []azcompute.VirtualMachineScaleSetVM{}
err := DeepCopy(&r, page.vmssvlrp.Values())
if err != nil {
page.err = fmt.Errorf("fail to get virtual machine scale set VM list, %s", err)
}
return r
}
// DiskListPageClient contains a page of Disk values.
type DiskListPageClient struct {
dlp compute.DiskListPage
err error
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *DiskListPageClient) NextWithContext(ctx context.Context) (err error) {
return page.dlp.NextWithContext(ctx)
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *DiskListPageClient) Next() error {
return page.dlp.Next()
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page DiskListPageClient) NotDone() bool {
return !page.dlp.NotDone()
}
// Response returns the raw server response from the last page request.
func (page DiskListPageClient) Response() azcompute.DiskList {
l := azcompute.DiskList{}
err := DeepCopy(&l, page.dlp.Response())
if err != nil {
page.err = fmt.Errorf("fail to get disk list result, %s", err)
}
return l
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page DiskListPageClient) Values() []azcompute.Disk {
l := []azcompute.Disk{}
err := DeepCopy(&l, page.dlp.Values())
if err != nil {
page.err = fmt.Errorf("fail to get disk list, %s", err)
}
return l
}