1 package account
2
3
4
5
6
7
8
9 import (
10 "context"
11 "encoding/json"
12 "github.com/Azure/go-autorest/autorest"
13 "github.com/Azure/go-autorest/autorest/azure"
14 "github.com/Azure/go-autorest/autorest/date"
15 "github.com/Azure/go-autorest/autorest/to"
16 "github.com/Azure/go-autorest/tracing"
17 "net/http"
18 )
19
20
21 const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/mgmt/2015-10-01-preview/account"
22
23
24 type AddDataLakeStoreParameters struct {
25
26 Properties *DataLakeStoreAccountInfoProperties `json:"properties,omitempty"`
27 }
28
29
30 type AddStorageAccountParameters struct {
31
32 Properties *StorageAccountProperties `json:"properties,omitempty"`
33 }
34
35
36
37
38
39
40
41 type AzureAsyncOperationResult struct {
42
43 Status OperationStatus `json:"status,omitempty"`
44
45 Error *Error `json:"error,omitempty"`
46 }
47
48
49 func (aaor AzureAsyncOperationResult) MarshalJSON() ([]byte, error) {
50 objectMap := make(map[string]interface{})
51 return json.Marshal(objectMap)
52 }
53
54
55 type BlobContainer struct {
56 autorest.Response `json:"-"`
57
58 Name *string `json:"name,omitempty"`
59
60 ID *string `json:"id,omitempty"`
61
62 Type *string `json:"type,omitempty"`
63
64 Properties *BlobContainerProperties `json:"properties,omitempty"`
65 }
66
67
68 func (bc BlobContainer) MarshalJSON() ([]byte, error) {
69 objectMap := make(map[string]interface{})
70 return json.Marshal(objectMap)
71 }
72
73
74 type BlobContainerProperties struct {
75
76 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
77 }
78
79
80 func (bcp BlobContainerProperties) MarshalJSON() ([]byte, error) {
81 objectMap := make(map[string]interface{})
82 return json.Marshal(objectMap)
83 }
84
85
86 type CreateFuture struct {
87 azure.FutureAPI
88
89
90 Result func(Client) (DataLakeAnalyticsAccount, error)
91 }
92
93
94 func (future *CreateFuture) UnmarshalJSON(body []byte) error {
95 var azFuture azure.Future
96 if err := json.Unmarshal(body, &azFuture); err != nil {
97 return err
98 }
99 future.FutureAPI = &azFuture
100 future.Result = future.result
101 return nil
102 }
103
104
105 func (future *CreateFuture) result(client Client) (dlaa DataLakeAnalyticsAccount, err error) {
106 var done bool
107 done, err = future.DoneWithContext(context.Background(), client)
108 if err != nil {
109 err = autorest.NewErrorWithError(err, "account.CreateFuture", "Result", future.Response(), "Polling failure")
110 return
111 }
112 if !done {
113 dlaa.Response.Response = future.Response()
114 err = azure.NewAsyncOpIncompleteError("account.CreateFuture")
115 return
116 }
117 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
118 if dlaa.Response.Response, err = future.GetResult(sender); err == nil && dlaa.Response.Response.StatusCode != http.StatusNoContent {
119 dlaa, err = client.CreateResponder(dlaa.Response.Response)
120 if err != nil {
121 err = autorest.NewErrorWithError(err, "account.CreateFuture", "Result", dlaa.Response.Response, "Failure responding to request")
122 }
123 }
124 return
125 }
126
127
128
129 type DataLakeAnalyticsAccount struct {
130 autorest.Response `json:"-"`
131
132 Location *string `json:"location,omitempty"`
133
134 Name *string `json:"name,omitempty"`
135
136 Type *string `json:"type,omitempty"`
137
138 ID *string `json:"id,omitempty"`
139
140 Tags map[string]*string `json:"tags"`
141
142 Properties *DataLakeAnalyticsAccountProperties `json:"properties,omitempty"`
143 }
144
145
146 func (dlaa DataLakeAnalyticsAccount) MarshalJSON() ([]byte, error) {
147 objectMap := make(map[string]interface{})
148 if dlaa.Location != nil {
149 objectMap["location"] = dlaa.Location
150 }
151 if dlaa.Name != nil {
152 objectMap["name"] = dlaa.Name
153 }
154 if dlaa.Tags != nil {
155 objectMap["tags"] = dlaa.Tags
156 }
157 if dlaa.Properties != nil {
158 objectMap["properties"] = dlaa.Properties
159 }
160 return json.Marshal(objectMap)
161 }
162
163
164 type DataLakeAnalyticsAccountListDataLakeStoreResult struct {
165 autorest.Response `json:"-"`
166
167 Value *[]DataLakeStoreAccountInfo `json:"value,omitempty"`
168
169 Count *int32 `json:"count,omitempty"`
170
171 NextLink *string `json:"nextLink,omitempty"`
172 }
173
174
175 func (dlaaldlsr DataLakeAnalyticsAccountListDataLakeStoreResult) MarshalJSON() ([]byte, error) {
176 objectMap := make(map[string]interface{})
177 return json.Marshal(objectMap)
178 }
179
180
181
182 type DataLakeAnalyticsAccountListDataLakeStoreResultIterator struct {
183 i int
184 page DataLakeAnalyticsAccountListDataLakeStoreResultPage
185 }
186
187
188
189 func (iter *DataLakeAnalyticsAccountListDataLakeStoreResultIterator) NextWithContext(ctx context.Context) (err error) {
190 if tracing.IsEnabled() {
191 ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListDataLakeStoreResultIterator.NextWithContext")
192 defer func() {
193 sc := -1
194 if iter.Response().Response.Response != nil {
195 sc = iter.Response().Response.Response.StatusCode
196 }
197 tracing.EndSpan(ctx, sc, err)
198 }()
199 }
200 iter.i++
201 if iter.i < len(iter.page.Values()) {
202 return nil
203 }
204 err = iter.page.NextWithContext(ctx)
205 if err != nil {
206 iter.i--
207 return err
208 }
209 iter.i = 0
210 return nil
211 }
212
213
214
215
216 func (iter *DataLakeAnalyticsAccountListDataLakeStoreResultIterator) Next() error {
217 return iter.NextWithContext(context.Background())
218 }
219
220
221 func (iter DataLakeAnalyticsAccountListDataLakeStoreResultIterator) NotDone() bool {
222 return iter.page.NotDone() && iter.i < len(iter.page.Values())
223 }
224
225
226 func (iter DataLakeAnalyticsAccountListDataLakeStoreResultIterator) Response() DataLakeAnalyticsAccountListDataLakeStoreResult {
227 return iter.page.Response()
228 }
229
230
231
232 func (iter DataLakeAnalyticsAccountListDataLakeStoreResultIterator) Value() DataLakeStoreAccountInfo {
233 if !iter.page.NotDone() {
234 return DataLakeStoreAccountInfo{}
235 }
236 return iter.page.Values()[iter.i]
237 }
238
239
240 func NewDataLakeAnalyticsAccountListDataLakeStoreResultIterator(page DataLakeAnalyticsAccountListDataLakeStoreResultPage) DataLakeAnalyticsAccountListDataLakeStoreResultIterator {
241 return DataLakeAnalyticsAccountListDataLakeStoreResultIterator{page: page}
242 }
243
244
245 func (dlaaldlsr DataLakeAnalyticsAccountListDataLakeStoreResult) IsEmpty() bool {
246 return dlaaldlsr.Value == nil || len(*dlaaldlsr.Value) == 0
247 }
248
249
250 func (dlaaldlsr DataLakeAnalyticsAccountListDataLakeStoreResult) hasNextLink() bool {
251 return dlaaldlsr.NextLink != nil && len(*dlaaldlsr.NextLink) != 0
252 }
253
254
255
256 func (dlaaldlsr DataLakeAnalyticsAccountListDataLakeStoreResult) dataLakeAnalyticsAccountListDataLakeStoreResultPreparer(ctx context.Context) (*http.Request, error) {
257 if !dlaaldlsr.hasNextLink() {
258 return nil, nil
259 }
260 return autorest.Prepare((&http.Request{}).WithContext(ctx),
261 autorest.AsJSON(),
262 autorest.AsGet(),
263 autorest.WithBaseURL(to.String(dlaaldlsr.NextLink)))
264 }
265
266
267 type DataLakeAnalyticsAccountListDataLakeStoreResultPage struct {
268 fn func(context.Context, DataLakeAnalyticsAccountListDataLakeStoreResult) (DataLakeAnalyticsAccountListDataLakeStoreResult, error)
269 dlaaldlsr DataLakeAnalyticsAccountListDataLakeStoreResult
270 }
271
272
273
274 func (page *DataLakeAnalyticsAccountListDataLakeStoreResultPage) NextWithContext(ctx context.Context) (err error) {
275 if tracing.IsEnabled() {
276 ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListDataLakeStoreResultPage.NextWithContext")
277 defer func() {
278 sc := -1
279 if page.Response().Response.Response != nil {
280 sc = page.Response().Response.Response.StatusCode
281 }
282 tracing.EndSpan(ctx, sc, err)
283 }()
284 }
285 for {
286 next, err := page.fn(ctx, page.dlaaldlsr)
287 if err != nil {
288 return err
289 }
290 page.dlaaldlsr = next
291 if !next.hasNextLink() || !next.IsEmpty() {
292 break
293 }
294 }
295 return nil
296 }
297
298
299
300
301 func (page *DataLakeAnalyticsAccountListDataLakeStoreResultPage) Next() error {
302 return page.NextWithContext(context.Background())
303 }
304
305
306 func (page DataLakeAnalyticsAccountListDataLakeStoreResultPage) NotDone() bool {
307 return !page.dlaaldlsr.IsEmpty()
308 }
309
310
311 func (page DataLakeAnalyticsAccountListDataLakeStoreResultPage) Response() DataLakeAnalyticsAccountListDataLakeStoreResult {
312 return page.dlaaldlsr
313 }
314
315
316 func (page DataLakeAnalyticsAccountListDataLakeStoreResultPage) Values() []DataLakeStoreAccountInfo {
317 if page.dlaaldlsr.IsEmpty() {
318 return nil
319 }
320 return *page.dlaaldlsr.Value
321 }
322
323
324 func NewDataLakeAnalyticsAccountListDataLakeStoreResultPage(cur DataLakeAnalyticsAccountListDataLakeStoreResult, getNextPage func(context.Context, DataLakeAnalyticsAccountListDataLakeStoreResult) (DataLakeAnalyticsAccountListDataLakeStoreResult, error)) DataLakeAnalyticsAccountListDataLakeStoreResultPage {
325 return DataLakeAnalyticsAccountListDataLakeStoreResultPage{
326 fn: getNextPage,
327 dlaaldlsr: cur,
328 }
329 }
330
331
332 type DataLakeAnalyticsAccountListResult struct {
333 autorest.Response `json:"-"`
334
335 Value *[]DataLakeAnalyticsAccount `json:"value,omitempty"`
336
337 NextLink *string `json:"nextLink,omitempty"`
338 }
339
340
341 func (dlaalr DataLakeAnalyticsAccountListResult) MarshalJSON() ([]byte, error) {
342 objectMap := make(map[string]interface{})
343 return json.Marshal(objectMap)
344 }
345
346
347
348 type DataLakeAnalyticsAccountListResultIterator struct {
349 i int
350 page DataLakeAnalyticsAccountListResultPage
351 }
352
353
354
355 func (iter *DataLakeAnalyticsAccountListResultIterator) NextWithContext(ctx context.Context) (err error) {
356 if tracing.IsEnabled() {
357 ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListResultIterator.NextWithContext")
358 defer func() {
359 sc := -1
360 if iter.Response().Response.Response != nil {
361 sc = iter.Response().Response.Response.StatusCode
362 }
363 tracing.EndSpan(ctx, sc, err)
364 }()
365 }
366 iter.i++
367 if iter.i < len(iter.page.Values()) {
368 return nil
369 }
370 err = iter.page.NextWithContext(ctx)
371 if err != nil {
372 iter.i--
373 return err
374 }
375 iter.i = 0
376 return nil
377 }
378
379
380
381
382 func (iter *DataLakeAnalyticsAccountListResultIterator) Next() error {
383 return iter.NextWithContext(context.Background())
384 }
385
386
387 func (iter DataLakeAnalyticsAccountListResultIterator) NotDone() bool {
388 return iter.page.NotDone() && iter.i < len(iter.page.Values())
389 }
390
391
392 func (iter DataLakeAnalyticsAccountListResultIterator) Response() DataLakeAnalyticsAccountListResult {
393 return iter.page.Response()
394 }
395
396
397
398 func (iter DataLakeAnalyticsAccountListResultIterator) Value() DataLakeAnalyticsAccount {
399 if !iter.page.NotDone() {
400 return DataLakeAnalyticsAccount{}
401 }
402 return iter.page.Values()[iter.i]
403 }
404
405
406 func NewDataLakeAnalyticsAccountListResultIterator(page DataLakeAnalyticsAccountListResultPage) DataLakeAnalyticsAccountListResultIterator {
407 return DataLakeAnalyticsAccountListResultIterator{page: page}
408 }
409
410
411 func (dlaalr DataLakeAnalyticsAccountListResult) IsEmpty() bool {
412 return dlaalr.Value == nil || len(*dlaalr.Value) == 0
413 }
414
415
416 func (dlaalr DataLakeAnalyticsAccountListResult) hasNextLink() bool {
417 return dlaalr.NextLink != nil && len(*dlaalr.NextLink) != 0
418 }
419
420
421
422 func (dlaalr DataLakeAnalyticsAccountListResult) dataLakeAnalyticsAccountListResultPreparer(ctx context.Context) (*http.Request, error) {
423 if !dlaalr.hasNextLink() {
424 return nil, nil
425 }
426 return autorest.Prepare((&http.Request{}).WithContext(ctx),
427 autorest.AsJSON(),
428 autorest.AsGet(),
429 autorest.WithBaseURL(to.String(dlaalr.NextLink)))
430 }
431
432
433 type DataLakeAnalyticsAccountListResultPage struct {
434 fn func(context.Context, DataLakeAnalyticsAccountListResult) (DataLakeAnalyticsAccountListResult, error)
435 dlaalr DataLakeAnalyticsAccountListResult
436 }
437
438
439
440 func (page *DataLakeAnalyticsAccountListResultPage) NextWithContext(ctx context.Context) (err error) {
441 if tracing.IsEnabled() {
442 ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListResultPage.NextWithContext")
443 defer func() {
444 sc := -1
445 if page.Response().Response.Response != nil {
446 sc = page.Response().Response.Response.StatusCode
447 }
448 tracing.EndSpan(ctx, sc, err)
449 }()
450 }
451 for {
452 next, err := page.fn(ctx, page.dlaalr)
453 if err != nil {
454 return err
455 }
456 page.dlaalr = next
457 if !next.hasNextLink() || !next.IsEmpty() {
458 break
459 }
460 }
461 return nil
462 }
463
464
465
466
467 func (page *DataLakeAnalyticsAccountListResultPage) Next() error {
468 return page.NextWithContext(context.Background())
469 }
470
471
472 func (page DataLakeAnalyticsAccountListResultPage) NotDone() bool {
473 return !page.dlaalr.IsEmpty()
474 }
475
476
477 func (page DataLakeAnalyticsAccountListResultPage) Response() DataLakeAnalyticsAccountListResult {
478 return page.dlaalr
479 }
480
481
482 func (page DataLakeAnalyticsAccountListResultPage) Values() []DataLakeAnalyticsAccount {
483 if page.dlaalr.IsEmpty() {
484 return nil
485 }
486 return *page.dlaalr.Value
487 }
488
489
490 func NewDataLakeAnalyticsAccountListResultPage(cur DataLakeAnalyticsAccountListResult, getNextPage func(context.Context, DataLakeAnalyticsAccountListResult) (DataLakeAnalyticsAccountListResult, error)) DataLakeAnalyticsAccountListResultPage {
491 return DataLakeAnalyticsAccountListResultPage{
492 fn: getNextPage,
493 dlaalr: cur,
494 }
495 }
496
497
498 type DataLakeAnalyticsAccountListStorageAccountsResult struct {
499 autorest.Response `json:"-"`
500
501 Value *[]StorageAccountInfo `json:"value,omitempty"`
502
503 Count *int32 `json:"count,omitempty"`
504
505 NextLink *string `json:"nextLink,omitempty"`
506 }
507
508
509 func (dlaalsar DataLakeAnalyticsAccountListStorageAccountsResult) MarshalJSON() ([]byte, error) {
510 objectMap := make(map[string]interface{})
511 return json.Marshal(objectMap)
512 }
513
514
515
516 type DataLakeAnalyticsAccountListStorageAccountsResultIterator struct {
517 i int
518 page DataLakeAnalyticsAccountListStorageAccountsResultPage
519 }
520
521
522
523 func (iter *DataLakeAnalyticsAccountListStorageAccountsResultIterator) NextWithContext(ctx context.Context) (err error) {
524 if tracing.IsEnabled() {
525 ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListStorageAccountsResultIterator.NextWithContext")
526 defer func() {
527 sc := -1
528 if iter.Response().Response.Response != nil {
529 sc = iter.Response().Response.Response.StatusCode
530 }
531 tracing.EndSpan(ctx, sc, err)
532 }()
533 }
534 iter.i++
535 if iter.i < len(iter.page.Values()) {
536 return nil
537 }
538 err = iter.page.NextWithContext(ctx)
539 if err != nil {
540 iter.i--
541 return err
542 }
543 iter.i = 0
544 return nil
545 }
546
547
548
549
550 func (iter *DataLakeAnalyticsAccountListStorageAccountsResultIterator) Next() error {
551 return iter.NextWithContext(context.Background())
552 }
553
554
555 func (iter DataLakeAnalyticsAccountListStorageAccountsResultIterator) NotDone() bool {
556 return iter.page.NotDone() && iter.i < len(iter.page.Values())
557 }
558
559
560 func (iter DataLakeAnalyticsAccountListStorageAccountsResultIterator) Response() DataLakeAnalyticsAccountListStorageAccountsResult {
561 return iter.page.Response()
562 }
563
564
565
566 func (iter DataLakeAnalyticsAccountListStorageAccountsResultIterator) Value() StorageAccountInfo {
567 if !iter.page.NotDone() {
568 return StorageAccountInfo{}
569 }
570 return iter.page.Values()[iter.i]
571 }
572
573
574 func NewDataLakeAnalyticsAccountListStorageAccountsResultIterator(page DataLakeAnalyticsAccountListStorageAccountsResultPage) DataLakeAnalyticsAccountListStorageAccountsResultIterator {
575 return DataLakeAnalyticsAccountListStorageAccountsResultIterator{page: page}
576 }
577
578
579 func (dlaalsar DataLakeAnalyticsAccountListStorageAccountsResult) IsEmpty() bool {
580 return dlaalsar.Value == nil || len(*dlaalsar.Value) == 0
581 }
582
583
584 func (dlaalsar DataLakeAnalyticsAccountListStorageAccountsResult) hasNextLink() bool {
585 return dlaalsar.NextLink != nil && len(*dlaalsar.NextLink) != 0
586 }
587
588
589
590 func (dlaalsar DataLakeAnalyticsAccountListStorageAccountsResult) dataLakeAnalyticsAccountListStorageAccountsResultPreparer(ctx context.Context) (*http.Request, error) {
591 if !dlaalsar.hasNextLink() {
592 return nil, nil
593 }
594 return autorest.Prepare((&http.Request{}).WithContext(ctx),
595 autorest.AsJSON(),
596 autorest.AsGet(),
597 autorest.WithBaseURL(to.String(dlaalsar.NextLink)))
598 }
599
600
601 type DataLakeAnalyticsAccountListStorageAccountsResultPage struct {
602 fn func(context.Context, DataLakeAnalyticsAccountListStorageAccountsResult) (DataLakeAnalyticsAccountListStorageAccountsResult, error)
603 dlaalsar DataLakeAnalyticsAccountListStorageAccountsResult
604 }
605
606
607
608 func (page *DataLakeAnalyticsAccountListStorageAccountsResultPage) NextWithContext(ctx context.Context) (err error) {
609 if tracing.IsEnabled() {
610 ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListStorageAccountsResultPage.NextWithContext")
611 defer func() {
612 sc := -1
613 if page.Response().Response.Response != nil {
614 sc = page.Response().Response.Response.StatusCode
615 }
616 tracing.EndSpan(ctx, sc, err)
617 }()
618 }
619 for {
620 next, err := page.fn(ctx, page.dlaalsar)
621 if err != nil {
622 return err
623 }
624 page.dlaalsar = next
625 if !next.hasNextLink() || !next.IsEmpty() {
626 break
627 }
628 }
629 return nil
630 }
631
632
633
634
635 func (page *DataLakeAnalyticsAccountListStorageAccountsResultPage) Next() error {
636 return page.NextWithContext(context.Background())
637 }
638
639
640 func (page DataLakeAnalyticsAccountListStorageAccountsResultPage) NotDone() bool {
641 return !page.dlaalsar.IsEmpty()
642 }
643
644
645 func (page DataLakeAnalyticsAccountListStorageAccountsResultPage) Response() DataLakeAnalyticsAccountListStorageAccountsResult {
646 return page.dlaalsar
647 }
648
649
650 func (page DataLakeAnalyticsAccountListStorageAccountsResultPage) Values() []StorageAccountInfo {
651 if page.dlaalsar.IsEmpty() {
652 return nil
653 }
654 return *page.dlaalsar.Value
655 }
656
657
658 func NewDataLakeAnalyticsAccountListStorageAccountsResultPage(cur DataLakeAnalyticsAccountListStorageAccountsResult, getNextPage func(context.Context, DataLakeAnalyticsAccountListStorageAccountsResult) (DataLakeAnalyticsAccountListStorageAccountsResult, error)) DataLakeAnalyticsAccountListStorageAccountsResultPage {
659 return DataLakeAnalyticsAccountListStorageAccountsResultPage{
660 fn: getNextPage,
661 dlaalsar: cur,
662 }
663 }
664
665
666
667 type DataLakeAnalyticsAccountProperties struct {
668
669 ProvisioningState DataLakeAnalyticsAccountStatus `json:"provisioningState,omitempty"`
670
671 State DataLakeAnalyticsAccountState `json:"state,omitempty"`
672
673 DefaultDataLakeStoreAccount *string `json:"defaultDataLakeStoreAccount,omitempty"`
674
675 MaxDegreeOfParallelism *int32 `json:"maxDegreeOfParallelism,omitempty"`
676
677 MaxJobCount *int32 `json:"maxJobCount,omitempty"`
678
679 DataLakeStoreAccounts *[]DataLakeStoreAccountInfo `json:"dataLakeStoreAccounts,omitempty"`
680
681 StorageAccounts *[]StorageAccountInfo `json:"storageAccounts,omitempty"`
682
683 CreationTime *date.Time `json:"creationTime,omitempty"`
684
685 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
686
687 Endpoint *string `json:"endpoint,omitempty"`
688 }
689
690
691 func (dlaap DataLakeAnalyticsAccountProperties) MarshalJSON() ([]byte, error) {
692 objectMap := make(map[string]interface{})
693 if dlaap.DefaultDataLakeStoreAccount != nil {
694 objectMap["defaultDataLakeStoreAccount"] = dlaap.DefaultDataLakeStoreAccount
695 }
696 if dlaap.MaxDegreeOfParallelism != nil {
697 objectMap["maxDegreeOfParallelism"] = dlaap.MaxDegreeOfParallelism
698 }
699 if dlaap.MaxJobCount != nil {
700 objectMap["maxJobCount"] = dlaap.MaxJobCount
701 }
702 if dlaap.DataLakeStoreAccounts != nil {
703 objectMap["dataLakeStoreAccounts"] = dlaap.DataLakeStoreAccounts
704 }
705 if dlaap.StorageAccounts != nil {
706 objectMap["storageAccounts"] = dlaap.StorageAccounts
707 }
708 return json.Marshal(objectMap)
709 }
710
711
712 type DataLakeStoreAccountInfo struct {
713 autorest.Response `json:"-"`
714
715 Name *string `json:"name,omitempty"`
716
717 Properties *DataLakeStoreAccountInfoProperties `json:"properties,omitempty"`
718 }
719
720
721 type DataLakeStoreAccountInfoProperties struct {
722
723 Suffix *string `json:"suffix,omitempty"`
724 }
725
726
727 type DeleteFuture struct {
728 azure.FutureAPI
729
730
731 Result func(Client) (autorest.Response, error)
732 }
733
734
735 func (future *DeleteFuture) UnmarshalJSON(body []byte) error {
736 var azFuture azure.Future
737 if err := json.Unmarshal(body, &azFuture); err != nil {
738 return err
739 }
740 future.FutureAPI = &azFuture
741 future.Result = future.result
742 return nil
743 }
744
745
746 func (future *DeleteFuture) result(client Client) (ar autorest.Response, err error) {
747 var done bool
748 done, err = future.DoneWithContext(context.Background(), client)
749 if err != nil {
750 err = autorest.NewErrorWithError(err, "account.DeleteFuture", "Result", future.Response(), "Polling failure")
751 return
752 }
753 if !done {
754 ar.Response = future.Response()
755 err = azure.NewAsyncOpIncompleteError("account.DeleteFuture")
756 return
757 }
758 ar.Response = future.Response()
759 return
760 }
761
762
763 type Error struct {
764
765 Code *string `json:"code,omitempty"`
766
767 Message *string `json:"message,omitempty"`
768
769 Target *string `json:"target,omitempty"`
770
771 Details *[]ErrorDetails `json:"details,omitempty"`
772
773 InnerError *InnerError `json:"innerError,omitempty"`
774 }
775
776
777 func (e Error) MarshalJSON() ([]byte, error) {
778 objectMap := make(map[string]interface{})
779 return json.Marshal(objectMap)
780 }
781
782
783 type ErrorDetails struct {
784
785 Code *string `json:"code,omitempty"`
786
787 Message *string `json:"message,omitempty"`
788
789 Target *string `json:"target,omitempty"`
790 }
791
792
793 func (ed ErrorDetails) MarshalJSON() ([]byte, error) {
794 objectMap := make(map[string]interface{})
795 return json.Marshal(objectMap)
796 }
797
798
799 type InnerError struct {
800
801 Trace *string `json:"trace,omitempty"`
802
803 Context *string `json:"context,omitempty"`
804 }
805
806
807 func (ie InnerError) MarshalJSON() ([]byte, error) {
808 objectMap := make(map[string]interface{})
809 return json.Marshal(objectMap)
810 }
811
812
813
814 type ListBlobContainersResult struct {
815 autorest.Response `json:"-"`
816
817 Value *[]BlobContainer `json:"value,omitempty"`
818
819 NextLink *string `json:"nextLink,omitempty"`
820 }
821
822
823 func (lbcr ListBlobContainersResult) MarshalJSON() ([]byte, error) {
824 objectMap := make(map[string]interface{})
825 return json.Marshal(objectMap)
826 }
827
828
829 type ListBlobContainersResultIterator struct {
830 i int
831 page ListBlobContainersResultPage
832 }
833
834
835
836 func (iter *ListBlobContainersResultIterator) NextWithContext(ctx context.Context) (err error) {
837 if tracing.IsEnabled() {
838 ctx = tracing.StartSpan(ctx, fqdn+"/ListBlobContainersResultIterator.NextWithContext")
839 defer func() {
840 sc := -1
841 if iter.Response().Response.Response != nil {
842 sc = iter.Response().Response.Response.StatusCode
843 }
844 tracing.EndSpan(ctx, sc, err)
845 }()
846 }
847 iter.i++
848 if iter.i < len(iter.page.Values()) {
849 return nil
850 }
851 err = iter.page.NextWithContext(ctx)
852 if err != nil {
853 iter.i--
854 return err
855 }
856 iter.i = 0
857 return nil
858 }
859
860
861
862
863 func (iter *ListBlobContainersResultIterator) Next() error {
864 return iter.NextWithContext(context.Background())
865 }
866
867
868 func (iter ListBlobContainersResultIterator) NotDone() bool {
869 return iter.page.NotDone() && iter.i < len(iter.page.Values())
870 }
871
872
873 func (iter ListBlobContainersResultIterator) Response() ListBlobContainersResult {
874 return iter.page.Response()
875 }
876
877
878
879 func (iter ListBlobContainersResultIterator) Value() BlobContainer {
880 if !iter.page.NotDone() {
881 return BlobContainer{}
882 }
883 return iter.page.Values()[iter.i]
884 }
885
886
887 func NewListBlobContainersResultIterator(page ListBlobContainersResultPage) ListBlobContainersResultIterator {
888 return ListBlobContainersResultIterator{page: page}
889 }
890
891
892 func (lbcr ListBlobContainersResult) IsEmpty() bool {
893 return lbcr.Value == nil || len(*lbcr.Value) == 0
894 }
895
896
897 func (lbcr ListBlobContainersResult) hasNextLink() bool {
898 return lbcr.NextLink != nil && len(*lbcr.NextLink) != 0
899 }
900
901
902
903 func (lbcr ListBlobContainersResult) listBlobContainersResultPreparer(ctx context.Context) (*http.Request, error) {
904 if !lbcr.hasNextLink() {
905 return nil, nil
906 }
907 return autorest.Prepare((&http.Request{}).WithContext(ctx),
908 autorest.AsJSON(),
909 autorest.AsGet(),
910 autorest.WithBaseURL(to.String(lbcr.NextLink)))
911 }
912
913
914 type ListBlobContainersResultPage struct {
915 fn func(context.Context, ListBlobContainersResult) (ListBlobContainersResult, error)
916 lbcr ListBlobContainersResult
917 }
918
919
920
921 func (page *ListBlobContainersResultPage) NextWithContext(ctx context.Context) (err error) {
922 if tracing.IsEnabled() {
923 ctx = tracing.StartSpan(ctx, fqdn+"/ListBlobContainersResultPage.NextWithContext")
924 defer func() {
925 sc := -1
926 if page.Response().Response.Response != nil {
927 sc = page.Response().Response.Response.StatusCode
928 }
929 tracing.EndSpan(ctx, sc, err)
930 }()
931 }
932 for {
933 next, err := page.fn(ctx, page.lbcr)
934 if err != nil {
935 return err
936 }
937 page.lbcr = next
938 if !next.hasNextLink() || !next.IsEmpty() {
939 break
940 }
941 }
942 return nil
943 }
944
945
946
947
948 func (page *ListBlobContainersResultPage) Next() error {
949 return page.NextWithContext(context.Background())
950 }
951
952
953 func (page ListBlobContainersResultPage) NotDone() bool {
954 return !page.lbcr.IsEmpty()
955 }
956
957
958 func (page ListBlobContainersResultPage) Response() ListBlobContainersResult {
959 return page.lbcr
960 }
961
962
963 func (page ListBlobContainersResultPage) Values() []BlobContainer {
964 if page.lbcr.IsEmpty() {
965 return nil
966 }
967 return *page.lbcr.Value
968 }
969
970
971 func NewListBlobContainersResultPage(cur ListBlobContainersResult, getNextPage func(context.Context, ListBlobContainersResult) (ListBlobContainersResult, error)) ListBlobContainersResultPage {
972 return ListBlobContainersResultPage{
973 fn: getNextPage,
974 lbcr: cur,
975 }
976 }
977
978
979
980 type ListSasTokensResult struct {
981 autorest.Response `json:"-"`
982
983 Value *[]SasTokenInfo `json:"value,omitempty"`
984
985 NextLink *string `json:"nextLink,omitempty"`
986 }
987
988
989 func (lstr ListSasTokensResult) MarshalJSON() ([]byte, error) {
990 objectMap := make(map[string]interface{})
991 return json.Marshal(objectMap)
992 }
993
994
995 type ListSasTokensResultIterator struct {
996 i int
997 page ListSasTokensResultPage
998 }
999
1000
1001
1002 func (iter *ListSasTokensResultIterator) NextWithContext(ctx context.Context) (err error) {
1003 if tracing.IsEnabled() {
1004 ctx = tracing.StartSpan(ctx, fqdn+"/ListSasTokensResultIterator.NextWithContext")
1005 defer func() {
1006 sc := -1
1007 if iter.Response().Response.Response != nil {
1008 sc = iter.Response().Response.Response.StatusCode
1009 }
1010 tracing.EndSpan(ctx, sc, err)
1011 }()
1012 }
1013 iter.i++
1014 if iter.i < len(iter.page.Values()) {
1015 return nil
1016 }
1017 err = iter.page.NextWithContext(ctx)
1018 if err != nil {
1019 iter.i--
1020 return err
1021 }
1022 iter.i = 0
1023 return nil
1024 }
1025
1026
1027
1028
1029 func (iter *ListSasTokensResultIterator) Next() error {
1030 return iter.NextWithContext(context.Background())
1031 }
1032
1033
1034 func (iter ListSasTokensResultIterator) NotDone() bool {
1035 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1036 }
1037
1038
1039 func (iter ListSasTokensResultIterator) Response() ListSasTokensResult {
1040 return iter.page.Response()
1041 }
1042
1043
1044
1045 func (iter ListSasTokensResultIterator) Value() SasTokenInfo {
1046 if !iter.page.NotDone() {
1047 return SasTokenInfo{}
1048 }
1049 return iter.page.Values()[iter.i]
1050 }
1051
1052
1053 func NewListSasTokensResultIterator(page ListSasTokensResultPage) ListSasTokensResultIterator {
1054 return ListSasTokensResultIterator{page: page}
1055 }
1056
1057
1058 func (lstr ListSasTokensResult) IsEmpty() bool {
1059 return lstr.Value == nil || len(*lstr.Value) == 0
1060 }
1061
1062
1063 func (lstr ListSasTokensResult) hasNextLink() bool {
1064 return lstr.NextLink != nil && len(*lstr.NextLink) != 0
1065 }
1066
1067
1068
1069 func (lstr ListSasTokensResult) listSasTokensResultPreparer(ctx context.Context) (*http.Request, error) {
1070 if !lstr.hasNextLink() {
1071 return nil, nil
1072 }
1073 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1074 autorest.AsJSON(),
1075 autorest.AsGet(),
1076 autorest.WithBaseURL(to.String(lstr.NextLink)))
1077 }
1078
1079
1080 type ListSasTokensResultPage struct {
1081 fn func(context.Context, ListSasTokensResult) (ListSasTokensResult, error)
1082 lstr ListSasTokensResult
1083 }
1084
1085
1086
1087 func (page *ListSasTokensResultPage) NextWithContext(ctx context.Context) (err error) {
1088 if tracing.IsEnabled() {
1089 ctx = tracing.StartSpan(ctx, fqdn+"/ListSasTokensResultPage.NextWithContext")
1090 defer func() {
1091 sc := -1
1092 if page.Response().Response.Response != nil {
1093 sc = page.Response().Response.Response.StatusCode
1094 }
1095 tracing.EndSpan(ctx, sc, err)
1096 }()
1097 }
1098 for {
1099 next, err := page.fn(ctx, page.lstr)
1100 if err != nil {
1101 return err
1102 }
1103 page.lstr = next
1104 if !next.hasNextLink() || !next.IsEmpty() {
1105 break
1106 }
1107 }
1108 return nil
1109 }
1110
1111
1112
1113
1114 func (page *ListSasTokensResultPage) Next() error {
1115 return page.NextWithContext(context.Background())
1116 }
1117
1118
1119 func (page ListSasTokensResultPage) NotDone() bool {
1120 return !page.lstr.IsEmpty()
1121 }
1122
1123
1124 func (page ListSasTokensResultPage) Response() ListSasTokensResult {
1125 return page.lstr
1126 }
1127
1128
1129 func (page ListSasTokensResultPage) Values() []SasTokenInfo {
1130 if page.lstr.IsEmpty() {
1131 return nil
1132 }
1133 return *page.lstr.Value
1134 }
1135
1136
1137 func NewListSasTokensResultPage(cur ListSasTokensResult, getNextPage func(context.Context, ListSasTokensResult) (ListSasTokensResult, error)) ListSasTokensResultPage {
1138 return ListSasTokensResultPage{
1139 fn: getNextPage,
1140 lstr: cur,
1141 }
1142 }
1143
1144
1145 type SasTokenInfo struct {
1146
1147 AccessToken *string `json:"accessToken,omitempty"`
1148 }
1149
1150
1151 func (sti SasTokenInfo) MarshalJSON() ([]byte, error) {
1152 objectMap := make(map[string]interface{})
1153 return json.Marshal(objectMap)
1154 }
1155
1156
1157 type StorageAccountInfo struct {
1158 autorest.Response `json:"-"`
1159
1160 Name *string `json:"name,omitempty"`
1161
1162 Properties *StorageAccountProperties `json:"properties,omitempty"`
1163 }
1164
1165
1166 type StorageAccountProperties struct {
1167
1168 AccessKey *string `json:"accessKey,omitempty"`
1169
1170 Suffix *string `json:"suffix,omitempty"`
1171 }
1172
1173
1174 type UpdateFuture struct {
1175 azure.FutureAPI
1176
1177
1178 Result func(Client) (DataLakeAnalyticsAccount, error)
1179 }
1180
1181
1182 func (future *UpdateFuture) UnmarshalJSON(body []byte) error {
1183 var azFuture azure.Future
1184 if err := json.Unmarshal(body, &azFuture); err != nil {
1185 return err
1186 }
1187 future.FutureAPI = &azFuture
1188 future.Result = future.result
1189 return nil
1190 }
1191
1192
1193 func (future *UpdateFuture) result(client Client) (dlaa DataLakeAnalyticsAccount, err error) {
1194 var done bool
1195 done, err = future.DoneWithContext(context.Background(), client)
1196 if err != nil {
1197 err = autorest.NewErrorWithError(err, "account.UpdateFuture", "Result", future.Response(), "Polling failure")
1198 return
1199 }
1200 if !done {
1201 dlaa.Response.Response = future.Response()
1202 err = azure.NewAsyncOpIncompleteError("account.UpdateFuture")
1203 return
1204 }
1205 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1206 if dlaa.Response.Response, err = future.GetResult(sender); err == nil && dlaa.Response.Response.StatusCode != http.StatusNoContent {
1207 dlaa, err = client.UpdateResponder(dlaa.Response.Response)
1208 if err != nil {
1209 err = autorest.NewErrorWithError(err, "account.UpdateFuture", "Result", dlaa.Response.Response, "Failure responding to request")
1210 }
1211 }
1212 return
1213 }
1214
View as plain text