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 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
|
package account
// 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 (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/mgmt/2015-10-01-preview/account"
// AddDataLakeStoreParameters additional Data Lake Store parameters.
type AddDataLakeStoreParameters struct {
// Properties - the properties for the Data Lake Store account being added.
Properties *DataLakeStoreAccountInfoProperties `json:"properties,omitempty"`
}
// AddStorageAccountParameters additional Azure Storage account parameters.
type AddStorageAccountParameters struct {
// Properties - the properties for the Azure Storage account being added.
Properties *StorageAccountProperties `json:"properties,omitempty"`
}
// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation,
// indicating whether it has succeeded, is inprogress, or has failed. Note that this status is distinct
// from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous
// operation succeeded, the response body includes the HTTP status code for the successful request. If the
// asynchronous operation failed, the response body includes the HTTP status code for the failed request
// and error information regarding the failure.
type AzureAsyncOperationResult struct {
// Status - READ-ONLY; the status of the AzureAsyncOperation. Possible values include: 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusFailed'
Status OperationStatus `json:"status,omitempty"`
// Error - READ-ONLY
Error *Error `json:"error,omitempty"`
}
// MarshalJSON is the custom marshaler for AzureAsyncOperationResult.
func (aaor AzureAsyncOperationResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// BlobContainer azure Storage blob container information.
type BlobContainer struct {
autorest.Response `json:"-"`
// Name - READ-ONLY; the name of the blob container.
Name *string `json:"name,omitempty"`
// ID - READ-ONLY; the unique identifier of the blob container.
ID *string `json:"id,omitempty"`
// Type - READ-ONLY; the type of the blob container.
Type *string `json:"type,omitempty"`
// Properties - READ-ONLY; the properties of the blob container.
Properties *BlobContainerProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for BlobContainer.
func (bc BlobContainer) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// BlobContainerProperties azure Storage blob container properties information.
type BlobContainerProperties struct {
// LastModifiedTime - READ-ONLY; the last modified time of the blob container.
LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
}
// MarshalJSON is the custom marshaler for BlobContainerProperties.
func (bcp BlobContainerProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type CreateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(Client) (DataLakeAnalyticsAccount, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *CreateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for CreateFuture.Result.
func (future *CreateFuture) result(client Client) (dlaa DataLakeAnalyticsAccount, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "account.CreateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
dlaa.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("account.CreateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if dlaa.Response.Response, err = future.GetResult(sender); err == nil && dlaa.Response.Response.StatusCode != http.StatusNoContent {
dlaa, err = client.CreateResponder(dlaa.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "account.CreateFuture", "Result", dlaa.Response.Response, "Failure responding to request")
}
}
return
}
// DataLakeAnalyticsAccount a Data Lake Analytics account object, containing all information associated
// with the named Data Lake Analytics account.
type DataLakeAnalyticsAccount struct {
autorest.Response `json:"-"`
// Location - the account regional location.
Location *string `json:"location,omitempty"`
// Name - the account name.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; the namespace and type of the account.
Type *string `json:"type,omitempty"`
// ID - READ-ONLY; the account subscription ID.
ID *string `json:"id,omitempty"`
// Tags - the value of custom properties.
Tags map[string]*string `json:"tags"`
// Properties - the properties defined by Data Lake Analytics all properties are specific to each resource provider.
Properties *DataLakeAnalyticsAccountProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for DataLakeAnalyticsAccount.
func (dlaa DataLakeAnalyticsAccount) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if dlaa.Location != nil {
objectMap["location"] = dlaa.Location
}
if dlaa.Name != nil {
objectMap["name"] = dlaa.Name
}
if dlaa.Tags != nil {
objectMap["tags"] = dlaa.Tags
}
if dlaa.Properties != nil {
objectMap["properties"] = dlaa.Properties
}
return json.Marshal(objectMap)
}
// DataLakeAnalyticsAccountListDataLakeStoreResult data Lake Account list information.
type DataLakeAnalyticsAccountListDataLakeStoreResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; the results of the list operation
Value *[]DataLakeStoreAccountInfo `json:"value,omitempty"`
// Count - READ-ONLY; total number of results.
Count *int32 `json:"count,omitempty"`
// NextLink - READ-ONLY; the link (url) to the next page of results.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for DataLakeAnalyticsAccountListDataLakeStoreResult.
func (dlaaldlsr DataLakeAnalyticsAccountListDataLakeStoreResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// DataLakeAnalyticsAccountListDataLakeStoreResultIterator provides access to a complete listing of
// DataLakeStoreAccountInfo values.
type DataLakeAnalyticsAccountListDataLakeStoreResultIterator struct {
i int
page DataLakeAnalyticsAccountListDataLakeStoreResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *DataLakeAnalyticsAccountListDataLakeStoreResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListDataLakeStoreResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *DataLakeAnalyticsAccountListDataLakeStoreResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter DataLakeAnalyticsAccountListDataLakeStoreResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter DataLakeAnalyticsAccountListDataLakeStoreResultIterator) Response() DataLakeAnalyticsAccountListDataLakeStoreResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter DataLakeAnalyticsAccountListDataLakeStoreResultIterator) Value() DataLakeStoreAccountInfo {
if !iter.page.NotDone() {
return DataLakeStoreAccountInfo{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the DataLakeAnalyticsAccountListDataLakeStoreResultIterator type.
func NewDataLakeAnalyticsAccountListDataLakeStoreResultIterator(page DataLakeAnalyticsAccountListDataLakeStoreResultPage) DataLakeAnalyticsAccountListDataLakeStoreResultIterator {
return DataLakeAnalyticsAccountListDataLakeStoreResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (dlaaldlsr DataLakeAnalyticsAccountListDataLakeStoreResult) IsEmpty() bool {
return dlaaldlsr.Value == nil || len(*dlaaldlsr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (dlaaldlsr DataLakeAnalyticsAccountListDataLakeStoreResult) hasNextLink() bool {
return dlaaldlsr.NextLink != nil && len(*dlaaldlsr.NextLink) != 0
}
// dataLakeAnalyticsAccountListDataLakeStoreResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (dlaaldlsr DataLakeAnalyticsAccountListDataLakeStoreResult) dataLakeAnalyticsAccountListDataLakeStoreResultPreparer(ctx context.Context) (*http.Request, error) {
if !dlaaldlsr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(dlaaldlsr.NextLink)))
}
// DataLakeAnalyticsAccountListDataLakeStoreResultPage contains a page of DataLakeStoreAccountInfo values.
type DataLakeAnalyticsAccountListDataLakeStoreResultPage struct {
fn func(context.Context, DataLakeAnalyticsAccountListDataLakeStoreResult) (DataLakeAnalyticsAccountListDataLakeStoreResult, error)
dlaaldlsr DataLakeAnalyticsAccountListDataLakeStoreResult
}
// 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 *DataLakeAnalyticsAccountListDataLakeStoreResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListDataLakeStoreResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.dlaaldlsr)
if err != nil {
return err
}
page.dlaaldlsr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// 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 *DataLakeAnalyticsAccountListDataLakeStoreResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page DataLakeAnalyticsAccountListDataLakeStoreResultPage) NotDone() bool {
return !page.dlaaldlsr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page DataLakeAnalyticsAccountListDataLakeStoreResultPage) Response() DataLakeAnalyticsAccountListDataLakeStoreResult {
return page.dlaaldlsr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page DataLakeAnalyticsAccountListDataLakeStoreResultPage) Values() []DataLakeStoreAccountInfo {
if page.dlaaldlsr.IsEmpty() {
return nil
}
return *page.dlaaldlsr.Value
}
// Creates a new instance of the DataLakeAnalyticsAccountListDataLakeStoreResultPage type.
func NewDataLakeAnalyticsAccountListDataLakeStoreResultPage(cur DataLakeAnalyticsAccountListDataLakeStoreResult, getNextPage func(context.Context, DataLakeAnalyticsAccountListDataLakeStoreResult) (DataLakeAnalyticsAccountListDataLakeStoreResult, error)) DataLakeAnalyticsAccountListDataLakeStoreResultPage {
return DataLakeAnalyticsAccountListDataLakeStoreResultPage{
fn: getNextPage,
dlaaldlsr: cur,
}
}
// DataLakeAnalyticsAccountListResult dataLakeAnalytics Account list information.
type DataLakeAnalyticsAccountListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; the results of the list operation
Value *[]DataLakeAnalyticsAccount `json:"value,omitempty"`
// NextLink - READ-ONLY; the link (url) to the next page of results.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for DataLakeAnalyticsAccountListResult.
func (dlaalr DataLakeAnalyticsAccountListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// DataLakeAnalyticsAccountListResultIterator provides access to a complete listing of
// DataLakeAnalyticsAccount values.
type DataLakeAnalyticsAccountListResultIterator struct {
i int
page DataLakeAnalyticsAccountListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *DataLakeAnalyticsAccountListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *DataLakeAnalyticsAccountListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter DataLakeAnalyticsAccountListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter DataLakeAnalyticsAccountListResultIterator) Response() DataLakeAnalyticsAccountListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter DataLakeAnalyticsAccountListResultIterator) Value() DataLakeAnalyticsAccount {
if !iter.page.NotDone() {
return DataLakeAnalyticsAccount{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the DataLakeAnalyticsAccountListResultIterator type.
func NewDataLakeAnalyticsAccountListResultIterator(page DataLakeAnalyticsAccountListResultPage) DataLakeAnalyticsAccountListResultIterator {
return DataLakeAnalyticsAccountListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (dlaalr DataLakeAnalyticsAccountListResult) IsEmpty() bool {
return dlaalr.Value == nil || len(*dlaalr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (dlaalr DataLakeAnalyticsAccountListResult) hasNextLink() bool {
return dlaalr.NextLink != nil && len(*dlaalr.NextLink) != 0
}
// dataLakeAnalyticsAccountListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (dlaalr DataLakeAnalyticsAccountListResult) dataLakeAnalyticsAccountListResultPreparer(ctx context.Context) (*http.Request, error) {
if !dlaalr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(dlaalr.NextLink)))
}
// DataLakeAnalyticsAccountListResultPage contains a page of DataLakeAnalyticsAccount values.
type DataLakeAnalyticsAccountListResultPage struct {
fn func(context.Context, DataLakeAnalyticsAccountListResult) (DataLakeAnalyticsAccountListResult, error)
dlaalr DataLakeAnalyticsAccountListResult
}
// 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 *DataLakeAnalyticsAccountListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.dlaalr)
if err != nil {
return err
}
page.dlaalr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// 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 *DataLakeAnalyticsAccountListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page DataLakeAnalyticsAccountListResultPage) NotDone() bool {
return !page.dlaalr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page DataLakeAnalyticsAccountListResultPage) Response() DataLakeAnalyticsAccountListResult {
return page.dlaalr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page DataLakeAnalyticsAccountListResultPage) Values() []DataLakeAnalyticsAccount {
if page.dlaalr.IsEmpty() {
return nil
}
return *page.dlaalr.Value
}
// Creates a new instance of the DataLakeAnalyticsAccountListResultPage type.
func NewDataLakeAnalyticsAccountListResultPage(cur DataLakeAnalyticsAccountListResult, getNextPage func(context.Context, DataLakeAnalyticsAccountListResult) (DataLakeAnalyticsAccountListResult, error)) DataLakeAnalyticsAccountListResultPage {
return DataLakeAnalyticsAccountListResultPage{
fn: getNextPage,
dlaalr: cur,
}
}
// DataLakeAnalyticsAccountListStorageAccountsResult azure Storage Account list information.
type DataLakeAnalyticsAccountListStorageAccountsResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; the results of the list operation
Value *[]StorageAccountInfo `json:"value,omitempty"`
// Count - READ-ONLY; total number of results.
Count *int32 `json:"count,omitempty"`
// NextLink - READ-ONLY; the link (url) to the next page of results.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for DataLakeAnalyticsAccountListStorageAccountsResult.
func (dlaalsar DataLakeAnalyticsAccountListStorageAccountsResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// DataLakeAnalyticsAccountListStorageAccountsResultIterator provides access to a complete listing of
// StorageAccountInfo values.
type DataLakeAnalyticsAccountListStorageAccountsResultIterator struct {
i int
page DataLakeAnalyticsAccountListStorageAccountsResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *DataLakeAnalyticsAccountListStorageAccountsResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListStorageAccountsResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *DataLakeAnalyticsAccountListStorageAccountsResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter DataLakeAnalyticsAccountListStorageAccountsResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter DataLakeAnalyticsAccountListStorageAccountsResultIterator) Response() DataLakeAnalyticsAccountListStorageAccountsResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter DataLakeAnalyticsAccountListStorageAccountsResultIterator) Value() StorageAccountInfo {
if !iter.page.NotDone() {
return StorageAccountInfo{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the DataLakeAnalyticsAccountListStorageAccountsResultIterator type.
func NewDataLakeAnalyticsAccountListStorageAccountsResultIterator(page DataLakeAnalyticsAccountListStorageAccountsResultPage) DataLakeAnalyticsAccountListStorageAccountsResultIterator {
return DataLakeAnalyticsAccountListStorageAccountsResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (dlaalsar DataLakeAnalyticsAccountListStorageAccountsResult) IsEmpty() bool {
return dlaalsar.Value == nil || len(*dlaalsar.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (dlaalsar DataLakeAnalyticsAccountListStorageAccountsResult) hasNextLink() bool {
return dlaalsar.NextLink != nil && len(*dlaalsar.NextLink) != 0
}
// dataLakeAnalyticsAccountListStorageAccountsResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (dlaalsar DataLakeAnalyticsAccountListStorageAccountsResult) dataLakeAnalyticsAccountListStorageAccountsResultPreparer(ctx context.Context) (*http.Request, error) {
if !dlaalsar.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(dlaalsar.NextLink)))
}
// DataLakeAnalyticsAccountListStorageAccountsResultPage contains a page of StorageAccountInfo values.
type DataLakeAnalyticsAccountListStorageAccountsResultPage struct {
fn func(context.Context, DataLakeAnalyticsAccountListStorageAccountsResult) (DataLakeAnalyticsAccountListStorageAccountsResult, error)
dlaalsar DataLakeAnalyticsAccountListStorageAccountsResult
}
// 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 *DataLakeAnalyticsAccountListStorageAccountsResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/DataLakeAnalyticsAccountListStorageAccountsResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.dlaalsar)
if err != nil {
return err
}
page.dlaalsar = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// 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 *DataLakeAnalyticsAccountListStorageAccountsResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page DataLakeAnalyticsAccountListStorageAccountsResultPage) NotDone() bool {
return !page.dlaalsar.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page DataLakeAnalyticsAccountListStorageAccountsResultPage) Response() DataLakeAnalyticsAccountListStorageAccountsResult {
return page.dlaalsar
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page DataLakeAnalyticsAccountListStorageAccountsResultPage) Values() []StorageAccountInfo {
if page.dlaalsar.IsEmpty() {
return nil
}
return *page.dlaalsar.Value
}
// Creates a new instance of the DataLakeAnalyticsAccountListStorageAccountsResultPage type.
func NewDataLakeAnalyticsAccountListStorageAccountsResultPage(cur DataLakeAnalyticsAccountListStorageAccountsResult, getNextPage func(context.Context, DataLakeAnalyticsAccountListStorageAccountsResult) (DataLakeAnalyticsAccountListStorageAccountsResult, error)) DataLakeAnalyticsAccountListStorageAccountsResultPage {
return DataLakeAnalyticsAccountListStorageAccountsResultPage{
fn: getNextPage,
dlaalsar: cur,
}
}
// DataLakeAnalyticsAccountProperties the account specific properties that are associated with an
// underlying Data Lake Analytics account.
type DataLakeAnalyticsAccountProperties struct {
// ProvisioningState - READ-ONLY; the provisioning status of the Data Lake Analytics account. Possible values include: 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted'
ProvisioningState DataLakeAnalyticsAccountStatus `json:"provisioningState,omitempty"`
// State - READ-ONLY; the state of the Data Lake Analytics account. Possible values include: 'Active', 'Suspended'
State DataLakeAnalyticsAccountState `json:"state,omitempty"`
// DefaultDataLakeStoreAccount - the default data lake storage account associated with this Data Lake Analytics account.
DefaultDataLakeStoreAccount *string `json:"defaultDataLakeStoreAccount,omitempty"`
// MaxDegreeOfParallelism - the maximum supported degree of parallelism for this account.
MaxDegreeOfParallelism *int32 `json:"maxDegreeOfParallelism,omitempty"`
// MaxJobCount - the maximum supported jobs running under the account at the same time.
MaxJobCount *int32 `json:"maxJobCount,omitempty"`
// DataLakeStoreAccounts - the list of Data Lake storage accounts associated with this account.
DataLakeStoreAccounts *[]DataLakeStoreAccountInfo `json:"dataLakeStoreAccounts,omitempty"`
// StorageAccounts - the list of Azure Blob storage accounts associated with this account.
StorageAccounts *[]StorageAccountInfo `json:"storageAccounts,omitempty"`
// CreationTime - READ-ONLY; the account creation time.
CreationTime *date.Time `json:"creationTime,omitempty"`
// LastModifiedTime - READ-ONLY; the account last modified time.
LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
// Endpoint - READ-ONLY; the full CName endpoint for this account.
Endpoint *string `json:"endpoint,omitempty"`
}
// MarshalJSON is the custom marshaler for DataLakeAnalyticsAccountProperties.
func (dlaap DataLakeAnalyticsAccountProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if dlaap.DefaultDataLakeStoreAccount != nil {
objectMap["defaultDataLakeStoreAccount"] = dlaap.DefaultDataLakeStoreAccount
}
if dlaap.MaxDegreeOfParallelism != nil {
objectMap["maxDegreeOfParallelism"] = dlaap.MaxDegreeOfParallelism
}
if dlaap.MaxJobCount != nil {
objectMap["maxJobCount"] = dlaap.MaxJobCount
}
if dlaap.DataLakeStoreAccounts != nil {
objectMap["dataLakeStoreAccounts"] = dlaap.DataLakeStoreAccounts
}
if dlaap.StorageAccounts != nil {
objectMap["storageAccounts"] = dlaap.StorageAccounts
}
return json.Marshal(objectMap)
}
// DataLakeStoreAccountInfo data Lake Store account information.
type DataLakeStoreAccountInfo struct {
autorest.Response `json:"-"`
// Name - the account name of the Data Lake Store account.
Name *string `json:"name,omitempty"`
// Properties - the properties associated with this Data Lake Store account.
Properties *DataLakeStoreAccountInfoProperties `json:"properties,omitempty"`
}
// DataLakeStoreAccountInfoProperties data Lake Store account properties information.
type DataLakeStoreAccountInfoProperties struct {
// Suffix - the optional suffix for the Data Lake Store account.
Suffix *string `json:"suffix,omitempty"`
}
// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type DeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(Client) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DeleteFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DeleteFuture.Result.
func (future *DeleteFuture) result(client Client) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "account.DeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("account.DeleteFuture")
return
}
ar.Response = future.Response()
return
}
// Error generic resource error information.
type Error struct {
// Code - READ-ONLY; the HTTP status code or error code associated with this error
Code *string `json:"code,omitempty"`
// Message - READ-ONLY; the error message to display.
Message *string `json:"message,omitempty"`
// Target - READ-ONLY; the target of the error.
Target *string `json:"target,omitempty"`
// Details - READ-ONLY; the list of error details
Details *[]ErrorDetails `json:"details,omitempty"`
// InnerError - READ-ONLY; the inner exceptions or errors, if any
InnerError *InnerError `json:"innerError,omitempty"`
}
// MarshalJSON is the custom marshaler for Error.
func (e Error) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ErrorDetails generic resource error details information.
type ErrorDetails struct {
// Code - READ-ONLY; the HTTP status code or error code associated with this error
Code *string `json:"code,omitempty"`
// Message - READ-ONLY; the error message localized based on Accept-Language
Message *string `json:"message,omitempty"`
// Target - READ-ONLY; the target of the particular error (for example, the name of the property in error).
Target *string `json:"target,omitempty"`
}
// MarshalJSON is the custom marshaler for ErrorDetails.
func (ed ErrorDetails) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// InnerError generic resource inner error information.
type InnerError struct {
// Trace - READ-ONLY; the stack trace for the error
Trace *string `json:"trace,omitempty"`
// Context - READ-ONLY; the context for the error message
Context *string `json:"context,omitempty"`
}
// MarshalJSON is the custom marshaler for InnerError.
func (ie InnerError) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ListBlobContainersResult the list of blob containers associated with the storage account attached to the
// Data Lake Analytics account.
type ListBlobContainersResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; the results of the list operation
Value *[]BlobContainer `json:"value,omitempty"`
// NextLink - READ-ONLY; the link (url) to the next page of results.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for ListBlobContainersResult.
func (lbcr ListBlobContainersResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ListBlobContainersResultIterator provides access to a complete listing of BlobContainer values.
type ListBlobContainersResultIterator struct {
i int
page ListBlobContainersResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ListBlobContainersResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ListBlobContainersResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ListBlobContainersResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ListBlobContainersResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter ListBlobContainersResultIterator) Response() ListBlobContainersResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ListBlobContainersResultIterator) Value() BlobContainer {
if !iter.page.NotDone() {
return BlobContainer{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the ListBlobContainersResultIterator type.
func NewListBlobContainersResultIterator(page ListBlobContainersResultPage) ListBlobContainersResultIterator {
return ListBlobContainersResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (lbcr ListBlobContainersResult) IsEmpty() bool {
return lbcr.Value == nil || len(*lbcr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (lbcr ListBlobContainersResult) hasNextLink() bool {
return lbcr.NextLink != nil && len(*lbcr.NextLink) != 0
}
// listBlobContainersResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (lbcr ListBlobContainersResult) listBlobContainersResultPreparer(ctx context.Context) (*http.Request, error) {
if !lbcr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(lbcr.NextLink)))
}
// ListBlobContainersResultPage contains a page of BlobContainer values.
type ListBlobContainersResultPage struct {
fn func(context.Context, ListBlobContainersResult) (ListBlobContainersResult, error)
lbcr ListBlobContainersResult
}
// 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 *ListBlobContainersResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ListBlobContainersResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.lbcr)
if err != nil {
return err
}
page.lbcr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// 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 *ListBlobContainersResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ListBlobContainersResultPage) NotDone() bool {
return !page.lbcr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page ListBlobContainersResultPage) Response() ListBlobContainersResult {
return page.lbcr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page ListBlobContainersResultPage) Values() []BlobContainer {
if page.lbcr.IsEmpty() {
return nil
}
return *page.lbcr.Value
}
// Creates a new instance of the ListBlobContainersResultPage type.
func NewListBlobContainersResultPage(cur ListBlobContainersResult, getNextPage func(context.Context, ListBlobContainersResult) (ListBlobContainersResult, error)) ListBlobContainersResultPage {
return ListBlobContainersResultPage{
fn: getNextPage,
lbcr: cur,
}
}
// ListSasTokensResult the SAS response that contains the storage account, container and associated SAS
// token for connection use.
type ListSasTokensResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY
Value *[]SasTokenInfo `json:"value,omitempty"`
// NextLink - READ-ONLY; the link (url) to the next page of results.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for ListSasTokensResult.
func (lstr ListSasTokensResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ListSasTokensResultIterator provides access to a complete listing of SasTokenInfo values.
type ListSasTokensResultIterator struct {
i int
page ListSasTokensResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ListSasTokensResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ListSasTokensResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ListSasTokensResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ListSasTokensResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter ListSasTokensResultIterator) Response() ListSasTokensResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ListSasTokensResultIterator) Value() SasTokenInfo {
if !iter.page.NotDone() {
return SasTokenInfo{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the ListSasTokensResultIterator type.
func NewListSasTokensResultIterator(page ListSasTokensResultPage) ListSasTokensResultIterator {
return ListSasTokensResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (lstr ListSasTokensResult) IsEmpty() bool {
return lstr.Value == nil || len(*lstr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (lstr ListSasTokensResult) hasNextLink() bool {
return lstr.NextLink != nil && len(*lstr.NextLink) != 0
}
// listSasTokensResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (lstr ListSasTokensResult) listSasTokensResultPreparer(ctx context.Context) (*http.Request, error) {
if !lstr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(lstr.NextLink)))
}
// ListSasTokensResultPage contains a page of SasTokenInfo values.
type ListSasTokensResultPage struct {
fn func(context.Context, ListSasTokensResult) (ListSasTokensResult, error)
lstr ListSasTokensResult
}
// 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 *ListSasTokensResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ListSasTokensResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.lstr)
if err != nil {
return err
}
page.lstr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// 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 *ListSasTokensResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ListSasTokensResultPage) NotDone() bool {
return !page.lstr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page ListSasTokensResultPage) Response() ListSasTokensResult {
return page.lstr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page ListSasTokensResultPage) Values() []SasTokenInfo {
if page.lstr.IsEmpty() {
return nil
}
return *page.lstr.Value
}
// Creates a new instance of the ListSasTokensResultPage type.
func NewListSasTokensResultPage(cur ListSasTokensResult, getNextPage func(context.Context, ListSasTokensResult) (ListSasTokensResult, error)) ListSasTokensResultPage {
return ListSasTokensResultPage{
fn: getNextPage,
lstr: cur,
}
}
// SasTokenInfo SAS token information.
type SasTokenInfo struct {
// AccessToken - READ-ONLY; the access token for the associated Azure Storage Container.
AccessToken *string `json:"accessToken,omitempty"`
}
// MarshalJSON is the custom marshaler for SasTokenInfo.
func (sti SasTokenInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// StorageAccountInfo azure Storage account information.
type StorageAccountInfo struct {
autorest.Response `json:"-"`
// Name - the account name associated with the Azure storage account.
Name *string `json:"name,omitempty"`
// Properties - the properties associated with this storage account.
Properties *StorageAccountProperties `json:"properties,omitempty"`
}
// StorageAccountProperties azure Storage account properties information.
type StorageAccountProperties struct {
// AccessKey - the access key associated with this Azure Storage account that will be used to connect to it.
AccessKey *string `json:"accessKey,omitempty"`
// Suffix - the optional suffix for the Data Lake account.
Suffix *string `json:"suffix,omitempty"`
}
// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type UpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(Client) (DataLakeAnalyticsAccount, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *UpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for UpdateFuture.Result.
func (future *UpdateFuture) result(client Client) (dlaa DataLakeAnalyticsAccount, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "account.UpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
dlaa.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("account.UpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if dlaa.Response.Response, err = future.GetResult(sender); err == nil && dlaa.Response.Response.StatusCode != http.StatusNoContent {
dlaa, err = client.UpdateResponder(dlaa.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "account.UpdateFuture", "Result", dlaa.Response.Response, "Failure responding to request")
}
}
return
}
|