github.com/yaegashi/msgraph.go@v0.1.4/beta/ActionDevice.go (about) 1 // Code generated by msgraph.go/gen DO NOT EDIT. 2 3 package msgraph 4 5 import ( 6 "context" 7 "fmt" 8 "io/ioutil" 9 "net/http" 10 11 "github.com/yaegashi/msgraph.go/jsonx" 12 ) 13 14 // DeviceCompliancePolicyCollectionHasPayloadLinksRequestParameter undocumented 15 type DeviceCompliancePolicyCollectionHasPayloadLinksRequestParameter struct { 16 // PayloadIDs undocumented 17 PayloadIDs []string `json:"payloadIds,omitempty"` 18 } 19 20 // DeviceCompliancePolicyCollectionRefreshDeviceComplianceReportSummarizationRequestParameter undocumented 21 type DeviceCompliancePolicyCollectionRefreshDeviceComplianceReportSummarizationRequestParameter struct { 22 } 23 24 // DeviceConfigurationCollectionHasPayloadLinksRequestParameter undocumented 25 type DeviceConfigurationCollectionHasPayloadLinksRequestParameter struct { 26 // PayloadIDs undocumented 27 PayloadIDs []string `json:"payloadIds,omitempty"` 28 } 29 30 // DeviceConfigurationCollectionGetTargetedUsersAndDevicesRequestParameter undocumented 31 type DeviceConfigurationCollectionGetTargetedUsersAndDevicesRequestParameter struct { 32 // DeviceConfigurationIDs undocumented 33 DeviceConfigurationIDs []string `json:"deviceConfigurationIds,omitempty"` 34 } 35 36 // DeviceEnrollmentConfigurationCollectionHasPayloadLinksRequestParameter undocumented 37 type DeviceEnrollmentConfigurationCollectionHasPayloadLinksRequestParameter struct { 38 // PayloadIDs undocumented 39 PayloadIDs []string `json:"payloadIds,omitempty"` 40 } 41 42 // DeviceManagementScriptCollectionHasPayloadLinksRequestParameter undocumented 43 type DeviceManagementScriptCollectionHasPayloadLinksRequestParameter struct { 44 // PayloadIDs undocumented 45 PayloadIDs []string `json:"payloadIds,omitempty"` 46 } 47 48 // DeviceAppManagementSyncMicrosoftStoreForBusinessAppsRequestParameter undocumented 49 type DeviceAppManagementSyncMicrosoftStoreForBusinessAppsRequestParameter struct { 50 } 51 52 // DeviceAppManagementTaskUpdateStatusRequestParameter undocumented 53 type DeviceAppManagementTaskUpdateStatusRequestParameter struct { 54 // Status undocumented 55 Status *DeviceAppManagementTaskStatus `json:"status,omitempty"` 56 // Note undocumented 57 Note *string `json:"note,omitempty"` 58 } 59 60 // DeviceCompliancePolicyAssignRequestParameter undocumented 61 type DeviceCompliancePolicyAssignRequestParameter struct { 62 // Assignments undocumented 63 Assignments []DeviceCompliancePolicyAssignment `json:"assignments,omitempty"` 64 } 65 66 // DeviceCompliancePolicyScheduleActionsForRulesRequestParameter undocumented 67 type DeviceCompliancePolicyScheduleActionsForRulesRequestParameter struct { 68 // DeviceComplianceScheduledActionForRules undocumented 69 DeviceComplianceScheduledActionForRules []DeviceComplianceScheduledActionForRule `json:"deviceComplianceScheduledActionForRules,omitempty"` 70 } 71 72 // DeviceConfigurationAssignRequestParameter undocumented 73 type DeviceConfigurationAssignRequestParameter struct { 74 // DeviceConfigurationGroupAssignments undocumented 75 DeviceConfigurationGroupAssignments []DeviceConfigurationGroupAssignment `json:"deviceConfigurationGroupAssignments,omitempty"` 76 // Assignments undocumented 77 Assignments []DeviceConfigurationAssignment `json:"assignments,omitempty"` 78 } 79 80 // DeviceConfigurationWindowsPrivacyAccessControlsRequestParameter undocumented 81 type DeviceConfigurationWindowsPrivacyAccessControlsRequestParameter struct { 82 // WindowsPrivacyAccessControls undocumented 83 WindowsPrivacyAccessControls []WindowsPrivacyDataAccessControlItem `json:"windowsPrivacyAccessControls,omitempty"` 84 } 85 86 // DeviceConfigurationAssignedAccessMultiModeProfilesRequestParameter undocumented 87 type DeviceConfigurationAssignedAccessMultiModeProfilesRequestParameter struct { 88 // AssignedAccessMultiModeProfiles undocumented 89 AssignedAccessMultiModeProfiles []WindowsAssignedAccessProfile `json:"assignedAccessMultiModeProfiles,omitempty"` 90 } 91 92 // DeviceEnrollmentConfigurationSetPriorityRequestParameter undocumented 93 type DeviceEnrollmentConfigurationSetPriorityRequestParameter struct { 94 // Priority undocumented 95 Priority *int `json:"priority,omitempty"` 96 } 97 98 // DeviceEnrollmentConfigurationAssignRequestParameter undocumented 99 type DeviceEnrollmentConfigurationAssignRequestParameter struct { 100 // EnrollmentConfigurationAssignments undocumented 101 EnrollmentConfigurationAssignments []EnrollmentConfigurationAssignment `json:"enrollmentConfigurationAssignments,omitempty"` 102 } 103 104 // DeviceHealthScriptAssignRequestParameter undocumented 105 type DeviceHealthScriptAssignRequestParameter struct { 106 // DeviceHealthScriptAssignments undocumented 107 DeviceHealthScriptAssignments []DeviceHealthScriptAssignment `json:"deviceHealthScriptAssignments,omitempty"` 108 } 109 110 // DeviceManagementEnableLegacyPcManagementRequestParameter undocumented 111 type DeviceManagementEnableLegacyPcManagementRequestParameter struct { 112 } 113 114 // DeviceManagementEnableAndroidDeviceAdministratorEnrollmentRequestParameter undocumented 115 type DeviceManagementEnableAndroidDeviceAdministratorEnrollmentRequestParameter struct { 116 } 117 118 // DeviceManagementSendCustomNotificationToCompanyPortalRequestParameter undocumented 119 type DeviceManagementSendCustomNotificationToCompanyPortalRequestParameter struct { 120 // NotificationTitle undocumented 121 NotificationTitle *string `json:"notificationTitle,omitempty"` 122 // NotificationBody undocumented 123 NotificationBody *string `json:"notificationBody,omitempty"` 124 // GroupsToNotify undocumented 125 GroupsToNotify []string `json:"groupsToNotify,omitempty"` 126 } 127 128 // DeviceManagementExchangeConnectorSyncRequestParameter undocumented 129 type DeviceManagementExchangeConnectorSyncRequestParameter struct { 130 // SyncType undocumented 131 SyncType *DeviceManagementExchangeConnectorSyncType `json:"syncType,omitempty"` 132 } 133 134 // DeviceManagementIntentUpdateSettingsRequestParameter undocumented 135 type DeviceManagementIntentUpdateSettingsRequestParameter struct { 136 // Settings undocumented 137 Settings []DeviceManagementSettingInstance `json:"settings,omitempty"` 138 } 139 140 // DeviceManagementIntentMigrateToTemplateRequestParameter undocumented 141 type DeviceManagementIntentMigrateToTemplateRequestParameter struct { 142 // NewTemplateID undocumented 143 NewTemplateID *string `json:"newTemplateId,omitempty"` 144 // PreserveCustomValues undocumented 145 PreserveCustomValues *bool `json:"preserveCustomValues,omitempty"` 146 } 147 148 // DeviceManagementIntentAssignRequestParameter undocumented 149 type DeviceManagementIntentAssignRequestParameter struct { 150 // Assignments undocumented 151 Assignments []DeviceManagementIntentAssignment `json:"assignments,omitempty"` 152 } 153 154 // DeviceManagementReportsGetDeviceNonComplianceReportRequestParameter undocumented 155 type DeviceManagementReportsGetDeviceNonComplianceReportRequestParameter struct { 156 // Name undocumented 157 Name *string `json:"name,omitempty"` 158 // Select undocumented 159 Select []string `json:"select,omitempty"` 160 // Search undocumented 161 Search *string `json:"search,omitempty"` 162 // GroupBy undocumented 163 GroupBy []string `json:"groupBy,omitempty"` 164 // OrderBy undocumented 165 OrderBy []string `json:"orderBy,omitempty"` 166 // Skip undocumented 167 Skip *int `json:"skip,omitempty"` 168 // Top undocumented 169 Top *int `json:"top,omitempty"` 170 // SessionID undocumented 171 SessionID *string `json:"sessionId,omitempty"` 172 // Filter undocumented 173 Filter *string `json:"filter,omitempty"` 174 } 175 176 // DeviceManagementReportsGetPolicyNonComplianceReportRequestParameter undocumented 177 type DeviceManagementReportsGetPolicyNonComplianceReportRequestParameter struct { 178 // Name undocumented 179 Name *string `json:"name,omitempty"` 180 // Select undocumented 181 Select []string `json:"select,omitempty"` 182 // Search undocumented 183 Search *string `json:"search,omitempty"` 184 // GroupBy undocumented 185 GroupBy []string `json:"groupBy,omitempty"` 186 // OrderBy undocumented 187 OrderBy []string `json:"orderBy,omitempty"` 188 // Skip undocumented 189 Skip *int `json:"skip,omitempty"` 190 // Top undocumented 191 Top *int `json:"top,omitempty"` 192 // SessionID undocumented 193 SessionID *string `json:"sessionId,omitempty"` 194 // Filter undocumented 195 Filter *string `json:"filter,omitempty"` 196 } 197 198 // DeviceManagementReportsGetPolicyNonComplianceMetadataRequestParameter undocumented 199 type DeviceManagementReportsGetPolicyNonComplianceMetadataRequestParameter struct { 200 // Name undocumented 201 Name *string `json:"name,omitempty"` 202 // Select undocumented 203 Select []string `json:"select,omitempty"` 204 // Search undocumented 205 Search *string `json:"search,omitempty"` 206 // GroupBy undocumented 207 GroupBy []string `json:"groupBy,omitempty"` 208 // OrderBy undocumented 209 OrderBy []string `json:"orderBy,omitempty"` 210 // Skip undocumented 211 Skip *int `json:"skip,omitempty"` 212 // Top undocumented 213 Top *int `json:"top,omitempty"` 214 // SessionID undocumented 215 SessionID *string `json:"sessionId,omitempty"` 216 // Filter undocumented 217 Filter *string `json:"filter,omitempty"` 218 } 219 220 // DeviceManagementReportsGetHistoricalReportRequestParameter undocumented 221 type DeviceManagementReportsGetHistoricalReportRequestParameter struct { 222 // Name undocumented 223 Name *string `json:"name,omitempty"` 224 // Select undocumented 225 Select []string `json:"select,omitempty"` 226 // Search undocumented 227 Search *string `json:"search,omitempty"` 228 // GroupBy undocumented 229 GroupBy []string `json:"groupBy,omitempty"` 230 // OrderBy undocumented 231 OrderBy []string `json:"orderBy,omitempty"` 232 // Skip undocumented 233 Skip *int `json:"skip,omitempty"` 234 // Top undocumented 235 Top *int `json:"top,omitempty"` 236 // Filter undocumented 237 Filter *string `json:"filter,omitempty"` 238 } 239 240 // DeviceManagementReportsGetCachedReportRequestParameter undocumented 241 type DeviceManagementReportsGetCachedReportRequestParameter struct { 242 // ID undocumented 243 ID *string `json:"id,omitempty"` 244 // Select undocumented 245 Select []string `json:"select,omitempty"` 246 // Search undocumented 247 Search *string `json:"search,omitempty"` 248 // GroupBy undocumented 249 GroupBy []string `json:"groupBy,omitempty"` 250 // OrderBy undocumented 251 OrderBy []string `json:"orderBy,omitempty"` 252 // Skip undocumented 253 Skip *int `json:"skip,omitempty"` 254 // Top undocumented 255 Top *int `json:"top,omitempty"` 256 } 257 258 // DeviceManagementScriptAssignRequestParameter undocumented 259 type DeviceManagementScriptAssignRequestParameter struct { 260 // DeviceManagementScriptGroupAssignments undocumented 261 DeviceManagementScriptGroupAssignments []DeviceManagementScriptGroupAssignment `json:"deviceManagementScriptGroupAssignments,omitempty"` 262 // DeviceManagementScriptAssignments undocumented 263 DeviceManagementScriptAssignments []DeviceManagementScriptAssignment `json:"deviceManagementScriptAssignments,omitempty"` 264 } 265 266 // DeviceManagementTemplateCreateInstanceRequestParameter undocumented 267 type DeviceManagementTemplateCreateInstanceRequestParameter struct { 268 // DisplayName undocumented 269 DisplayName *string `json:"displayName,omitempty"` 270 // Description undocumented 271 Description *string `json:"description,omitempty"` 272 // SettingsDelta undocumented 273 SettingsDelta []DeviceManagementSettingInstance `json:"settingsDelta,omitempty"` 274 // RoleScopeTagIDs undocumented 275 RoleScopeTagIDs []string `json:"roleScopeTagIds,omitempty"` 276 } 277 278 // Commands returns request builder for Command collection 279 func (b *DeviceRequestBuilder) Commands() *DeviceCommandsCollectionRequestBuilder { 280 bb := &DeviceCommandsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 281 bb.baseURL += "/commands" 282 return bb 283 } 284 285 // DeviceCommandsCollectionRequestBuilder is request builder for Command collection 286 type DeviceCommandsCollectionRequestBuilder struct{ BaseRequestBuilder } 287 288 // Request returns request for Command collection 289 func (b *DeviceCommandsCollectionRequestBuilder) Request() *DeviceCommandsCollectionRequest { 290 return &DeviceCommandsCollectionRequest{ 291 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 292 } 293 } 294 295 // ID returns request builder for Command item 296 func (b *DeviceCommandsCollectionRequestBuilder) ID(id string) *CommandRequestBuilder { 297 bb := &CommandRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 298 bb.baseURL += "/" + id 299 return bb 300 } 301 302 // DeviceCommandsCollectionRequest is request for Command collection 303 type DeviceCommandsCollectionRequest struct{ BaseRequest } 304 305 // Paging perfoms paging operation for Command collection 306 func (r *DeviceCommandsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]Command, error) { 307 req, err := r.NewJSONRequest(method, path, obj) 308 if err != nil { 309 return nil, err 310 } 311 if ctx != nil { 312 req = req.WithContext(ctx) 313 } 314 res, err := r.client.Do(req) 315 if err != nil { 316 return nil, err 317 } 318 var values []Command 319 for { 320 if res.StatusCode != http.StatusOK { 321 b, _ := ioutil.ReadAll(res.Body) 322 res.Body.Close() 323 errRes := &ErrorResponse{Response: res} 324 err := jsonx.Unmarshal(b, errRes) 325 if err != nil { 326 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 327 } 328 return nil, errRes 329 } 330 var ( 331 paging Paging 332 value []Command 333 ) 334 err := jsonx.NewDecoder(res.Body).Decode(&paging) 335 res.Body.Close() 336 if err != nil { 337 return nil, err 338 } 339 err = jsonx.Unmarshal(paging.Value, &value) 340 if err != nil { 341 return nil, err 342 } 343 values = append(values, value...) 344 if n >= 0 { 345 n-- 346 } 347 if n == 0 || len(paging.NextLink) == 0 { 348 return values, nil 349 } 350 req, err = http.NewRequest("GET", paging.NextLink, nil) 351 if ctx != nil { 352 req = req.WithContext(ctx) 353 } 354 res, err = r.client.Do(req) 355 if err != nil { 356 return nil, err 357 } 358 } 359 } 360 361 // GetN performs GET request for Command collection, max N pages 362 func (r *DeviceCommandsCollectionRequest) GetN(ctx context.Context, n int) ([]Command, error) { 363 var query string 364 if r.query != nil { 365 query = "?" + r.query.Encode() 366 } 367 return r.Paging(ctx, "GET", query, nil, n) 368 } 369 370 // Get performs GET request for Command collection 371 func (r *DeviceCommandsCollectionRequest) Get(ctx context.Context) ([]Command, error) { 372 return r.GetN(ctx, 0) 373 } 374 375 // Add performs POST request for Command collection 376 func (r *DeviceCommandsCollectionRequest) Add(ctx context.Context, reqObj *Command) (resObj *Command, err error) { 377 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 378 return 379 } 380 381 // Extensions returns request builder for Extension collection 382 func (b *DeviceRequestBuilder) Extensions() *DeviceExtensionsCollectionRequestBuilder { 383 bb := &DeviceExtensionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 384 bb.baseURL += "/extensions" 385 return bb 386 } 387 388 // DeviceExtensionsCollectionRequestBuilder is request builder for Extension collection 389 type DeviceExtensionsCollectionRequestBuilder struct{ BaseRequestBuilder } 390 391 // Request returns request for Extension collection 392 func (b *DeviceExtensionsCollectionRequestBuilder) Request() *DeviceExtensionsCollectionRequest { 393 return &DeviceExtensionsCollectionRequest{ 394 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 395 } 396 } 397 398 // ID returns request builder for Extension item 399 func (b *DeviceExtensionsCollectionRequestBuilder) ID(id string) *ExtensionRequestBuilder { 400 bb := &ExtensionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 401 bb.baseURL += "/" + id 402 return bb 403 } 404 405 // DeviceExtensionsCollectionRequest is request for Extension collection 406 type DeviceExtensionsCollectionRequest struct{ BaseRequest } 407 408 // Paging perfoms paging operation for Extension collection 409 func (r *DeviceExtensionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]Extension, error) { 410 req, err := r.NewJSONRequest(method, path, obj) 411 if err != nil { 412 return nil, err 413 } 414 if ctx != nil { 415 req = req.WithContext(ctx) 416 } 417 res, err := r.client.Do(req) 418 if err != nil { 419 return nil, err 420 } 421 var values []Extension 422 for { 423 if res.StatusCode != http.StatusOK { 424 b, _ := ioutil.ReadAll(res.Body) 425 res.Body.Close() 426 errRes := &ErrorResponse{Response: res} 427 err := jsonx.Unmarshal(b, errRes) 428 if err != nil { 429 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 430 } 431 return nil, errRes 432 } 433 var ( 434 paging Paging 435 value []Extension 436 ) 437 err := jsonx.NewDecoder(res.Body).Decode(&paging) 438 res.Body.Close() 439 if err != nil { 440 return nil, err 441 } 442 err = jsonx.Unmarshal(paging.Value, &value) 443 if err != nil { 444 return nil, err 445 } 446 values = append(values, value...) 447 if n >= 0 { 448 n-- 449 } 450 if n == 0 || len(paging.NextLink) == 0 { 451 return values, nil 452 } 453 req, err = http.NewRequest("GET", paging.NextLink, nil) 454 if ctx != nil { 455 req = req.WithContext(ctx) 456 } 457 res, err = r.client.Do(req) 458 if err != nil { 459 return nil, err 460 } 461 } 462 } 463 464 // GetN performs GET request for Extension collection, max N pages 465 func (r *DeviceExtensionsCollectionRequest) GetN(ctx context.Context, n int) ([]Extension, error) { 466 var query string 467 if r.query != nil { 468 query = "?" + r.query.Encode() 469 } 470 return r.Paging(ctx, "GET", query, nil, n) 471 } 472 473 // Get performs GET request for Extension collection 474 func (r *DeviceExtensionsCollectionRequest) Get(ctx context.Context) ([]Extension, error) { 475 return r.GetN(ctx, 0) 476 } 477 478 // Add performs POST request for Extension collection 479 func (r *DeviceExtensionsCollectionRequest) Add(ctx context.Context, reqObj *Extension) (resObj *Extension, err error) { 480 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 481 return 482 } 483 484 // MemberOf returns request builder for DirectoryObject collection 485 func (b *DeviceRequestBuilder) MemberOf() *DeviceMemberOfCollectionRequestBuilder { 486 bb := &DeviceMemberOfCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 487 bb.baseURL += "/memberOf" 488 return bb 489 } 490 491 // DeviceMemberOfCollectionRequestBuilder is request builder for DirectoryObject collection 492 type DeviceMemberOfCollectionRequestBuilder struct{ BaseRequestBuilder } 493 494 // Request returns request for DirectoryObject collection 495 func (b *DeviceMemberOfCollectionRequestBuilder) Request() *DeviceMemberOfCollectionRequest { 496 return &DeviceMemberOfCollectionRequest{ 497 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 498 } 499 } 500 501 // ID returns request builder for DirectoryObject item 502 func (b *DeviceMemberOfCollectionRequestBuilder) ID(id string) *DirectoryObjectRequestBuilder { 503 bb := &DirectoryObjectRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 504 bb.baseURL += "/" + id 505 return bb 506 } 507 508 // DeviceMemberOfCollectionRequest is request for DirectoryObject collection 509 type DeviceMemberOfCollectionRequest struct{ BaseRequest } 510 511 // Paging perfoms paging operation for DirectoryObject collection 512 func (r *DeviceMemberOfCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DirectoryObject, error) { 513 req, err := r.NewJSONRequest(method, path, obj) 514 if err != nil { 515 return nil, err 516 } 517 if ctx != nil { 518 req = req.WithContext(ctx) 519 } 520 res, err := r.client.Do(req) 521 if err != nil { 522 return nil, err 523 } 524 var values []DirectoryObject 525 for { 526 if res.StatusCode != http.StatusOK { 527 b, _ := ioutil.ReadAll(res.Body) 528 res.Body.Close() 529 errRes := &ErrorResponse{Response: res} 530 err := jsonx.Unmarshal(b, errRes) 531 if err != nil { 532 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 533 } 534 return nil, errRes 535 } 536 var ( 537 paging Paging 538 value []DirectoryObject 539 ) 540 err := jsonx.NewDecoder(res.Body).Decode(&paging) 541 res.Body.Close() 542 if err != nil { 543 return nil, err 544 } 545 err = jsonx.Unmarshal(paging.Value, &value) 546 if err != nil { 547 return nil, err 548 } 549 values = append(values, value...) 550 if n >= 0 { 551 n-- 552 } 553 if n == 0 || len(paging.NextLink) == 0 { 554 return values, nil 555 } 556 req, err = http.NewRequest("GET", paging.NextLink, nil) 557 if ctx != nil { 558 req = req.WithContext(ctx) 559 } 560 res, err = r.client.Do(req) 561 if err != nil { 562 return nil, err 563 } 564 } 565 } 566 567 // GetN performs GET request for DirectoryObject collection, max N pages 568 func (r *DeviceMemberOfCollectionRequest) GetN(ctx context.Context, n int) ([]DirectoryObject, error) { 569 var query string 570 if r.query != nil { 571 query = "?" + r.query.Encode() 572 } 573 return r.Paging(ctx, "GET", query, nil, n) 574 } 575 576 // Get performs GET request for DirectoryObject collection 577 func (r *DeviceMemberOfCollectionRequest) Get(ctx context.Context) ([]DirectoryObject, error) { 578 return r.GetN(ctx, 0) 579 } 580 581 // Add performs POST request for DirectoryObject collection 582 func (r *DeviceMemberOfCollectionRequest) Add(ctx context.Context, reqObj *DirectoryObject) (resObj *DirectoryObject, err error) { 583 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 584 return 585 } 586 587 // RegisteredOwners returns request builder for DirectoryObject collection 588 func (b *DeviceRequestBuilder) RegisteredOwners() *DeviceRegisteredOwnersCollectionRequestBuilder { 589 bb := &DeviceRegisteredOwnersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 590 bb.baseURL += "/registeredOwners" 591 return bb 592 } 593 594 // DeviceRegisteredOwnersCollectionRequestBuilder is request builder for DirectoryObject collection 595 type DeviceRegisteredOwnersCollectionRequestBuilder struct{ BaseRequestBuilder } 596 597 // Request returns request for DirectoryObject collection 598 func (b *DeviceRegisteredOwnersCollectionRequestBuilder) Request() *DeviceRegisteredOwnersCollectionRequest { 599 return &DeviceRegisteredOwnersCollectionRequest{ 600 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 601 } 602 } 603 604 // ID returns request builder for DirectoryObject item 605 func (b *DeviceRegisteredOwnersCollectionRequestBuilder) ID(id string) *DirectoryObjectRequestBuilder { 606 bb := &DirectoryObjectRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 607 bb.baseURL += "/" + id 608 return bb 609 } 610 611 // DeviceRegisteredOwnersCollectionRequest is request for DirectoryObject collection 612 type DeviceRegisteredOwnersCollectionRequest struct{ BaseRequest } 613 614 // Paging perfoms paging operation for DirectoryObject collection 615 func (r *DeviceRegisteredOwnersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DirectoryObject, error) { 616 req, err := r.NewJSONRequest(method, path, obj) 617 if err != nil { 618 return nil, err 619 } 620 if ctx != nil { 621 req = req.WithContext(ctx) 622 } 623 res, err := r.client.Do(req) 624 if err != nil { 625 return nil, err 626 } 627 var values []DirectoryObject 628 for { 629 if res.StatusCode != http.StatusOK { 630 b, _ := ioutil.ReadAll(res.Body) 631 res.Body.Close() 632 errRes := &ErrorResponse{Response: res} 633 err := jsonx.Unmarshal(b, errRes) 634 if err != nil { 635 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 636 } 637 return nil, errRes 638 } 639 var ( 640 paging Paging 641 value []DirectoryObject 642 ) 643 err := jsonx.NewDecoder(res.Body).Decode(&paging) 644 res.Body.Close() 645 if err != nil { 646 return nil, err 647 } 648 err = jsonx.Unmarshal(paging.Value, &value) 649 if err != nil { 650 return nil, err 651 } 652 values = append(values, value...) 653 if n >= 0 { 654 n-- 655 } 656 if n == 0 || len(paging.NextLink) == 0 { 657 return values, nil 658 } 659 req, err = http.NewRequest("GET", paging.NextLink, nil) 660 if ctx != nil { 661 req = req.WithContext(ctx) 662 } 663 res, err = r.client.Do(req) 664 if err != nil { 665 return nil, err 666 } 667 } 668 } 669 670 // GetN performs GET request for DirectoryObject collection, max N pages 671 func (r *DeviceRegisteredOwnersCollectionRequest) GetN(ctx context.Context, n int) ([]DirectoryObject, error) { 672 var query string 673 if r.query != nil { 674 query = "?" + r.query.Encode() 675 } 676 return r.Paging(ctx, "GET", query, nil, n) 677 } 678 679 // Get performs GET request for DirectoryObject collection 680 func (r *DeviceRegisteredOwnersCollectionRequest) Get(ctx context.Context) ([]DirectoryObject, error) { 681 return r.GetN(ctx, 0) 682 } 683 684 // Add performs POST request for DirectoryObject collection 685 func (r *DeviceRegisteredOwnersCollectionRequest) Add(ctx context.Context, reqObj *DirectoryObject) (resObj *DirectoryObject, err error) { 686 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 687 return 688 } 689 690 // RegisteredUsers returns request builder for DirectoryObject collection 691 func (b *DeviceRequestBuilder) RegisteredUsers() *DeviceRegisteredUsersCollectionRequestBuilder { 692 bb := &DeviceRegisteredUsersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 693 bb.baseURL += "/registeredUsers" 694 return bb 695 } 696 697 // DeviceRegisteredUsersCollectionRequestBuilder is request builder for DirectoryObject collection 698 type DeviceRegisteredUsersCollectionRequestBuilder struct{ BaseRequestBuilder } 699 700 // Request returns request for DirectoryObject collection 701 func (b *DeviceRegisteredUsersCollectionRequestBuilder) Request() *DeviceRegisteredUsersCollectionRequest { 702 return &DeviceRegisteredUsersCollectionRequest{ 703 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 704 } 705 } 706 707 // ID returns request builder for DirectoryObject item 708 func (b *DeviceRegisteredUsersCollectionRequestBuilder) ID(id string) *DirectoryObjectRequestBuilder { 709 bb := &DirectoryObjectRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 710 bb.baseURL += "/" + id 711 return bb 712 } 713 714 // DeviceRegisteredUsersCollectionRequest is request for DirectoryObject collection 715 type DeviceRegisteredUsersCollectionRequest struct{ BaseRequest } 716 717 // Paging perfoms paging operation for DirectoryObject collection 718 func (r *DeviceRegisteredUsersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DirectoryObject, error) { 719 req, err := r.NewJSONRequest(method, path, obj) 720 if err != nil { 721 return nil, err 722 } 723 if ctx != nil { 724 req = req.WithContext(ctx) 725 } 726 res, err := r.client.Do(req) 727 if err != nil { 728 return nil, err 729 } 730 var values []DirectoryObject 731 for { 732 if res.StatusCode != http.StatusOK { 733 b, _ := ioutil.ReadAll(res.Body) 734 res.Body.Close() 735 errRes := &ErrorResponse{Response: res} 736 err := jsonx.Unmarshal(b, errRes) 737 if err != nil { 738 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 739 } 740 return nil, errRes 741 } 742 var ( 743 paging Paging 744 value []DirectoryObject 745 ) 746 err := jsonx.NewDecoder(res.Body).Decode(&paging) 747 res.Body.Close() 748 if err != nil { 749 return nil, err 750 } 751 err = jsonx.Unmarshal(paging.Value, &value) 752 if err != nil { 753 return nil, err 754 } 755 values = append(values, value...) 756 if n >= 0 { 757 n-- 758 } 759 if n == 0 || len(paging.NextLink) == 0 { 760 return values, nil 761 } 762 req, err = http.NewRequest("GET", paging.NextLink, nil) 763 if ctx != nil { 764 req = req.WithContext(ctx) 765 } 766 res, err = r.client.Do(req) 767 if err != nil { 768 return nil, err 769 } 770 } 771 } 772 773 // GetN performs GET request for DirectoryObject collection, max N pages 774 func (r *DeviceRegisteredUsersCollectionRequest) GetN(ctx context.Context, n int) ([]DirectoryObject, error) { 775 var query string 776 if r.query != nil { 777 query = "?" + r.query.Encode() 778 } 779 return r.Paging(ctx, "GET", query, nil, n) 780 } 781 782 // Get performs GET request for DirectoryObject collection 783 func (r *DeviceRegisteredUsersCollectionRequest) Get(ctx context.Context) ([]DirectoryObject, error) { 784 return r.GetN(ctx, 0) 785 } 786 787 // Add performs POST request for DirectoryObject collection 788 func (r *DeviceRegisteredUsersCollectionRequest) Add(ctx context.Context, reqObj *DirectoryObject) (resObj *DirectoryObject, err error) { 789 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 790 return 791 } 792 793 // TransitiveMemberOf returns request builder for DirectoryObject collection 794 func (b *DeviceRequestBuilder) TransitiveMemberOf() *DeviceTransitiveMemberOfCollectionRequestBuilder { 795 bb := &DeviceTransitiveMemberOfCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 796 bb.baseURL += "/transitiveMemberOf" 797 return bb 798 } 799 800 // DeviceTransitiveMemberOfCollectionRequestBuilder is request builder for DirectoryObject collection 801 type DeviceTransitiveMemberOfCollectionRequestBuilder struct{ BaseRequestBuilder } 802 803 // Request returns request for DirectoryObject collection 804 func (b *DeviceTransitiveMemberOfCollectionRequestBuilder) Request() *DeviceTransitiveMemberOfCollectionRequest { 805 return &DeviceTransitiveMemberOfCollectionRequest{ 806 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 807 } 808 } 809 810 // ID returns request builder for DirectoryObject item 811 func (b *DeviceTransitiveMemberOfCollectionRequestBuilder) ID(id string) *DirectoryObjectRequestBuilder { 812 bb := &DirectoryObjectRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 813 bb.baseURL += "/" + id 814 return bb 815 } 816 817 // DeviceTransitiveMemberOfCollectionRequest is request for DirectoryObject collection 818 type DeviceTransitiveMemberOfCollectionRequest struct{ BaseRequest } 819 820 // Paging perfoms paging operation for DirectoryObject collection 821 func (r *DeviceTransitiveMemberOfCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DirectoryObject, error) { 822 req, err := r.NewJSONRequest(method, path, obj) 823 if err != nil { 824 return nil, err 825 } 826 if ctx != nil { 827 req = req.WithContext(ctx) 828 } 829 res, err := r.client.Do(req) 830 if err != nil { 831 return nil, err 832 } 833 var values []DirectoryObject 834 for { 835 if res.StatusCode != http.StatusOK { 836 b, _ := ioutil.ReadAll(res.Body) 837 res.Body.Close() 838 errRes := &ErrorResponse{Response: res} 839 err := jsonx.Unmarshal(b, errRes) 840 if err != nil { 841 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 842 } 843 return nil, errRes 844 } 845 var ( 846 paging Paging 847 value []DirectoryObject 848 ) 849 err := jsonx.NewDecoder(res.Body).Decode(&paging) 850 res.Body.Close() 851 if err != nil { 852 return nil, err 853 } 854 err = jsonx.Unmarshal(paging.Value, &value) 855 if err != nil { 856 return nil, err 857 } 858 values = append(values, value...) 859 if n >= 0 { 860 n-- 861 } 862 if n == 0 || len(paging.NextLink) == 0 { 863 return values, nil 864 } 865 req, err = http.NewRequest("GET", paging.NextLink, nil) 866 if ctx != nil { 867 req = req.WithContext(ctx) 868 } 869 res, err = r.client.Do(req) 870 if err != nil { 871 return nil, err 872 } 873 } 874 } 875 876 // GetN performs GET request for DirectoryObject collection, max N pages 877 func (r *DeviceTransitiveMemberOfCollectionRequest) GetN(ctx context.Context, n int) ([]DirectoryObject, error) { 878 var query string 879 if r.query != nil { 880 query = "?" + r.query.Encode() 881 } 882 return r.Paging(ctx, "GET", query, nil, n) 883 } 884 885 // Get performs GET request for DirectoryObject collection 886 func (r *DeviceTransitiveMemberOfCollectionRequest) Get(ctx context.Context) ([]DirectoryObject, error) { 887 return r.GetN(ctx, 0) 888 } 889 890 // Add performs POST request for DirectoryObject collection 891 func (r *DeviceTransitiveMemberOfCollectionRequest) Add(ctx context.Context, reqObj *DirectoryObject) (resObj *DirectoryObject, err error) { 892 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 893 return 894 } 895 896 // RoleScopeTags returns request builder for RoleScopeTag collection 897 func (b *DeviceAndAppManagementRoleAssignmentRequestBuilder) RoleScopeTags() *DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequestBuilder { 898 bb := &DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 899 bb.baseURL += "/roleScopeTags" 900 return bb 901 } 902 903 // DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequestBuilder is request builder for RoleScopeTag collection 904 type DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequestBuilder struct{ BaseRequestBuilder } 905 906 // Request returns request for RoleScopeTag collection 907 func (b *DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequestBuilder) Request() *DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequest { 908 return &DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequest{ 909 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 910 } 911 } 912 913 // ID returns request builder for RoleScopeTag item 914 func (b *DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequestBuilder) ID(id string) *RoleScopeTagRequestBuilder { 915 bb := &RoleScopeTagRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 916 bb.baseURL += "/" + id 917 return bb 918 } 919 920 // DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequest is request for RoleScopeTag collection 921 type DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequest struct{ BaseRequest } 922 923 // Paging perfoms paging operation for RoleScopeTag collection 924 func (r *DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]RoleScopeTag, error) { 925 req, err := r.NewJSONRequest(method, path, obj) 926 if err != nil { 927 return nil, err 928 } 929 if ctx != nil { 930 req = req.WithContext(ctx) 931 } 932 res, err := r.client.Do(req) 933 if err != nil { 934 return nil, err 935 } 936 var values []RoleScopeTag 937 for { 938 if res.StatusCode != http.StatusOK { 939 b, _ := ioutil.ReadAll(res.Body) 940 res.Body.Close() 941 errRes := &ErrorResponse{Response: res} 942 err := jsonx.Unmarshal(b, errRes) 943 if err != nil { 944 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 945 } 946 return nil, errRes 947 } 948 var ( 949 paging Paging 950 value []RoleScopeTag 951 ) 952 err := jsonx.NewDecoder(res.Body).Decode(&paging) 953 res.Body.Close() 954 if err != nil { 955 return nil, err 956 } 957 err = jsonx.Unmarshal(paging.Value, &value) 958 if err != nil { 959 return nil, err 960 } 961 values = append(values, value...) 962 if n >= 0 { 963 n-- 964 } 965 if n == 0 || len(paging.NextLink) == 0 { 966 return values, nil 967 } 968 req, err = http.NewRequest("GET", paging.NextLink, nil) 969 if ctx != nil { 970 req = req.WithContext(ctx) 971 } 972 res, err = r.client.Do(req) 973 if err != nil { 974 return nil, err 975 } 976 } 977 } 978 979 // GetN performs GET request for RoleScopeTag collection, max N pages 980 func (r *DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequest) GetN(ctx context.Context, n int) ([]RoleScopeTag, error) { 981 var query string 982 if r.query != nil { 983 query = "?" + r.query.Encode() 984 } 985 return r.Paging(ctx, "GET", query, nil, n) 986 } 987 988 // Get performs GET request for RoleScopeTag collection 989 func (r *DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequest) Get(ctx context.Context) ([]RoleScopeTag, error) { 990 return r.GetN(ctx, 0) 991 } 992 993 // Add performs POST request for RoleScopeTag collection 994 func (r *DeviceAndAppManagementRoleAssignmentRoleScopeTagsCollectionRequest) Add(ctx context.Context, reqObj *RoleScopeTag) (resObj *RoleScopeTag, err error) { 995 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 996 return 997 } 998 999 // AndroidManagedAppProtections returns request builder for AndroidManagedAppProtection collection 1000 func (b *DeviceAppManagementRequestBuilder) AndroidManagedAppProtections() *DeviceAppManagementAndroidManagedAppProtectionsCollectionRequestBuilder { 1001 bb := &DeviceAppManagementAndroidManagedAppProtectionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1002 bb.baseURL += "/androidManagedAppProtections" 1003 return bb 1004 } 1005 1006 // DeviceAppManagementAndroidManagedAppProtectionsCollectionRequestBuilder is request builder for AndroidManagedAppProtection collection 1007 type DeviceAppManagementAndroidManagedAppProtectionsCollectionRequestBuilder struct{ BaseRequestBuilder } 1008 1009 // Request returns request for AndroidManagedAppProtection collection 1010 func (b *DeviceAppManagementAndroidManagedAppProtectionsCollectionRequestBuilder) Request() *DeviceAppManagementAndroidManagedAppProtectionsCollectionRequest { 1011 return &DeviceAppManagementAndroidManagedAppProtectionsCollectionRequest{ 1012 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 1013 } 1014 } 1015 1016 // ID returns request builder for AndroidManagedAppProtection item 1017 func (b *DeviceAppManagementAndroidManagedAppProtectionsCollectionRequestBuilder) ID(id string) *AndroidManagedAppProtectionRequestBuilder { 1018 bb := &AndroidManagedAppProtectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1019 bb.baseURL += "/" + id 1020 return bb 1021 } 1022 1023 // DeviceAppManagementAndroidManagedAppProtectionsCollectionRequest is request for AndroidManagedAppProtection collection 1024 type DeviceAppManagementAndroidManagedAppProtectionsCollectionRequest struct{ BaseRequest } 1025 1026 // Paging perfoms paging operation for AndroidManagedAppProtection collection 1027 func (r *DeviceAppManagementAndroidManagedAppProtectionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]AndroidManagedAppProtection, error) { 1028 req, err := r.NewJSONRequest(method, path, obj) 1029 if err != nil { 1030 return nil, err 1031 } 1032 if ctx != nil { 1033 req = req.WithContext(ctx) 1034 } 1035 res, err := r.client.Do(req) 1036 if err != nil { 1037 return nil, err 1038 } 1039 var values []AndroidManagedAppProtection 1040 for { 1041 if res.StatusCode != http.StatusOK { 1042 b, _ := ioutil.ReadAll(res.Body) 1043 res.Body.Close() 1044 errRes := &ErrorResponse{Response: res} 1045 err := jsonx.Unmarshal(b, errRes) 1046 if err != nil { 1047 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 1048 } 1049 return nil, errRes 1050 } 1051 var ( 1052 paging Paging 1053 value []AndroidManagedAppProtection 1054 ) 1055 err := jsonx.NewDecoder(res.Body).Decode(&paging) 1056 res.Body.Close() 1057 if err != nil { 1058 return nil, err 1059 } 1060 err = jsonx.Unmarshal(paging.Value, &value) 1061 if err != nil { 1062 return nil, err 1063 } 1064 values = append(values, value...) 1065 if n >= 0 { 1066 n-- 1067 } 1068 if n == 0 || len(paging.NextLink) == 0 { 1069 return values, nil 1070 } 1071 req, err = http.NewRequest("GET", paging.NextLink, nil) 1072 if ctx != nil { 1073 req = req.WithContext(ctx) 1074 } 1075 res, err = r.client.Do(req) 1076 if err != nil { 1077 return nil, err 1078 } 1079 } 1080 } 1081 1082 // GetN performs GET request for AndroidManagedAppProtection collection, max N pages 1083 func (r *DeviceAppManagementAndroidManagedAppProtectionsCollectionRequest) GetN(ctx context.Context, n int) ([]AndroidManagedAppProtection, error) { 1084 var query string 1085 if r.query != nil { 1086 query = "?" + r.query.Encode() 1087 } 1088 return r.Paging(ctx, "GET", query, nil, n) 1089 } 1090 1091 // Get performs GET request for AndroidManagedAppProtection collection 1092 func (r *DeviceAppManagementAndroidManagedAppProtectionsCollectionRequest) Get(ctx context.Context) ([]AndroidManagedAppProtection, error) { 1093 return r.GetN(ctx, 0) 1094 } 1095 1096 // Add performs POST request for AndroidManagedAppProtection collection 1097 func (r *DeviceAppManagementAndroidManagedAppProtectionsCollectionRequest) Add(ctx context.Context, reqObj *AndroidManagedAppProtection) (resObj *AndroidManagedAppProtection, err error) { 1098 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 1099 return 1100 } 1101 1102 // DefaultManagedAppProtections returns request builder for DefaultManagedAppProtection collection 1103 func (b *DeviceAppManagementRequestBuilder) DefaultManagedAppProtections() *DeviceAppManagementDefaultManagedAppProtectionsCollectionRequestBuilder { 1104 bb := &DeviceAppManagementDefaultManagedAppProtectionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1105 bb.baseURL += "/defaultManagedAppProtections" 1106 return bb 1107 } 1108 1109 // DeviceAppManagementDefaultManagedAppProtectionsCollectionRequestBuilder is request builder for DefaultManagedAppProtection collection 1110 type DeviceAppManagementDefaultManagedAppProtectionsCollectionRequestBuilder struct{ BaseRequestBuilder } 1111 1112 // Request returns request for DefaultManagedAppProtection collection 1113 func (b *DeviceAppManagementDefaultManagedAppProtectionsCollectionRequestBuilder) Request() *DeviceAppManagementDefaultManagedAppProtectionsCollectionRequest { 1114 return &DeviceAppManagementDefaultManagedAppProtectionsCollectionRequest{ 1115 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 1116 } 1117 } 1118 1119 // ID returns request builder for DefaultManagedAppProtection item 1120 func (b *DeviceAppManagementDefaultManagedAppProtectionsCollectionRequestBuilder) ID(id string) *DefaultManagedAppProtectionRequestBuilder { 1121 bb := &DefaultManagedAppProtectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1122 bb.baseURL += "/" + id 1123 return bb 1124 } 1125 1126 // DeviceAppManagementDefaultManagedAppProtectionsCollectionRequest is request for DefaultManagedAppProtection collection 1127 type DeviceAppManagementDefaultManagedAppProtectionsCollectionRequest struct{ BaseRequest } 1128 1129 // Paging perfoms paging operation for DefaultManagedAppProtection collection 1130 func (r *DeviceAppManagementDefaultManagedAppProtectionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DefaultManagedAppProtection, error) { 1131 req, err := r.NewJSONRequest(method, path, obj) 1132 if err != nil { 1133 return nil, err 1134 } 1135 if ctx != nil { 1136 req = req.WithContext(ctx) 1137 } 1138 res, err := r.client.Do(req) 1139 if err != nil { 1140 return nil, err 1141 } 1142 var values []DefaultManagedAppProtection 1143 for { 1144 if res.StatusCode != http.StatusOK { 1145 b, _ := ioutil.ReadAll(res.Body) 1146 res.Body.Close() 1147 errRes := &ErrorResponse{Response: res} 1148 err := jsonx.Unmarshal(b, errRes) 1149 if err != nil { 1150 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 1151 } 1152 return nil, errRes 1153 } 1154 var ( 1155 paging Paging 1156 value []DefaultManagedAppProtection 1157 ) 1158 err := jsonx.NewDecoder(res.Body).Decode(&paging) 1159 res.Body.Close() 1160 if err != nil { 1161 return nil, err 1162 } 1163 err = jsonx.Unmarshal(paging.Value, &value) 1164 if err != nil { 1165 return nil, err 1166 } 1167 values = append(values, value...) 1168 if n >= 0 { 1169 n-- 1170 } 1171 if n == 0 || len(paging.NextLink) == 0 { 1172 return values, nil 1173 } 1174 req, err = http.NewRequest("GET", paging.NextLink, nil) 1175 if ctx != nil { 1176 req = req.WithContext(ctx) 1177 } 1178 res, err = r.client.Do(req) 1179 if err != nil { 1180 return nil, err 1181 } 1182 } 1183 } 1184 1185 // GetN performs GET request for DefaultManagedAppProtection collection, max N pages 1186 func (r *DeviceAppManagementDefaultManagedAppProtectionsCollectionRequest) GetN(ctx context.Context, n int) ([]DefaultManagedAppProtection, error) { 1187 var query string 1188 if r.query != nil { 1189 query = "?" + r.query.Encode() 1190 } 1191 return r.Paging(ctx, "GET", query, nil, n) 1192 } 1193 1194 // Get performs GET request for DefaultManagedAppProtection collection 1195 func (r *DeviceAppManagementDefaultManagedAppProtectionsCollectionRequest) Get(ctx context.Context) ([]DefaultManagedAppProtection, error) { 1196 return r.GetN(ctx, 0) 1197 } 1198 1199 // Add performs POST request for DefaultManagedAppProtection collection 1200 func (r *DeviceAppManagementDefaultManagedAppProtectionsCollectionRequest) Add(ctx context.Context, reqObj *DefaultManagedAppProtection) (resObj *DefaultManagedAppProtection, err error) { 1201 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 1202 return 1203 } 1204 1205 // DeviceAppManagementTasks returns request builder for DeviceAppManagementTask collection 1206 func (b *DeviceAppManagementRequestBuilder) DeviceAppManagementTasks() *DeviceAppManagementDeviceAppManagementTasksCollectionRequestBuilder { 1207 bb := &DeviceAppManagementDeviceAppManagementTasksCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1208 bb.baseURL += "/deviceAppManagementTasks" 1209 return bb 1210 } 1211 1212 // DeviceAppManagementDeviceAppManagementTasksCollectionRequestBuilder is request builder for DeviceAppManagementTask collection 1213 type DeviceAppManagementDeviceAppManagementTasksCollectionRequestBuilder struct{ BaseRequestBuilder } 1214 1215 // Request returns request for DeviceAppManagementTask collection 1216 func (b *DeviceAppManagementDeviceAppManagementTasksCollectionRequestBuilder) Request() *DeviceAppManagementDeviceAppManagementTasksCollectionRequest { 1217 return &DeviceAppManagementDeviceAppManagementTasksCollectionRequest{ 1218 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 1219 } 1220 } 1221 1222 // ID returns request builder for DeviceAppManagementTask item 1223 func (b *DeviceAppManagementDeviceAppManagementTasksCollectionRequestBuilder) ID(id string) *DeviceAppManagementTaskRequestBuilder { 1224 bb := &DeviceAppManagementTaskRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1225 bb.baseURL += "/" + id 1226 return bb 1227 } 1228 1229 // DeviceAppManagementDeviceAppManagementTasksCollectionRequest is request for DeviceAppManagementTask collection 1230 type DeviceAppManagementDeviceAppManagementTasksCollectionRequest struct{ BaseRequest } 1231 1232 // Paging perfoms paging operation for DeviceAppManagementTask collection 1233 func (r *DeviceAppManagementDeviceAppManagementTasksCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceAppManagementTask, error) { 1234 req, err := r.NewJSONRequest(method, path, obj) 1235 if err != nil { 1236 return nil, err 1237 } 1238 if ctx != nil { 1239 req = req.WithContext(ctx) 1240 } 1241 res, err := r.client.Do(req) 1242 if err != nil { 1243 return nil, err 1244 } 1245 var values []DeviceAppManagementTask 1246 for { 1247 if res.StatusCode != http.StatusOK { 1248 b, _ := ioutil.ReadAll(res.Body) 1249 res.Body.Close() 1250 errRes := &ErrorResponse{Response: res} 1251 err := jsonx.Unmarshal(b, errRes) 1252 if err != nil { 1253 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 1254 } 1255 return nil, errRes 1256 } 1257 var ( 1258 paging Paging 1259 value []DeviceAppManagementTask 1260 ) 1261 err := jsonx.NewDecoder(res.Body).Decode(&paging) 1262 res.Body.Close() 1263 if err != nil { 1264 return nil, err 1265 } 1266 err = jsonx.Unmarshal(paging.Value, &value) 1267 if err != nil { 1268 return nil, err 1269 } 1270 values = append(values, value...) 1271 if n >= 0 { 1272 n-- 1273 } 1274 if n == 0 || len(paging.NextLink) == 0 { 1275 return values, nil 1276 } 1277 req, err = http.NewRequest("GET", paging.NextLink, nil) 1278 if ctx != nil { 1279 req = req.WithContext(ctx) 1280 } 1281 res, err = r.client.Do(req) 1282 if err != nil { 1283 return nil, err 1284 } 1285 } 1286 } 1287 1288 // GetN performs GET request for DeviceAppManagementTask collection, max N pages 1289 func (r *DeviceAppManagementDeviceAppManagementTasksCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceAppManagementTask, error) { 1290 var query string 1291 if r.query != nil { 1292 query = "?" + r.query.Encode() 1293 } 1294 return r.Paging(ctx, "GET", query, nil, n) 1295 } 1296 1297 // Get performs GET request for DeviceAppManagementTask collection 1298 func (r *DeviceAppManagementDeviceAppManagementTasksCollectionRequest) Get(ctx context.Context) ([]DeviceAppManagementTask, error) { 1299 return r.GetN(ctx, 0) 1300 } 1301 1302 // Add performs POST request for DeviceAppManagementTask collection 1303 func (r *DeviceAppManagementDeviceAppManagementTasksCollectionRequest) Add(ctx context.Context, reqObj *DeviceAppManagementTask) (resObj *DeviceAppManagementTask, err error) { 1304 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 1305 return 1306 } 1307 1308 // EnterpriseCodeSigningCertificates returns request builder for EnterpriseCodeSigningCertificate collection 1309 func (b *DeviceAppManagementRequestBuilder) EnterpriseCodeSigningCertificates() *DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequestBuilder { 1310 bb := &DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1311 bb.baseURL += "/enterpriseCodeSigningCertificates" 1312 return bb 1313 } 1314 1315 // DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequestBuilder is request builder for EnterpriseCodeSigningCertificate collection 1316 type DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequestBuilder struct{ BaseRequestBuilder } 1317 1318 // Request returns request for EnterpriseCodeSigningCertificate collection 1319 func (b *DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequestBuilder) Request() *DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequest { 1320 return &DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequest{ 1321 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 1322 } 1323 } 1324 1325 // ID returns request builder for EnterpriseCodeSigningCertificate item 1326 func (b *DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequestBuilder) ID(id string) *EnterpriseCodeSigningCertificateRequestBuilder { 1327 bb := &EnterpriseCodeSigningCertificateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1328 bb.baseURL += "/" + id 1329 return bb 1330 } 1331 1332 // DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequest is request for EnterpriseCodeSigningCertificate collection 1333 type DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequest struct{ BaseRequest } 1334 1335 // Paging perfoms paging operation for EnterpriseCodeSigningCertificate collection 1336 func (r *DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]EnterpriseCodeSigningCertificate, error) { 1337 req, err := r.NewJSONRequest(method, path, obj) 1338 if err != nil { 1339 return nil, err 1340 } 1341 if ctx != nil { 1342 req = req.WithContext(ctx) 1343 } 1344 res, err := r.client.Do(req) 1345 if err != nil { 1346 return nil, err 1347 } 1348 var values []EnterpriseCodeSigningCertificate 1349 for { 1350 if res.StatusCode != http.StatusOK { 1351 b, _ := ioutil.ReadAll(res.Body) 1352 res.Body.Close() 1353 errRes := &ErrorResponse{Response: res} 1354 err := jsonx.Unmarshal(b, errRes) 1355 if err != nil { 1356 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 1357 } 1358 return nil, errRes 1359 } 1360 var ( 1361 paging Paging 1362 value []EnterpriseCodeSigningCertificate 1363 ) 1364 err := jsonx.NewDecoder(res.Body).Decode(&paging) 1365 res.Body.Close() 1366 if err != nil { 1367 return nil, err 1368 } 1369 err = jsonx.Unmarshal(paging.Value, &value) 1370 if err != nil { 1371 return nil, err 1372 } 1373 values = append(values, value...) 1374 if n >= 0 { 1375 n-- 1376 } 1377 if n == 0 || len(paging.NextLink) == 0 { 1378 return values, nil 1379 } 1380 req, err = http.NewRequest("GET", paging.NextLink, nil) 1381 if ctx != nil { 1382 req = req.WithContext(ctx) 1383 } 1384 res, err = r.client.Do(req) 1385 if err != nil { 1386 return nil, err 1387 } 1388 } 1389 } 1390 1391 // GetN performs GET request for EnterpriseCodeSigningCertificate collection, max N pages 1392 func (r *DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequest) GetN(ctx context.Context, n int) ([]EnterpriseCodeSigningCertificate, error) { 1393 var query string 1394 if r.query != nil { 1395 query = "?" + r.query.Encode() 1396 } 1397 return r.Paging(ctx, "GET", query, nil, n) 1398 } 1399 1400 // Get performs GET request for EnterpriseCodeSigningCertificate collection 1401 func (r *DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequest) Get(ctx context.Context) ([]EnterpriseCodeSigningCertificate, error) { 1402 return r.GetN(ctx, 0) 1403 } 1404 1405 // Add performs POST request for EnterpriseCodeSigningCertificate collection 1406 func (r *DeviceAppManagementEnterpriseCodeSigningCertificatesCollectionRequest) Add(ctx context.Context, reqObj *EnterpriseCodeSigningCertificate) (resObj *EnterpriseCodeSigningCertificate, err error) { 1407 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 1408 return 1409 } 1410 1411 // IOSLobAppProvisioningConfigurations returns request builder for IOSLobAppProvisioningConfiguration collection 1412 func (b *DeviceAppManagementRequestBuilder) IOSLobAppProvisioningConfigurations() *DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequestBuilder { 1413 bb := &DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1414 bb.baseURL += "/iosLobAppProvisioningConfigurations" 1415 return bb 1416 } 1417 1418 // DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequestBuilder is request builder for IOSLobAppProvisioningConfiguration collection 1419 type DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } 1420 1421 // Request returns request for IOSLobAppProvisioningConfiguration collection 1422 func (b *DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequestBuilder) Request() *DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequest { 1423 return &DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequest{ 1424 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 1425 } 1426 } 1427 1428 // ID returns request builder for IOSLobAppProvisioningConfiguration item 1429 func (b *DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequestBuilder) ID(id string) *IOSLobAppProvisioningConfigurationRequestBuilder { 1430 bb := &IOSLobAppProvisioningConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1431 bb.baseURL += "/" + id 1432 return bb 1433 } 1434 1435 // DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequest is request for IOSLobAppProvisioningConfiguration collection 1436 type DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequest struct{ BaseRequest } 1437 1438 // Paging perfoms paging operation for IOSLobAppProvisioningConfiguration collection 1439 func (r *DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]IOSLobAppProvisioningConfiguration, error) { 1440 req, err := r.NewJSONRequest(method, path, obj) 1441 if err != nil { 1442 return nil, err 1443 } 1444 if ctx != nil { 1445 req = req.WithContext(ctx) 1446 } 1447 res, err := r.client.Do(req) 1448 if err != nil { 1449 return nil, err 1450 } 1451 var values []IOSLobAppProvisioningConfiguration 1452 for { 1453 if res.StatusCode != http.StatusOK { 1454 b, _ := ioutil.ReadAll(res.Body) 1455 res.Body.Close() 1456 errRes := &ErrorResponse{Response: res} 1457 err := jsonx.Unmarshal(b, errRes) 1458 if err != nil { 1459 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 1460 } 1461 return nil, errRes 1462 } 1463 var ( 1464 paging Paging 1465 value []IOSLobAppProvisioningConfiguration 1466 ) 1467 err := jsonx.NewDecoder(res.Body).Decode(&paging) 1468 res.Body.Close() 1469 if err != nil { 1470 return nil, err 1471 } 1472 err = jsonx.Unmarshal(paging.Value, &value) 1473 if err != nil { 1474 return nil, err 1475 } 1476 values = append(values, value...) 1477 if n >= 0 { 1478 n-- 1479 } 1480 if n == 0 || len(paging.NextLink) == 0 { 1481 return values, nil 1482 } 1483 req, err = http.NewRequest("GET", paging.NextLink, nil) 1484 if ctx != nil { 1485 req = req.WithContext(ctx) 1486 } 1487 res, err = r.client.Do(req) 1488 if err != nil { 1489 return nil, err 1490 } 1491 } 1492 } 1493 1494 // GetN performs GET request for IOSLobAppProvisioningConfiguration collection, max N pages 1495 func (r *DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequest) GetN(ctx context.Context, n int) ([]IOSLobAppProvisioningConfiguration, error) { 1496 var query string 1497 if r.query != nil { 1498 query = "?" + r.query.Encode() 1499 } 1500 return r.Paging(ctx, "GET", query, nil, n) 1501 } 1502 1503 // Get performs GET request for IOSLobAppProvisioningConfiguration collection 1504 func (r *DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequest) Get(ctx context.Context) ([]IOSLobAppProvisioningConfiguration, error) { 1505 return r.GetN(ctx, 0) 1506 } 1507 1508 // Add performs POST request for IOSLobAppProvisioningConfiguration collection 1509 func (r *DeviceAppManagementIOSLobAppProvisioningConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *IOSLobAppProvisioningConfiguration) (resObj *IOSLobAppProvisioningConfiguration, err error) { 1510 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 1511 return 1512 } 1513 1514 // IOSManagedAppProtections returns request builder for IOSManagedAppProtection collection 1515 func (b *DeviceAppManagementRequestBuilder) IOSManagedAppProtections() *DeviceAppManagementIOSManagedAppProtectionsCollectionRequestBuilder { 1516 bb := &DeviceAppManagementIOSManagedAppProtectionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1517 bb.baseURL += "/iosManagedAppProtections" 1518 return bb 1519 } 1520 1521 // DeviceAppManagementIOSManagedAppProtectionsCollectionRequestBuilder is request builder for IOSManagedAppProtection collection 1522 type DeviceAppManagementIOSManagedAppProtectionsCollectionRequestBuilder struct{ BaseRequestBuilder } 1523 1524 // Request returns request for IOSManagedAppProtection collection 1525 func (b *DeviceAppManagementIOSManagedAppProtectionsCollectionRequestBuilder) Request() *DeviceAppManagementIOSManagedAppProtectionsCollectionRequest { 1526 return &DeviceAppManagementIOSManagedAppProtectionsCollectionRequest{ 1527 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 1528 } 1529 } 1530 1531 // ID returns request builder for IOSManagedAppProtection item 1532 func (b *DeviceAppManagementIOSManagedAppProtectionsCollectionRequestBuilder) ID(id string) *IOSManagedAppProtectionRequestBuilder { 1533 bb := &IOSManagedAppProtectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1534 bb.baseURL += "/" + id 1535 return bb 1536 } 1537 1538 // DeviceAppManagementIOSManagedAppProtectionsCollectionRequest is request for IOSManagedAppProtection collection 1539 type DeviceAppManagementIOSManagedAppProtectionsCollectionRequest struct{ BaseRequest } 1540 1541 // Paging perfoms paging operation for IOSManagedAppProtection collection 1542 func (r *DeviceAppManagementIOSManagedAppProtectionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]IOSManagedAppProtection, error) { 1543 req, err := r.NewJSONRequest(method, path, obj) 1544 if err != nil { 1545 return nil, err 1546 } 1547 if ctx != nil { 1548 req = req.WithContext(ctx) 1549 } 1550 res, err := r.client.Do(req) 1551 if err != nil { 1552 return nil, err 1553 } 1554 var values []IOSManagedAppProtection 1555 for { 1556 if res.StatusCode != http.StatusOK { 1557 b, _ := ioutil.ReadAll(res.Body) 1558 res.Body.Close() 1559 errRes := &ErrorResponse{Response: res} 1560 err := jsonx.Unmarshal(b, errRes) 1561 if err != nil { 1562 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 1563 } 1564 return nil, errRes 1565 } 1566 var ( 1567 paging Paging 1568 value []IOSManagedAppProtection 1569 ) 1570 err := jsonx.NewDecoder(res.Body).Decode(&paging) 1571 res.Body.Close() 1572 if err != nil { 1573 return nil, err 1574 } 1575 err = jsonx.Unmarshal(paging.Value, &value) 1576 if err != nil { 1577 return nil, err 1578 } 1579 values = append(values, value...) 1580 if n >= 0 { 1581 n-- 1582 } 1583 if n == 0 || len(paging.NextLink) == 0 { 1584 return values, nil 1585 } 1586 req, err = http.NewRequest("GET", paging.NextLink, nil) 1587 if ctx != nil { 1588 req = req.WithContext(ctx) 1589 } 1590 res, err = r.client.Do(req) 1591 if err != nil { 1592 return nil, err 1593 } 1594 } 1595 } 1596 1597 // GetN performs GET request for IOSManagedAppProtection collection, max N pages 1598 func (r *DeviceAppManagementIOSManagedAppProtectionsCollectionRequest) GetN(ctx context.Context, n int) ([]IOSManagedAppProtection, error) { 1599 var query string 1600 if r.query != nil { 1601 query = "?" + r.query.Encode() 1602 } 1603 return r.Paging(ctx, "GET", query, nil, n) 1604 } 1605 1606 // Get performs GET request for IOSManagedAppProtection collection 1607 func (r *DeviceAppManagementIOSManagedAppProtectionsCollectionRequest) Get(ctx context.Context) ([]IOSManagedAppProtection, error) { 1608 return r.GetN(ctx, 0) 1609 } 1610 1611 // Add performs POST request for IOSManagedAppProtection collection 1612 func (r *DeviceAppManagementIOSManagedAppProtectionsCollectionRequest) Add(ctx context.Context, reqObj *IOSManagedAppProtection) (resObj *IOSManagedAppProtection, err error) { 1613 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 1614 return 1615 } 1616 1617 // ManagedAppPolicies returns request builder for ManagedAppPolicy collection 1618 func (b *DeviceAppManagementRequestBuilder) ManagedAppPolicies() *DeviceAppManagementManagedAppPoliciesCollectionRequestBuilder { 1619 bb := &DeviceAppManagementManagedAppPoliciesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1620 bb.baseURL += "/managedAppPolicies" 1621 return bb 1622 } 1623 1624 // DeviceAppManagementManagedAppPoliciesCollectionRequestBuilder is request builder for ManagedAppPolicy collection 1625 type DeviceAppManagementManagedAppPoliciesCollectionRequestBuilder struct{ BaseRequestBuilder } 1626 1627 // Request returns request for ManagedAppPolicy collection 1628 func (b *DeviceAppManagementManagedAppPoliciesCollectionRequestBuilder) Request() *DeviceAppManagementManagedAppPoliciesCollectionRequest { 1629 return &DeviceAppManagementManagedAppPoliciesCollectionRequest{ 1630 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 1631 } 1632 } 1633 1634 // ID returns request builder for ManagedAppPolicy item 1635 func (b *DeviceAppManagementManagedAppPoliciesCollectionRequestBuilder) ID(id string) *ManagedAppPolicyRequestBuilder { 1636 bb := &ManagedAppPolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1637 bb.baseURL += "/" + id 1638 return bb 1639 } 1640 1641 // DeviceAppManagementManagedAppPoliciesCollectionRequest is request for ManagedAppPolicy collection 1642 type DeviceAppManagementManagedAppPoliciesCollectionRequest struct{ BaseRequest } 1643 1644 // Paging perfoms paging operation for ManagedAppPolicy collection 1645 func (r *DeviceAppManagementManagedAppPoliciesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedAppPolicy, error) { 1646 req, err := r.NewJSONRequest(method, path, obj) 1647 if err != nil { 1648 return nil, err 1649 } 1650 if ctx != nil { 1651 req = req.WithContext(ctx) 1652 } 1653 res, err := r.client.Do(req) 1654 if err != nil { 1655 return nil, err 1656 } 1657 var values []ManagedAppPolicy 1658 for { 1659 if res.StatusCode != http.StatusOK { 1660 b, _ := ioutil.ReadAll(res.Body) 1661 res.Body.Close() 1662 errRes := &ErrorResponse{Response: res} 1663 err := jsonx.Unmarshal(b, errRes) 1664 if err != nil { 1665 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 1666 } 1667 return nil, errRes 1668 } 1669 var ( 1670 paging Paging 1671 value []ManagedAppPolicy 1672 ) 1673 err := jsonx.NewDecoder(res.Body).Decode(&paging) 1674 res.Body.Close() 1675 if err != nil { 1676 return nil, err 1677 } 1678 err = jsonx.Unmarshal(paging.Value, &value) 1679 if err != nil { 1680 return nil, err 1681 } 1682 values = append(values, value...) 1683 if n >= 0 { 1684 n-- 1685 } 1686 if n == 0 || len(paging.NextLink) == 0 { 1687 return values, nil 1688 } 1689 req, err = http.NewRequest("GET", paging.NextLink, nil) 1690 if ctx != nil { 1691 req = req.WithContext(ctx) 1692 } 1693 res, err = r.client.Do(req) 1694 if err != nil { 1695 return nil, err 1696 } 1697 } 1698 } 1699 1700 // GetN performs GET request for ManagedAppPolicy collection, max N pages 1701 func (r *DeviceAppManagementManagedAppPoliciesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedAppPolicy, error) { 1702 var query string 1703 if r.query != nil { 1704 query = "?" + r.query.Encode() 1705 } 1706 return r.Paging(ctx, "GET", query, nil, n) 1707 } 1708 1709 // Get performs GET request for ManagedAppPolicy collection 1710 func (r *DeviceAppManagementManagedAppPoliciesCollectionRequest) Get(ctx context.Context) ([]ManagedAppPolicy, error) { 1711 return r.GetN(ctx, 0) 1712 } 1713 1714 // Add performs POST request for ManagedAppPolicy collection 1715 func (r *DeviceAppManagementManagedAppPoliciesCollectionRequest) Add(ctx context.Context, reqObj *ManagedAppPolicy) (resObj *ManagedAppPolicy, err error) { 1716 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 1717 return 1718 } 1719 1720 // ManagedAppRegistrations returns request builder for ManagedAppRegistration collection 1721 func (b *DeviceAppManagementRequestBuilder) ManagedAppRegistrations() *DeviceAppManagementManagedAppRegistrationsCollectionRequestBuilder { 1722 bb := &DeviceAppManagementManagedAppRegistrationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1723 bb.baseURL += "/managedAppRegistrations" 1724 return bb 1725 } 1726 1727 // DeviceAppManagementManagedAppRegistrationsCollectionRequestBuilder is request builder for ManagedAppRegistration collection 1728 type DeviceAppManagementManagedAppRegistrationsCollectionRequestBuilder struct{ BaseRequestBuilder } 1729 1730 // Request returns request for ManagedAppRegistration collection 1731 func (b *DeviceAppManagementManagedAppRegistrationsCollectionRequestBuilder) Request() *DeviceAppManagementManagedAppRegistrationsCollectionRequest { 1732 return &DeviceAppManagementManagedAppRegistrationsCollectionRequest{ 1733 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 1734 } 1735 } 1736 1737 // ID returns request builder for ManagedAppRegistration item 1738 func (b *DeviceAppManagementManagedAppRegistrationsCollectionRequestBuilder) ID(id string) *ManagedAppRegistrationRequestBuilder { 1739 bb := &ManagedAppRegistrationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1740 bb.baseURL += "/" + id 1741 return bb 1742 } 1743 1744 // DeviceAppManagementManagedAppRegistrationsCollectionRequest is request for ManagedAppRegistration collection 1745 type DeviceAppManagementManagedAppRegistrationsCollectionRequest struct{ BaseRequest } 1746 1747 // Paging perfoms paging operation for ManagedAppRegistration collection 1748 func (r *DeviceAppManagementManagedAppRegistrationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedAppRegistration, error) { 1749 req, err := r.NewJSONRequest(method, path, obj) 1750 if err != nil { 1751 return nil, err 1752 } 1753 if ctx != nil { 1754 req = req.WithContext(ctx) 1755 } 1756 res, err := r.client.Do(req) 1757 if err != nil { 1758 return nil, err 1759 } 1760 var values []ManagedAppRegistration 1761 for { 1762 if res.StatusCode != http.StatusOK { 1763 b, _ := ioutil.ReadAll(res.Body) 1764 res.Body.Close() 1765 errRes := &ErrorResponse{Response: res} 1766 err := jsonx.Unmarshal(b, errRes) 1767 if err != nil { 1768 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 1769 } 1770 return nil, errRes 1771 } 1772 var ( 1773 paging Paging 1774 value []ManagedAppRegistration 1775 ) 1776 err := jsonx.NewDecoder(res.Body).Decode(&paging) 1777 res.Body.Close() 1778 if err != nil { 1779 return nil, err 1780 } 1781 err = jsonx.Unmarshal(paging.Value, &value) 1782 if err != nil { 1783 return nil, err 1784 } 1785 values = append(values, value...) 1786 if n >= 0 { 1787 n-- 1788 } 1789 if n == 0 || len(paging.NextLink) == 0 { 1790 return values, nil 1791 } 1792 req, err = http.NewRequest("GET", paging.NextLink, nil) 1793 if ctx != nil { 1794 req = req.WithContext(ctx) 1795 } 1796 res, err = r.client.Do(req) 1797 if err != nil { 1798 return nil, err 1799 } 1800 } 1801 } 1802 1803 // GetN performs GET request for ManagedAppRegistration collection, max N pages 1804 func (r *DeviceAppManagementManagedAppRegistrationsCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedAppRegistration, error) { 1805 var query string 1806 if r.query != nil { 1807 query = "?" + r.query.Encode() 1808 } 1809 return r.Paging(ctx, "GET", query, nil, n) 1810 } 1811 1812 // Get performs GET request for ManagedAppRegistration collection 1813 func (r *DeviceAppManagementManagedAppRegistrationsCollectionRequest) Get(ctx context.Context) ([]ManagedAppRegistration, error) { 1814 return r.GetN(ctx, 0) 1815 } 1816 1817 // Add performs POST request for ManagedAppRegistration collection 1818 func (r *DeviceAppManagementManagedAppRegistrationsCollectionRequest) Add(ctx context.Context, reqObj *ManagedAppRegistration) (resObj *ManagedAppRegistration, err error) { 1819 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 1820 return 1821 } 1822 1823 // ManagedAppStatuses returns request builder for ManagedAppStatus collection 1824 func (b *DeviceAppManagementRequestBuilder) ManagedAppStatuses() *DeviceAppManagementManagedAppStatusesCollectionRequestBuilder { 1825 bb := &DeviceAppManagementManagedAppStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1826 bb.baseURL += "/managedAppStatuses" 1827 return bb 1828 } 1829 1830 // DeviceAppManagementManagedAppStatusesCollectionRequestBuilder is request builder for ManagedAppStatus collection 1831 type DeviceAppManagementManagedAppStatusesCollectionRequestBuilder struct{ BaseRequestBuilder } 1832 1833 // Request returns request for ManagedAppStatus collection 1834 func (b *DeviceAppManagementManagedAppStatusesCollectionRequestBuilder) Request() *DeviceAppManagementManagedAppStatusesCollectionRequest { 1835 return &DeviceAppManagementManagedAppStatusesCollectionRequest{ 1836 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 1837 } 1838 } 1839 1840 // ID returns request builder for ManagedAppStatus item 1841 func (b *DeviceAppManagementManagedAppStatusesCollectionRequestBuilder) ID(id string) *ManagedAppStatusRequestBuilder { 1842 bb := &ManagedAppStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1843 bb.baseURL += "/" + id 1844 return bb 1845 } 1846 1847 // DeviceAppManagementManagedAppStatusesCollectionRequest is request for ManagedAppStatus collection 1848 type DeviceAppManagementManagedAppStatusesCollectionRequest struct{ BaseRequest } 1849 1850 // Paging perfoms paging operation for ManagedAppStatus collection 1851 func (r *DeviceAppManagementManagedAppStatusesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedAppStatus, error) { 1852 req, err := r.NewJSONRequest(method, path, obj) 1853 if err != nil { 1854 return nil, err 1855 } 1856 if ctx != nil { 1857 req = req.WithContext(ctx) 1858 } 1859 res, err := r.client.Do(req) 1860 if err != nil { 1861 return nil, err 1862 } 1863 var values []ManagedAppStatus 1864 for { 1865 if res.StatusCode != http.StatusOK { 1866 b, _ := ioutil.ReadAll(res.Body) 1867 res.Body.Close() 1868 errRes := &ErrorResponse{Response: res} 1869 err := jsonx.Unmarshal(b, errRes) 1870 if err != nil { 1871 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 1872 } 1873 return nil, errRes 1874 } 1875 var ( 1876 paging Paging 1877 value []ManagedAppStatus 1878 ) 1879 err := jsonx.NewDecoder(res.Body).Decode(&paging) 1880 res.Body.Close() 1881 if err != nil { 1882 return nil, err 1883 } 1884 err = jsonx.Unmarshal(paging.Value, &value) 1885 if err != nil { 1886 return nil, err 1887 } 1888 values = append(values, value...) 1889 if n >= 0 { 1890 n-- 1891 } 1892 if n == 0 || len(paging.NextLink) == 0 { 1893 return values, nil 1894 } 1895 req, err = http.NewRequest("GET", paging.NextLink, nil) 1896 if ctx != nil { 1897 req = req.WithContext(ctx) 1898 } 1899 res, err = r.client.Do(req) 1900 if err != nil { 1901 return nil, err 1902 } 1903 } 1904 } 1905 1906 // GetN performs GET request for ManagedAppStatus collection, max N pages 1907 func (r *DeviceAppManagementManagedAppStatusesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedAppStatus, error) { 1908 var query string 1909 if r.query != nil { 1910 query = "?" + r.query.Encode() 1911 } 1912 return r.Paging(ctx, "GET", query, nil, n) 1913 } 1914 1915 // Get performs GET request for ManagedAppStatus collection 1916 func (r *DeviceAppManagementManagedAppStatusesCollectionRequest) Get(ctx context.Context) ([]ManagedAppStatus, error) { 1917 return r.GetN(ctx, 0) 1918 } 1919 1920 // Add performs POST request for ManagedAppStatus collection 1921 func (r *DeviceAppManagementManagedAppStatusesCollectionRequest) Add(ctx context.Context, reqObj *ManagedAppStatus) (resObj *ManagedAppStatus, err error) { 1922 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 1923 return 1924 } 1925 1926 // ManagedEBookCategories returns request builder for ManagedEBookCategory collection 1927 func (b *DeviceAppManagementRequestBuilder) ManagedEBookCategories() *DeviceAppManagementManagedEBookCategoriesCollectionRequestBuilder { 1928 bb := &DeviceAppManagementManagedEBookCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1929 bb.baseURL += "/managedEBookCategories" 1930 return bb 1931 } 1932 1933 // DeviceAppManagementManagedEBookCategoriesCollectionRequestBuilder is request builder for ManagedEBookCategory collection 1934 type DeviceAppManagementManagedEBookCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder } 1935 1936 // Request returns request for ManagedEBookCategory collection 1937 func (b *DeviceAppManagementManagedEBookCategoriesCollectionRequestBuilder) Request() *DeviceAppManagementManagedEBookCategoriesCollectionRequest { 1938 return &DeviceAppManagementManagedEBookCategoriesCollectionRequest{ 1939 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 1940 } 1941 } 1942 1943 // ID returns request builder for ManagedEBookCategory item 1944 func (b *DeviceAppManagementManagedEBookCategoriesCollectionRequestBuilder) ID(id string) *ManagedEBookCategoryRequestBuilder { 1945 bb := &ManagedEBookCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 1946 bb.baseURL += "/" + id 1947 return bb 1948 } 1949 1950 // DeviceAppManagementManagedEBookCategoriesCollectionRequest is request for ManagedEBookCategory collection 1951 type DeviceAppManagementManagedEBookCategoriesCollectionRequest struct{ BaseRequest } 1952 1953 // Paging perfoms paging operation for ManagedEBookCategory collection 1954 func (r *DeviceAppManagementManagedEBookCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedEBookCategory, error) { 1955 req, err := r.NewJSONRequest(method, path, obj) 1956 if err != nil { 1957 return nil, err 1958 } 1959 if ctx != nil { 1960 req = req.WithContext(ctx) 1961 } 1962 res, err := r.client.Do(req) 1963 if err != nil { 1964 return nil, err 1965 } 1966 var values []ManagedEBookCategory 1967 for { 1968 if res.StatusCode != http.StatusOK { 1969 b, _ := ioutil.ReadAll(res.Body) 1970 res.Body.Close() 1971 errRes := &ErrorResponse{Response: res} 1972 err := jsonx.Unmarshal(b, errRes) 1973 if err != nil { 1974 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 1975 } 1976 return nil, errRes 1977 } 1978 var ( 1979 paging Paging 1980 value []ManagedEBookCategory 1981 ) 1982 err := jsonx.NewDecoder(res.Body).Decode(&paging) 1983 res.Body.Close() 1984 if err != nil { 1985 return nil, err 1986 } 1987 err = jsonx.Unmarshal(paging.Value, &value) 1988 if err != nil { 1989 return nil, err 1990 } 1991 values = append(values, value...) 1992 if n >= 0 { 1993 n-- 1994 } 1995 if n == 0 || len(paging.NextLink) == 0 { 1996 return values, nil 1997 } 1998 req, err = http.NewRequest("GET", paging.NextLink, nil) 1999 if ctx != nil { 2000 req = req.WithContext(ctx) 2001 } 2002 res, err = r.client.Do(req) 2003 if err != nil { 2004 return nil, err 2005 } 2006 } 2007 } 2008 2009 // GetN performs GET request for ManagedEBookCategory collection, max N pages 2010 func (r *DeviceAppManagementManagedEBookCategoriesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedEBookCategory, error) { 2011 var query string 2012 if r.query != nil { 2013 query = "?" + r.query.Encode() 2014 } 2015 return r.Paging(ctx, "GET", query, nil, n) 2016 } 2017 2018 // Get performs GET request for ManagedEBookCategory collection 2019 func (r *DeviceAppManagementManagedEBookCategoriesCollectionRequest) Get(ctx context.Context) ([]ManagedEBookCategory, error) { 2020 return r.GetN(ctx, 0) 2021 } 2022 2023 // Add performs POST request for ManagedEBookCategory collection 2024 func (r *DeviceAppManagementManagedEBookCategoriesCollectionRequest) Add(ctx context.Context, reqObj *ManagedEBookCategory) (resObj *ManagedEBookCategory, err error) { 2025 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 2026 return 2027 } 2028 2029 // ManagedEBooks returns request builder for ManagedEBook collection 2030 func (b *DeviceAppManagementRequestBuilder) ManagedEBooks() *DeviceAppManagementManagedEBooksCollectionRequestBuilder { 2031 bb := &DeviceAppManagementManagedEBooksCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2032 bb.baseURL += "/managedEBooks" 2033 return bb 2034 } 2035 2036 // DeviceAppManagementManagedEBooksCollectionRequestBuilder is request builder for ManagedEBook collection 2037 type DeviceAppManagementManagedEBooksCollectionRequestBuilder struct{ BaseRequestBuilder } 2038 2039 // Request returns request for ManagedEBook collection 2040 func (b *DeviceAppManagementManagedEBooksCollectionRequestBuilder) Request() *DeviceAppManagementManagedEBooksCollectionRequest { 2041 return &DeviceAppManagementManagedEBooksCollectionRequest{ 2042 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 2043 } 2044 } 2045 2046 // ID returns request builder for ManagedEBook item 2047 func (b *DeviceAppManagementManagedEBooksCollectionRequestBuilder) ID(id string) *ManagedEBookRequestBuilder { 2048 bb := &ManagedEBookRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2049 bb.baseURL += "/" + id 2050 return bb 2051 } 2052 2053 // DeviceAppManagementManagedEBooksCollectionRequest is request for ManagedEBook collection 2054 type DeviceAppManagementManagedEBooksCollectionRequest struct{ BaseRequest } 2055 2056 // Paging perfoms paging operation for ManagedEBook collection 2057 func (r *DeviceAppManagementManagedEBooksCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedEBook, error) { 2058 req, err := r.NewJSONRequest(method, path, obj) 2059 if err != nil { 2060 return nil, err 2061 } 2062 if ctx != nil { 2063 req = req.WithContext(ctx) 2064 } 2065 res, err := r.client.Do(req) 2066 if err != nil { 2067 return nil, err 2068 } 2069 var values []ManagedEBook 2070 for { 2071 if res.StatusCode != http.StatusOK { 2072 b, _ := ioutil.ReadAll(res.Body) 2073 res.Body.Close() 2074 errRes := &ErrorResponse{Response: res} 2075 err := jsonx.Unmarshal(b, errRes) 2076 if err != nil { 2077 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 2078 } 2079 return nil, errRes 2080 } 2081 var ( 2082 paging Paging 2083 value []ManagedEBook 2084 ) 2085 err := jsonx.NewDecoder(res.Body).Decode(&paging) 2086 res.Body.Close() 2087 if err != nil { 2088 return nil, err 2089 } 2090 err = jsonx.Unmarshal(paging.Value, &value) 2091 if err != nil { 2092 return nil, err 2093 } 2094 values = append(values, value...) 2095 if n >= 0 { 2096 n-- 2097 } 2098 if n == 0 || len(paging.NextLink) == 0 { 2099 return values, nil 2100 } 2101 req, err = http.NewRequest("GET", paging.NextLink, nil) 2102 if ctx != nil { 2103 req = req.WithContext(ctx) 2104 } 2105 res, err = r.client.Do(req) 2106 if err != nil { 2107 return nil, err 2108 } 2109 } 2110 } 2111 2112 // GetN performs GET request for ManagedEBook collection, max N pages 2113 func (r *DeviceAppManagementManagedEBooksCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedEBook, error) { 2114 var query string 2115 if r.query != nil { 2116 query = "?" + r.query.Encode() 2117 } 2118 return r.Paging(ctx, "GET", query, nil, n) 2119 } 2120 2121 // Get performs GET request for ManagedEBook collection 2122 func (r *DeviceAppManagementManagedEBooksCollectionRequest) Get(ctx context.Context) ([]ManagedEBook, error) { 2123 return r.GetN(ctx, 0) 2124 } 2125 2126 // Add performs POST request for ManagedEBook collection 2127 func (r *DeviceAppManagementManagedEBooksCollectionRequest) Add(ctx context.Context, reqObj *ManagedEBook) (resObj *ManagedEBook, err error) { 2128 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 2129 return 2130 } 2131 2132 // MDMWindowsInformationProtectionPolicies returns request builder for MDMWindowsInformationProtectionPolicy collection 2133 func (b *DeviceAppManagementRequestBuilder) MDMWindowsInformationProtectionPolicies() *DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequestBuilder { 2134 bb := &DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2135 bb.baseURL += "/mdmWindowsInformationProtectionPolicies" 2136 return bb 2137 } 2138 2139 // DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequestBuilder is request builder for MDMWindowsInformationProtectionPolicy collection 2140 type DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequestBuilder struct{ BaseRequestBuilder } 2141 2142 // Request returns request for MDMWindowsInformationProtectionPolicy collection 2143 func (b *DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequestBuilder) Request() *DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequest { 2144 return &DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequest{ 2145 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 2146 } 2147 } 2148 2149 // ID returns request builder for MDMWindowsInformationProtectionPolicy item 2150 func (b *DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequestBuilder) ID(id string) *MDMWindowsInformationProtectionPolicyRequestBuilder { 2151 bb := &MDMWindowsInformationProtectionPolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2152 bb.baseURL += "/" + id 2153 return bb 2154 } 2155 2156 // DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequest is request for MDMWindowsInformationProtectionPolicy collection 2157 type DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequest struct{ BaseRequest } 2158 2159 // Paging perfoms paging operation for MDMWindowsInformationProtectionPolicy collection 2160 func (r *DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]MDMWindowsInformationProtectionPolicy, error) { 2161 req, err := r.NewJSONRequest(method, path, obj) 2162 if err != nil { 2163 return nil, err 2164 } 2165 if ctx != nil { 2166 req = req.WithContext(ctx) 2167 } 2168 res, err := r.client.Do(req) 2169 if err != nil { 2170 return nil, err 2171 } 2172 var values []MDMWindowsInformationProtectionPolicy 2173 for { 2174 if res.StatusCode != http.StatusOK { 2175 b, _ := ioutil.ReadAll(res.Body) 2176 res.Body.Close() 2177 errRes := &ErrorResponse{Response: res} 2178 err := jsonx.Unmarshal(b, errRes) 2179 if err != nil { 2180 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 2181 } 2182 return nil, errRes 2183 } 2184 var ( 2185 paging Paging 2186 value []MDMWindowsInformationProtectionPolicy 2187 ) 2188 err := jsonx.NewDecoder(res.Body).Decode(&paging) 2189 res.Body.Close() 2190 if err != nil { 2191 return nil, err 2192 } 2193 err = jsonx.Unmarshal(paging.Value, &value) 2194 if err != nil { 2195 return nil, err 2196 } 2197 values = append(values, value...) 2198 if n >= 0 { 2199 n-- 2200 } 2201 if n == 0 || len(paging.NextLink) == 0 { 2202 return values, nil 2203 } 2204 req, err = http.NewRequest("GET", paging.NextLink, nil) 2205 if ctx != nil { 2206 req = req.WithContext(ctx) 2207 } 2208 res, err = r.client.Do(req) 2209 if err != nil { 2210 return nil, err 2211 } 2212 } 2213 } 2214 2215 // GetN performs GET request for MDMWindowsInformationProtectionPolicy collection, max N pages 2216 func (r *DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequest) GetN(ctx context.Context, n int) ([]MDMWindowsInformationProtectionPolicy, error) { 2217 var query string 2218 if r.query != nil { 2219 query = "?" + r.query.Encode() 2220 } 2221 return r.Paging(ctx, "GET", query, nil, n) 2222 } 2223 2224 // Get performs GET request for MDMWindowsInformationProtectionPolicy collection 2225 func (r *DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequest) Get(ctx context.Context) ([]MDMWindowsInformationProtectionPolicy, error) { 2226 return r.GetN(ctx, 0) 2227 } 2228 2229 // Add performs POST request for MDMWindowsInformationProtectionPolicy collection 2230 func (r *DeviceAppManagementMDMWindowsInformationProtectionPoliciesCollectionRequest) Add(ctx context.Context, reqObj *MDMWindowsInformationProtectionPolicy) (resObj *MDMWindowsInformationProtectionPolicy, err error) { 2231 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 2232 return 2233 } 2234 2235 // MobileAppCategories returns request builder for MobileAppCategory collection 2236 func (b *DeviceAppManagementRequestBuilder) MobileAppCategories() *DeviceAppManagementMobileAppCategoriesCollectionRequestBuilder { 2237 bb := &DeviceAppManagementMobileAppCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2238 bb.baseURL += "/mobileAppCategories" 2239 return bb 2240 } 2241 2242 // DeviceAppManagementMobileAppCategoriesCollectionRequestBuilder is request builder for MobileAppCategory collection 2243 type DeviceAppManagementMobileAppCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder } 2244 2245 // Request returns request for MobileAppCategory collection 2246 func (b *DeviceAppManagementMobileAppCategoriesCollectionRequestBuilder) Request() *DeviceAppManagementMobileAppCategoriesCollectionRequest { 2247 return &DeviceAppManagementMobileAppCategoriesCollectionRequest{ 2248 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 2249 } 2250 } 2251 2252 // ID returns request builder for MobileAppCategory item 2253 func (b *DeviceAppManagementMobileAppCategoriesCollectionRequestBuilder) ID(id string) *MobileAppCategoryRequestBuilder { 2254 bb := &MobileAppCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2255 bb.baseURL += "/" + id 2256 return bb 2257 } 2258 2259 // DeviceAppManagementMobileAppCategoriesCollectionRequest is request for MobileAppCategory collection 2260 type DeviceAppManagementMobileAppCategoriesCollectionRequest struct{ BaseRequest } 2261 2262 // Paging perfoms paging operation for MobileAppCategory collection 2263 func (r *DeviceAppManagementMobileAppCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]MobileAppCategory, error) { 2264 req, err := r.NewJSONRequest(method, path, obj) 2265 if err != nil { 2266 return nil, err 2267 } 2268 if ctx != nil { 2269 req = req.WithContext(ctx) 2270 } 2271 res, err := r.client.Do(req) 2272 if err != nil { 2273 return nil, err 2274 } 2275 var values []MobileAppCategory 2276 for { 2277 if res.StatusCode != http.StatusOK { 2278 b, _ := ioutil.ReadAll(res.Body) 2279 res.Body.Close() 2280 errRes := &ErrorResponse{Response: res} 2281 err := jsonx.Unmarshal(b, errRes) 2282 if err != nil { 2283 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 2284 } 2285 return nil, errRes 2286 } 2287 var ( 2288 paging Paging 2289 value []MobileAppCategory 2290 ) 2291 err := jsonx.NewDecoder(res.Body).Decode(&paging) 2292 res.Body.Close() 2293 if err != nil { 2294 return nil, err 2295 } 2296 err = jsonx.Unmarshal(paging.Value, &value) 2297 if err != nil { 2298 return nil, err 2299 } 2300 values = append(values, value...) 2301 if n >= 0 { 2302 n-- 2303 } 2304 if n == 0 || len(paging.NextLink) == 0 { 2305 return values, nil 2306 } 2307 req, err = http.NewRequest("GET", paging.NextLink, nil) 2308 if ctx != nil { 2309 req = req.WithContext(ctx) 2310 } 2311 res, err = r.client.Do(req) 2312 if err != nil { 2313 return nil, err 2314 } 2315 } 2316 } 2317 2318 // GetN performs GET request for MobileAppCategory collection, max N pages 2319 func (r *DeviceAppManagementMobileAppCategoriesCollectionRequest) GetN(ctx context.Context, n int) ([]MobileAppCategory, error) { 2320 var query string 2321 if r.query != nil { 2322 query = "?" + r.query.Encode() 2323 } 2324 return r.Paging(ctx, "GET", query, nil, n) 2325 } 2326 2327 // Get performs GET request for MobileAppCategory collection 2328 func (r *DeviceAppManagementMobileAppCategoriesCollectionRequest) Get(ctx context.Context) ([]MobileAppCategory, error) { 2329 return r.GetN(ctx, 0) 2330 } 2331 2332 // Add performs POST request for MobileAppCategory collection 2333 func (r *DeviceAppManagementMobileAppCategoriesCollectionRequest) Add(ctx context.Context, reqObj *MobileAppCategory) (resObj *MobileAppCategory, err error) { 2334 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 2335 return 2336 } 2337 2338 // MobileAppConfigurations returns request builder for ManagedDeviceMobileAppConfiguration collection 2339 func (b *DeviceAppManagementRequestBuilder) MobileAppConfigurations() *DeviceAppManagementMobileAppConfigurationsCollectionRequestBuilder { 2340 bb := &DeviceAppManagementMobileAppConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2341 bb.baseURL += "/mobileAppConfigurations" 2342 return bb 2343 } 2344 2345 // DeviceAppManagementMobileAppConfigurationsCollectionRequestBuilder is request builder for ManagedDeviceMobileAppConfiguration collection 2346 type DeviceAppManagementMobileAppConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } 2347 2348 // Request returns request for ManagedDeviceMobileAppConfiguration collection 2349 func (b *DeviceAppManagementMobileAppConfigurationsCollectionRequestBuilder) Request() *DeviceAppManagementMobileAppConfigurationsCollectionRequest { 2350 return &DeviceAppManagementMobileAppConfigurationsCollectionRequest{ 2351 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 2352 } 2353 } 2354 2355 // ID returns request builder for ManagedDeviceMobileAppConfiguration item 2356 func (b *DeviceAppManagementMobileAppConfigurationsCollectionRequestBuilder) ID(id string) *ManagedDeviceMobileAppConfigurationRequestBuilder { 2357 bb := &ManagedDeviceMobileAppConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2358 bb.baseURL += "/" + id 2359 return bb 2360 } 2361 2362 // DeviceAppManagementMobileAppConfigurationsCollectionRequest is request for ManagedDeviceMobileAppConfiguration collection 2363 type DeviceAppManagementMobileAppConfigurationsCollectionRequest struct{ BaseRequest } 2364 2365 // Paging perfoms paging operation for ManagedDeviceMobileAppConfiguration collection 2366 func (r *DeviceAppManagementMobileAppConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedDeviceMobileAppConfiguration, error) { 2367 req, err := r.NewJSONRequest(method, path, obj) 2368 if err != nil { 2369 return nil, err 2370 } 2371 if ctx != nil { 2372 req = req.WithContext(ctx) 2373 } 2374 res, err := r.client.Do(req) 2375 if err != nil { 2376 return nil, err 2377 } 2378 var values []ManagedDeviceMobileAppConfiguration 2379 for { 2380 if res.StatusCode != http.StatusOK { 2381 b, _ := ioutil.ReadAll(res.Body) 2382 res.Body.Close() 2383 errRes := &ErrorResponse{Response: res} 2384 err := jsonx.Unmarshal(b, errRes) 2385 if err != nil { 2386 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 2387 } 2388 return nil, errRes 2389 } 2390 var ( 2391 paging Paging 2392 value []ManagedDeviceMobileAppConfiguration 2393 ) 2394 err := jsonx.NewDecoder(res.Body).Decode(&paging) 2395 res.Body.Close() 2396 if err != nil { 2397 return nil, err 2398 } 2399 err = jsonx.Unmarshal(paging.Value, &value) 2400 if err != nil { 2401 return nil, err 2402 } 2403 values = append(values, value...) 2404 if n >= 0 { 2405 n-- 2406 } 2407 if n == 0 || len(paging.NextLink) == 0 { 2408 return values, nil 2409 } 2410 req, err = http.NewRequest("GET", paging.NextLink, nil) 2411 if ctx != nil { 2412 req = req.WithContext(ctx) 2413 } 2414 res, err = r.client.Do(req) 2415 if err != nil { 2416 return nil, err 2417 } 2418 } 2419 } 2420 2421 // GetN performs GET request for ManagedDeviceMobileAppConfiguration collection, max N pages 2422 func (r *DeviceAppManagementMobileAppConfigurationsCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedDeviceMobileAppConfiguration, error) { 2423 var query string 2424 if r.query != nil { 2425 query = "?" + r.query.Encode() 2426 } 2427 return r.Paging(ctx, "GET", query, nil, n) 2428 } 2429 2430 // Get performs GET request for ManagedDeviceMobileAppConfiguration collection 2431 func (r *DeviceAppManagementMobileAppConfigurationsCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceMobileAppConfiguration, error) { 2432 return r.GetN(ctx, 0) 2433 } 2434 2435 // Add performs POST request for ManagedDeviceMobileAppConfiguration collection 2436 func (r *DeviceAppManagementMobileAppConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceMobileAppConfiguration) (resObj *ManagedDeviceMobileAppConfiguration, err error) { 2437 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 2438 return 2439 } 2440 2441 // MobileApps returns request builder for MobileApp collection 2442 func (b *DeviceAppManagementRequestBuilder) MobileApps() *DeviceAppManagementMobileAppsCollectionRequestBuilder { 2443 bb := &DeviceAppManagementMobileAppsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2444 bb.baseURL += "/mobileApps" 2445 return bb 2446 } 2447 2448 // DeviceAppManagementMobileAppsCollectionRequestBuilder is request builder for MobileApp collection 2449 type DeviceAppManagementMobileAppsCollectionRequestBuilder struct{ BaseRequestBuilder } 2450 2451 // Request returns request for MobileApp collection 2452 func (b *DeviceAppManagementMobileAppsCollectionRequestBuilder) Request() *DeviceAppManagementMobileAppsCollectionRequest { 2453 return &DeviceAppManagementMobileAppsCollectionRequest{ 2454 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 2455 } 2456 } 2457 2458 // ID returns request builder for MobileApp item 2459 func (b *DeviceAppManagementMobileAppsCollectionRequestBuilder) ID(id string) *MobileAppRequestBuilder { 2460 bb := &MobileAppRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2461 bb.baseURL += "/" + id 2462 return bb 2463 } 2464 2465 // DeviceAppManagementMobileAppsCollectionRequest is request for MobileApp collection 2466 type DeviceAppManagementMobileAppsCollectionRequest struct{ BaseRequest } 2467 2468 // Paging perfoms paging operation for MobileApp collection 2469 func (r *DeviceAppManagementMobileAppsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]MobileApp, error) { 2470 req, err := r.NewJSONRequest(method, path, obj) 2471 if err != nil { 2472 return nil, err 2473 } 2474 if ctx != nil { 2475 req = req.WithContext(ctx) 2476 } 2477 res, err := r.client.Do(req) 2478 if err != nil { 2479 return nil, err 2480 } 2481 var values []MobileApp 2482 for { 2483 if res.StatusCode != http.StatusOK { 2484 b, _ := ioutil.ReadAll(res.Body) 2485 res.Body.Close() 2486 errRes := &ErrorResponse{Response: res} 2487 err := jsonx.Unmarshal(b, errRes) 2488 if err != nil { 2489 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 2490 } 2491 return nil, errRes 2492 } 2493 var ( 2494 paging Paging 2495 value []MobileApp 2496 ) 2497 err := jsonx.NewDecoder(res.Body).Decode(&paging) 2498 res.Body.Close() 2499 if err != nil { 2500 return nil, err 2501 } 2502 err = jsonx.Unmarshal(paging.Value, &value) 2503 if err != nil { 2504 return nil, err 2505 } 2506 values = append(values, value...) 2507 if n >= 0 { 2508 n-- 2509 } 2510 if n == 0 || len(paging.NextLink) == 0 { 2511 return values, nil 2512 } 2513 req, err = http.NewRequest("GET", paging.NextLink, nil) 2514 if ctx != nil { 2515 req = req.WithContext(ctx) 2516 } 2517 res, err = r.client.Do(req) 2518 if err != nil { 2519 return nil, err 2520 } 2521 } 2522 } 2523 2524 // GetN performs GET request for MobileApp collection, max N pages 2525 func (r *DeviceAppManagementMobileAppsCollectionRequest) GetN(ctx context.Context, n int) ([]MobileApp, error) { 2526 var query string 2527 if r.query != nil { 2528 query = "?" + r.query.Encode() 2529 } 2530 return r.Paging(ctx, "GET", query, nil, n) 2531 } 2532 2533 // Get performs GET request for MobileApp collection 2534 func (r *DeviceAppManagementMobileAppsCollectionRequest) Get(ctx context.Context) ([]MobileApp, error) { 2535 return r.GetN(ctx, 0) 2536 } 2537 2538 // Add performs POST request for MobileApp collection 2539 func (r *DeviceAppManagementMobileAppsCollectionRequest) Add(ctx context.Context, reqObj *MobileApp) (resObj *MobileApp, err error) { 2540 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 2541 return 2542 } 2543 2544 // PolicySets returns request builder for PolicySet collection 2545 func (b *DeviceAppManagementRequestBuilder) PolicySets() *DeviceAppManagementPolicySetsCollectionRequestBuilder { 2546 bb := &DeviceAppManagementPolicySetsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2547 bb.baseURL += "/policySets" 2548 return bb 2549 } 2550 2551 // DeviceAppManagementPolicySetsCollectionRequestBuilder is request builder for PolicySet collection 2552 type DeviceAppManagementPolicySetsCollectionRequestBuilder struct{ BaseRequestBuilder } 2553 2554 // Request returns request for PolicySet collection 2555 func (b *DeviceAppManagementPolicySetsCollectionRequestBuilder) Request() *DeviceAppManagementPolicySetsCollectionRequest { 2556 return &DeviceAppManagementPolicySetsCollectionRequest{ 2557 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 2558 } 2559 } 2560 2561 // ID returns request builder for PolicySet item 2562 func (b *DeviceAppManagementPolicySetsCollectionRequestBuilder) ID(id string) *PolicySetRequestBuilder { 2563 bb := &PolicySetRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2564 bb.baseURL += "/" + id 2565 return bb 2566 } 2567 2568 // DeviceAppManagementPolicySetsCollectionRequest is request for PolicySet collection 2569 type DeviceAppManagementPolicySetsCollectionRequest struct{ BaseRequest } 2570 2571 // Paging perfoms paging operation for PolicySet collection 2572 func (r *DeviceAppManagementPolicySetsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]PolicySet, error) { 2573 req, err := r.NewJSONRequest(method, path, obj) 2574 if err != nil { 2575 return nil, err 2576 } 2577 if ctx != nil { 2578 req = req.WithContext(ctx) 2579 } 2580 res, err := r.client.Do(req) 2581 if err != nil { 2582 return nil, err 2583 } 2584 var values []PolicySet 2585 for { 2586 if res.StatusCode != http.StatusOK { 2587 b, _ := ioutil.ReadAll(res.Body) 2588 res.Body.Close() 2589 errRes := &ErrorResponse{Response: res} 2590 err := jsonx.Unmarshal(b, errRes) 2591 if err != nil { 2592 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 2593 } 2594 return nil, errRes 2595 } 2596 var ( 2597 paging Paging 2598 value []PolicySet 2599 ) 2600 err := jsonx.NewDecoder(res.Body).Decode(&paging) 2601 res.Body.Close() 2602 if err != nil { 2603 return nil, err 2604 } 2605 err = jsonx.Unmarshal(paging.Value, &value) 2606 if err != nil { 2607 return nil, err 2608 } 2609 values = append(values, value...) 2610 if n >= 0 { 2611 n-- 2612 } 2613 if n == 0 || len(paging.NextLink) == 0 { 2614 return values, nil 2615 } 2616 req, err = http.NewRequest("GET", paging.NextLink, nil) 2617 if ctx != nil { 2618 req = req.WithContext(ctx) 2619 } 2620 res, err = r.client.Do(req) 2621 if err != nil { 2622 return nil, err 2623 } 2624 } 2625 } 2626 2627 // GetN performs GET request for PolicySet collection, max N pages 2628 func (r *DeviceAppManagementPolicySetsCollectionRequest) GetN(ctx context.Context, n int) ([]PolicySet, error) { 2629 var query string 2630 if r.query != nil { 2631 query = "?" + r.query.Encode() 2632 } 2633 return r.Paging(ctx, "GET", query, nil, n) 2634 } 2635 2636 // Get performs GET request for PolicySet collection 2637 func (r *DeviceAppManagementPolicySetsCollectionRequest) Get(ctx context.Context) ([]PolicySet, error) { 2638 return r.GetN(ctx, 0) 2639 } 2640 2641 // Add performs POST request for PolicySet collection 2642 func (r *DeviceAppManagementPolicySetsCollectionRequest) Add(ctx context.Context, reqObj *PolicySet) (resObj *PolicySet, err error) { 2643 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 2644 return 2645 } 2646 2647 // SideLoadingKeys returns request builder for SideLoadingKey collection 2648 func (b *DeviceAppManagementRequestBuilder) SideLoadingKeys() *DeviceAppManagementSideLoadingKeysCollectionRequestBuilder { 2649 bb := &DeviceAppManagementSideLoadingKeysCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2650 bb.baseURL += "/sideLoadingKeys" 2651 return bb 2652 } 2653 2654 // DeviceAppManagementSideLoadingKeysCollectionRequestBuilder is request builder for SideLoadingKey collection 2655 type DeviceAppManagementSideLoadingKeysCollectionRequestBuilder struct{ BaseRequestBuilder } 2656 2657 // Request returns request for SideLoadingKey collection 2658 func (b *DeviceAppManagementSideLoadingKeysCollectionRequestBuilder) Request() *DeviceAppManagementSideLoadingKeysCollectionRequest { 2659 return &DeviceAppManagementSideLoadingKeysCollectionRequest{ 2660 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 2661 } 2662 } 2663 2664 // ID returns request builder for SideLoadingKey item 2665 func (b *DeviceAppManagementSideLoadingKeysCollectionRequestBuilder) ID(id string) *SideLoadingKeyRequestBuilder { 2666 bb := &SideLoadingKeyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2667 bb.baseURL += "/" + id 2668 return bb 2669 } 2670 2671 // DeviceAppManagementSideLoadingKeysCollectionRequest is request for SideLoadingKey collection 2672 type DeviceAppManagementSideLoadingKeysCollectionRequest struct{ BaseRequest } 2673 2674 // Paging perfoms paging operation for SideLoadingKey collection 2675 func (r *DeviceAppManagementSideLoadingKeysCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]SideLoadingKey, error) { 2676 req, err := r.NewJSONRequest(method, path, obj) 2677 if err != nil { 2678 return nil, err 2679 } 2680 if ctx != nil { 2681 req = req.WithContext(ctx) 2682 } 2683 res, err := r.client.Do(req) 2684 if err != nil { 2685 return nil, err 2686 } 2687 var values []SideLoadingKey 2688 for { 2689 if res.StatusCode != http.StatusOK { 2690 b, _ := ioutil.ReadAll(res.Body) 2691 res.Body.Close() 2692 errRes := &ErrorResponse{Response: res} 2693 err := jsonx.Unmarshal(b, errRes) 2694 if err != nil { 2695 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 2696 } 2697 return nil, errRes 2698 } 2699 var ( 2700 paging Paging 2701 value []SideLoadingKey 2702 ) 2703 err := jsonx.NewDecoder(res.Body).Decode(&paging) 2704 res.Body.Close() 2705 if err != nil { 2706 return nil, err 2707 } 2708 err = jsonx.Unmarshal(paging.Value, &value) 2709 if err != nil { 2710 return nil, err 2711 } 2712 values = append(values, value...) 2713 if n >= 0 { 2714 n-- 2715 } 2716 if n == 0 || len(paging.NextLink) == 0 { 2717 return values, nil 2718 } 2719 req, err = http.NewRequest("GET", paging.NextLink, nil) 2720 if ctx != nil { 2721 req = req.WithContext(ctx) 2722 } 2723 res, err = r.client.Do(req) 2724 if err != nil { 2725 return nil, err 2726 } 2727 } 2728 } 2729 2730 // GetN performs GET request for SideLoadingKey collection, max N pages 2731 func (r *DeviceAppManagementSideLoadingKeysCollectionRequest) GetN(ctx context.Context, n int) ([]SideLoadingKey, error) { 2732 var query string 2733 if r.query != nil { 2734 query = "?" + r.query.Encode() 2735 } 2736 return r.Paging(ctx, "GET", query, nil, n) 2737 } 2738 2739 // Get performs GET request for SideLoadingKey collection 2740 func (r *DeviceAppManagementSideLoadingKeysCollectionRequest) Get(ctx context.Context) ([]SideLoadingKey, error) { 2741 return r.GetN(ctx, 0) 2742 } 2743 2744 // Add performs POST request for SideLoadingKey collection 2745 func (r *DeviceAppManagementSideLoadingKeysCollectionRequest) Add(ctx context.Context, reqObj *SideLoadingKey) (resObj *SideLoadingKey, err error) { 2746 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 2747 return 2748 } 2749 2750 // SymantecCodeSigningCertificate is navigation property 2751 func (b *DeviceAppManagementRequestBuilder) SymantecCodeSigningCertificate() *SymantecCodeSigningCertificateRequestBuilder { 2752 bb := &SymantecCodeSigningCertificateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2753 bb.baseURL += "/symantecCodeSigningCertificate" 2754 return bb 2755 } 2756 2757 // TargetedManagedAppConfigurations returns request builder for TargetedManagedAppConfiguration collection 2758 func (b *DeviceAppManagementRequestBuilder) TargetedManagedAppConfigurations() *DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequestBuilder { 2759 bb := &DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2760 bb.baseURL += "/targetedManagedAppConfigurations" 2761 return bb 2762 } 2763 2764 // DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequestBuilder is request builder for TargetedManagedAppConfiguration collection 2765 type DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } 2766 2767 // Request returns request for TargetedManagedAppConfiguration collection 2768 func (b *DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequestBuilder) Request() *DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequest { 2769 return &DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequest{ 2770 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 2771 } 2772 } 2773 2774 // ID returns request builder for TargetedManagedAppConfiguration item 2775 func (b *DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequestBuilder) ID(id string) *TargetedManagedAppConfigurationRequestBuilder { 2776 bb := &TargetedManagedAppConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2777 bb.baseURL += "/" + id 2778 return bb 2779 } 2780 2781 // DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequest is request for TargetedManagedAppConfiguration collection 2782 type DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequest struct{ BaseRequest } 2783 2784 // Paging perfoms paging operation for TargetedManagedAppConfiguration collection 2785 func (r *DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]TargetedManagedAppConfiguration, error) { 2786 req, err := r.NewJSONRequest(method, path, obj) 2787 if err != nil { 2788 return nil, err 2789 } 2790 if ctx != nil { 2791 req = req.WithContext(ctx) 2792 } 2793 res, err := r.client.Do(req) 2794 if err != nil { 2795 return nil, err 2796 } 2797 var values []TargetedManagedAppConfiguration 2798 for { 2799 if res.StatusCode != http.StatusOK { 2800 b, _ := ioutil.ReadAll(res.Body) 2801 res.Body.Close() 2802 errRes := &ErrorResponse{Response: res} 2803 err := jsonx.Unmarshal(b, errRes) 2804 if err != nil { 2805 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 2806 } 2807 return nil, errRes 2808 } 2809 var ( 2810 paging Paging 2811 value []TargetedManagedAppConfiguration 2812 ) 2813 err := jsonx.NewDecoder(res.Body).Decode(&paging) 2814 res.Body.Close() 2815 if err != nil { 2816 return nil, err 2817 } 2818 err = jsonx.Unmarshal(paging.Value, &value) 2819 if err != nil { 2820 return nil, err 2821 } 2822 values = append(values, value...) 2823 if n >= 0 { 2824 n-- 2825 } 2826 if n == 0 || len(paging.NextLink) == 0 { 2827 return values, nil 2828 } 2829 req, err = http.NewRequest("GET", paging.NextLink, nil) 2830 if ctx != nil { 2831 req = req.WithContext(ctx) 2832 } 2833 res, err = r.client.Do(req) 2834 if err != nil { 2835 return nil, err 2836 } 2837 } 2838 } 2839 2840 // GetN performs GET request for TargetedManagedAppConfiguration collection, max N pages 2841 func (r *DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequest) GetN(ctx context.Context, n int) ([]TargetedManagedAppConfiguration, error) { 2842 var query string 2843 if r.query != nil { 2844 query = "?" + r.query.Encode() 2845 } 2846 return r.Paging(ctx, "GET", query, nil, n) 2847 } 2848 2849 // Get performs GET request for TargetedManagedAppConfiguration collection 2850 func (r *DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequest) Get(ctx context.Context) ([]TargetedManagedAppConfiguration, error) { 2851 return r.GetN(ctx, 0) 2852 } 2853 2854 // Add performs POST request for TargetedManagedAppConfiguration collection 2855 func (r *DeviceAppManagementTargetedManagedAppConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *TargetedManagedAppConfiguration) (resObj *TargetedManagedAppConfiguration, err error) { 2856 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 2857 return 2858 } 2859 2860 // VPPTokens returns request builder for VPPToken collection 2861 func (b *DeviceAppManagementRequestBuilder) VPPTokens() *DeviceAppManagementVPPTokensCollectionRequestBuilder { 2862 bb := &DeviceAppManagementVPPTokensCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2863 bb.baseURL += "/vppTokens" 2864 return bb 2865 } 2866 2867 // DeviceAppManagementVPPTokensCollectionRequestBuilder is request builder for VPPToken collection 2868 type DeviceAppManagementVPPTokensCollectionRequestBuilder struct{ BaseRequestBuilder } 2869 2870 // Request returns request for VPPToken collection 2871 func (b *DeviceAppManagementVPPTokensCollectionRequestBuilder) Request() *DeviceAppManagementVPPTokensCollectionRequest { 2872 return &DeviceAppManagementVPPTokensCollectionRequest{ 2873 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 2874 } 2875 } 2876 2877 // ID returns request builder for VPPToken item 2878 func (b *DeviceAppManagementVPPTokensCollectionRequestBuilder) ID(id string) *VPPTokenRequestBuilder { 2879 bb := &VPPTokenRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2880 bb.baseURL += "/" + id 2881 return bb 2882 } 2883 2884 // DeviceAppManagementVPPTokensCollectionRequest is request for VPPToken collection 2885 type DeviceAppManagementVPPTokensCollectionRequest struct{ BaseRequest } 2886 2887 // Paging perfoms paging operation for VPPToken collection 2888 func (r *DeviceAppManagementVPPTokensCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]VPPToken, error) { 2889 req, err := r.NewJSONRequest(method, path, obj) 2890 if err != nil { 2891 return nil, err 2892 } 2893 if ctx != nil { 2894 req = req.WithContext(ctx) 2895 } 2896 res, err := r.client.Do(req) 2897 if err != nil { 2898 return nil, err 2899 } 2900 var values []VPPToken 2901 for { 2902 if res.StatusCode != http.StatusOK { 2903 b, _ := ioutil.ReadAll(res.Body) 2904 res.Body.Close() 2905 errRes := &ErrorResponse{Response: res} 2906 err := jsonx.Unmarshal(b, errRes) 2907 if err != nil { 2908 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 2909 } 2910 return nil, errRes 2911 } 2912 var ( 2913 paging Paging 2914 value []VPPToken 2915 ) 2916 err := jsonx.NewDecoder(res.Body).Decode(&paging) 2917 res.Body.Close() 2918 if err != nil { 2919 return nil, err 2920 } 2921 err = jsonx.Unmarshal(paging.Value, &value) 2922 if err != nil { 2923 return nil, err 2924 } 2925 values = append(values, value...) 2926 if n >= 0 { 2927 n-- 2928 } 2929 if n == 0 || len(paging.NextLink) == 0 { 2930 return values, nil 2931 } 2932 req, err = http.NewRequest("GET", paging.NextLink, nil) 2933 if ctx != nil { 2934 req = req.WithContext(ctx) 2935 } 2936 res, err = r.client.Do(req) 2937 if err != nil { 2938 return nil, err 2939 } 2940 } 2941 } 2942 2943 // GetN performs GET request for VPPToken collection, max N pages 2944 func (r *DeviceAppManagementVPPTokensCollectionRequest) GetN(ctx context.Context, n int) ([]VPPToken, error) { 2945 var query string 2946 if r.query != nil { 2947 query = "?" + r.query.Encode() 2948 } 2949 return r.Paging(ctx, "GET", query, nil, n) 2950 } 2951 2952 // Get performs GET request for VPPToken collection 2953 func (r *DeviceAppManagementVPPTokensCollectionRequest) Get(ctx context.Context) ([]VPPToken, error) { 2954 return r.GetN(ctx, 0) 2955 } 2956 2957 // Add performs POST request for VPPToken collection 2958 func (r *DeviceAppManagementVPPTokensCollectionRequest) Add(ctx context.Context, reqObj *VPPToken) (resObj *VPPToken, err error) { 2959 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 2960 return 2961 } 2962 2963 // WdacSupplementalPolicies returns request builder for WindowsDefenderApplicationControlSupplementalPolicy collection 2964 func (b *DeviceAppManagementRequestBuilder) WdacSupplementalPolicies() *DeviceAppManagementWdacSupplementalPoliciesCollectionRequestBuilder { 2965 bb := &DeviceAppManagementWdacSupplementalPoliciesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2966 bb.baseURL += "/wdacSupplementalPolicies" 2967 return bb 2968 } 2969 2970 // DeviceAppManagementWdacSupplementalPoliciesCollectionRequestBuilder is request builder for WindowsDefenderApplicationControlSupplementalPolicy collection 2971 type DeviceAppManagementWdacSupplementalPoliciesCollectionRequestBuilder struct{ BaseRequestBuilder } 2972 2973 // Request returns request for WindowsDefenderApplicationControlSupplementalPolicy collection 2974 func (b *DeviceAppManagementWdacSupplementalPoliciesCollectionRequestBuilder) Request() *DeviceAppManagementWdacSupplementalPoliciesCollectionRequest { 2975 return &DeviceAppManagementWdacSupplementalPoliciesCollectionRequest{ 2976 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 2977 } 2978 } 2979 2980 // ID returns request builder for WindowsDefenderApplicationControlSupplementalPolicy item 2981 func (b *DeviceAppManagementWdacSupplementalPoliciesCollectionRequestBuilder) ID(id string) *WindowsDefenderApplicationControlSupplementalPolicyRequestBuilder { 2982 bb := &WindowsDefenderApplicationControlSupplementalPolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 2983 bb.baseURL += "/" + id 2984 return bb 2985 } 2986 2987 // DeviceAppManagementWdacSupplementalPoliciesCollectionRequest is request for WindowsDefenderApplicationControlSupplementalPolicy collection 2988 type DeviceAppManagementWdacSupplementalPoliciesCollectionRequest struct{ BaseRequest } 2989 2990 // Paging perfoms paging operation for WindowsDefenderApplicationControlSupplementalPolicy collection 2991 func (r *DeviceAppManagementWdacSupplementalPoliciesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]WindowsDefenderApplicationControlSupplementalPolicy, error) { 2992 req, err := r.NewJSONRequest(method, path, obj) 2993 if err != nil { 2994 return nil, err 2995 } 2996 if ctx != nil { 2997 req = req.WithContext(ctx) 2998 } 2999 res, err := r.client.Do(req) 3000 if err != nil { 3001 return nil, err 3002 } 3003 var values []WindowsDefenderApplicationControlSupplementalPolicy 3004 for { 3005 if res.StatusCode != http.StatusOK { 3006 b, _ := ioutil.ReadAll(res.Body) 3007 res.Body.Close() 3008 errRes := &ErrorResponse{Response: res} 3009 err := jsonx.Unmarshal(b, errRes) 3010 if err != nil { 3011 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 3012 } 3013 return nil, errRes 3014 } 3015 var ( 3016 paging Paging 3017 value []WindowsDefenderApplicationControlSupplementalPolicy 3018 ) 3019 err := jsonx.NewDecoder(res.Body).Decode(&paging) 3020 res.Body.Close() 3021 if err != nil { 3022 return nil, err 3023 } 3024 err = jsonx.Unmarshal(paging.Value, &value) 3025 if err != nil { 3026 return nil, err 3027 } 3028 values = append(values, value...) 3029 if n >= 0 { 3030 n-- 3031 } 3032 if n == 0 || len(paging.NextLink) == 0 { 3033 return values, nil 3034 } 3035 req, err = http.NewRequest("GET", paging.NextLink, nil) 3036 if ctx != nil { 3037 req = req.WithContext(ctx) 3038 } 3039 res, err = r.client.Do(req) 3040 if err != nil { 3041 return nil, err 3042 } 3043 } 3044 } 3045 3046 // GetN performs GET request for WindowsDefenderApplicationControlSupplementalPolicy collection, max N pages 3047 func (r *DeviceAppManagementWdacSupplementalPoliciesCollectionRequest) GetN(ctx context.Context, n int) ([]WindowsDefenderApplicationControlSupplementalPolicy, error) { 3048 var query string 3049 if r.query != nil { 3050 query = "?" + r.query.Encode() 3051 } 3052 return r.Paging(ctx, "GET", query, nil, n) 3053 } 3054 3055 // Get performs GET request for WindowsDefenderApplicationControlSupplementalPolicy collection 3056 func (r *DeviceAppManagementWdacSupplementalPoliciesCollectionRequest) Get(ctx context.Context) ([]WindowsDefenderApplicationControlSupplementalPolicy, error) { 3057 return r.GetN(ctx, 0) 3058 } 3059 3060 // Add performs POST request for WindowsDefenderApplicationControlSupplementalPolicy collection 3061 func (r *DeviceAppManagementWdacSupplementalPoliciesCollectionRequest) Add(ctx context.Context, reqObj *WindowsDefenderApplicationControlSupplementalPolicy) (resObj *WindowsDefenderApplicationControlSupplementalPolicy, err error) { 3062 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 3063 return 3064 } 3065 3066 // WindowsInformationProtectionDeviceRegistrations returns request builder for WindowsInformationProtectionDeviceRegistration collection 3067 func (b *DeviceAppManagementRequestBuilder) WindowsInformationProtectionDeviceRegistrations() *DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequestBuilder { 3068 bb := &DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3069 bb.baseURL += "/windowsInformationProtectionDeviceRegistrations" 3070 return bb 3071 } 3072 3073 // DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequestBuilder is request builder for WindowsInformationProtectionDeviceRegistration collection 3074 type DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequestBuilder struct{ BaseRequestBuilder } 3075 3076 // Request returns request for WindowsInformationProtectionDeviceRegistration collection 3077 func (b *DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequestBuilder) Request() *DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequest { 3078 return &DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequest{ 3079 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 3080 } 3081 } 3082 3083 // ID returns request builder for WindowsInformationProtectionDeviceRegistration item 3084 func (b *DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequestBuilder) ID(id string) *WindowsInformationProtectionDeviceRegistrationRequestBuilder { 3085 bb := &WindowsInformationProtectionDeviceRegistrationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3086 bb.baseURL += "/" + id 3087 return bb 3088 } 3089 3090 // DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequest is request for WindowsInformationProtectionDeviceRegistration collection 3091 type DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequest struct{ BaseRequest } 3092 3093 // Paging perfoms paging operation for WindowsInformationProtectionDeviceRegistration collection 3094 func (r *DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]WindowsInformationProtectionDeviceRegistration, error) { 3095 req, err := r.NewJSONRequest(method, path, obj) 3096 if err != nil { 3097 return nil, err 3098 } 3099 if ctx != nil { 3100 req = req.WithContext(ctx) 3101 } 3102 res, err := r.client.Do(req) 3103 if err != nil { 3104 return nil, err 3105 } 3106 var values []WindowsInformationProtectionDeviceRegistration 3107 for { 3108 if res.StatusCode != http.StatusOK { 3109 b, _ := ioutil.ReadAll(res.Body) 3110 res.Body.Close() 3111 errRes := &ErrorResponse{Response: res} 3112 err := jsonx.Unmarshal(b, errRes) 3113 if err != nil { 3114 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 3115 } 3116 return nil, errRes 3117 } 3118 var ( 3119 paging Paging 3120 value []WindowsInformationProtectionDeviceRegistration 3121 ) 3122 err := jsonx.NewDecoder(res.Body).Decode(&paging) 3123 res.Body.Close() 3124 if err != nil { 3125 return nil, err 3126 } 3127 err = jsonx.Unmarshal(paging.Value, &value) 3128 if err != nil { 3129 return nil, err 3130 } 3131 values = append(values, value...) 3132 if n >= 0 { 3133 n-- 3134 } 3135 if n == 0 || len(paging.NextLink) == 0 { 3136 return values, nil 3137 } 3138 req, err = http.NewRequest("GET", paging.NextLink, nil) 3139 if ctx != nil { 3140 req = req.WithContext(ctx) 3141 } 3142 res, err = r.client.Do(req) 3143 if err != nil { 3144 return nil, err 3145 } 3146 } 3147 } 3148 3149 // GetN performs GET request for WindowsInformationProtectionDeviceRegistration collection, max N pages 3150 func (r *DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequest) GetN(ctx context.Context, n int) ([]WindowsInformationProtectionDeviceRegistration, error) { 3151 var query string 3152 if r.query != nil { 3153 query = "?" + r.query.Encode() 3154 } 3155 return r.Paging(ctx, "GET", query, nil, n) 3156 } 3157 3158 // Get performs GET request for WindowsInformationProtectionDeviceRegistration collection 3159 func (r *DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequest) Get(ctx context.Context) ([]WindowsInformationProtectionDeviceRegistration, error) { 3160 return r.GetN(ctx, 0) 3161 } 3162 3163 // Add performs POST request for WindowsInformationProtectionDeviceRegistration collection 3164 func (r *DeviceAppManagementWindowsInformationProtectionDeviceRegistrationsCollectionRequest) Add(ctx context.Context, reqObj *WindowsInformationProtectionDeviceRegistration) (resObj *WindowsInformationProtectionDeviceRegistration, err error) { 3165 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 3166 return 3167 } 3168 3169 // WindowsInformationProtectionPolicies returns request builder for WindowsInformationProtectionPolicy collection 3170 func (b *DeviceAppManagementRequestBuilder) WindowsInformationProtectionPolicies() *DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequestBuilder { 3171 bb := &DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3172 bb.baseURL += "/windowsInformationProtectionPolicies" 3173 return bb 3174 } 3175 3176 // DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequestBuilder is request builder for WindowsInformationProtectionPolicy collection 3177 type DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequestBuilder struct{ BaseRequestBuilder } 3178 3179 // Request returns request for WindowsInformationProtectionPolicy collection 3180 func (b *DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequestBuilder) Request() *DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequest { 3181 return &DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequest{ 3182 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 3183 } 3184 } 3185 3186 // ID returns request builder for WindowsInformationProtectionPolicy item 3187 func (b *DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequestBuilder) ID(id string) *WindowsInformationProtectionPolicyRequestBuilder { 3188 bb := &WindowsInformationProtectionPolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3189 bb.baseURL += "/" + id 3190 return bb 3191 } 3192 3193 // DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequest is request for WindowsInformationProtectionPolicy collection 3194 type DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequest struct{ BaseRequest } 3195 3196 // Paging perfoms paging operation for WindowsInformationProtectionPolicy collection 3197 func (r *DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]WindowsInformationProtectionPolicy, error) { 3198 req, err := r.NewJSONRequest(method, path, obj) 3199 if err != nil { 3200 return nil, err 3201 } 3202 if ctx != nil { 3203 req = req.WithContext(ctx) 3204 } 3205 res, err := r.client.Do(req) 3206 if err != nil { 3207 return nil, err 3208 } 3209 var values []WindowsInformationProtectionPolicy 3210 for { 3211 if res.StatusCode != http.StatusOK { 3212 b, _ := ioutil.ReadAll(res.Body) 3213 res.Body.Close() 3214 errRes := &ErrorResponse{Response: res} 3215 err := jsonx.Unmarshal(b, errRes) 3216 if err != nil { 3217 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 3218 } 3219 return nil, errRes 3220 } 3221 var ( 3222 paging Paging 3223 value []WindowsInformationProtectionPolicy 3224 ) 3225 err := jsonx.NewDecoder(res.Body).Decode(&paging) 3226 res.Body.Close() 3227 if err != nil { 3228 return nil, err 3229 } 3230 err = jsonx.Unmarshal(paging.Value, &value) 3231 if err != nil { 3232 return nil, err 3233 } 3234 values = append(values, value...) 3235 if n >= 0 { 3236 n-- 3237 } 3238 if n == 0 || len(paging.NextLink) == 0 { 3239 return values, nil 3240 } 3241 req, err = http.NewRequest("GET", paging.NextLink, nil) 3242 if ctx != nil { 3243 req = req.WithContext(ctx) 3244 } 3245 res, err = r.client.Do(req) 3246 if err != nil { 3247 return nil, err 3248 } 3249 } 3250 } 3251 3252 // GetN performs GET request for WindowsInformationProtectionPolicy collection, max N pages 3253 func (r *DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequest) GetN(ctx context.Context, n int) ([]WindowsInformationProtectionPolicy, error) { 3254 var query string 3255 if r.query != nil { 3256 query = "?" + r.query.Encode() 3257 } 3258 return r.Paging(ctx, "GET", query, nil, n) 3259 } 3260 3261 // Get performs GET request for WindowsInformationProtectionPolicy collection 3262 func (r *DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequest) Get(ctx context.Context) ([]WindowsInformationProtectionPolicy, error) { 3263 return r.GetN(ctx, 0) 3264 } 3265 3266 // Add performs POST request for WindowsInformationProtectionPolicy collection 3267 func (r *DeviceAppManagementWindowsInformationProtectionPoliciesCollectionRequest) Add(ctx context.Context, reqObj *WindowsInformationProtectionPolicy) (resObj *WindowsInformationProtectionPolicy, err error) { 3268 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 3269 return 3270 } 3271 3272 // WindowsInformationProtectionWipeActions returns request builder for WindowsInformationProtectionWipeAction collection 3273 func (b *DeviceAppManagementRequestBuilder) WindowsInformationProtectionWipeActions() *DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequestBuilder { 3274 bb := &DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3275 bb.baseURL += "/windowsInformationProtectionWipeActions" 3276 return bb 3277 } 3278 3279 // DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequestBuilder is request builder for WindowsInformationProtectionWipeAction collection 3280 type DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequestBuilder struct{ BaseRequestBuilder } 3281 3282 // Request returns request for WindowsInformationProtectionWipeAction collection 3283 func (b *DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequestBuilder) Request() *DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequest { 3284 return &DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequest{ 3285 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 3286 } 3287 } 3288 3289 // ID returns request builder for WindowsInformationProtectionWipeAction item 3290 func (b *DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequestBuilder) ID(id string) *WindowsInformationProtectionWipeActionRequestBuilder { 3291 bb := &WindowsInformationProtectionWipeActionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3292 bb.baseURL += "/" + id 3293 return bb 3294 } 3295 3296 // DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequest is request for WindowsInformationProtectionWipeAction collection 3297 type DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequest struct{ BaseRequest } 3298 3299 // Paging perfoms paging operation for WindowsInformationProtectionWipeAction collection 3300 func (r *DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]WindowsInformationProtectionWipeAction, error) { 3301 req, err := r.NewJSONRequest(method, path, obj) 3302 if err != nil { 3303 return nil, err 3304 } 3305 if ctx != nil { 3306 req = req.WithContext(ctx) 3307 } 3308 res, err := r.client.Do(req) 3309 if err != nil { 3310 return nil, err 3311 } 3312 var values []WindowsInformationProtectionWipeAction 3313 for { 3314 if res.StatusCode != http.StatusOK { 3315 b, _ := ioutil.ReadAll(res.Body) 3316 res.Body.Close() 3317 errRes := &ErrorResponse{Response: res} 3318 err := jsonx.Unmarshal(b, errRes) 3319 if err != nil { 3320 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 3321 } 3322 return nil, errRes 3323 } 3324 var ( 3325 paging Paging 3326 value []WindowsInformationProtectionWipeAction 3327 ) 3328 err := jsonx.NewDecoder(res.Body).Decode(&paging) 3329 res.Body.Close() 3330 if err != nil { 3331 return nil, err 3332 } 3333 err = jsonx.Unmarshal(paging.Value, &value) 3334 if err != nil { 3335 return nil, err 3336 } 3337 values = append(values, value...) 3338 if n >= 0 { 3339 n-- 3340 } 3341 if n == 0 || len(paging.NextLink) == 0 { 3342 return values, nil 3343 } 3344 req, err = http.NewRequest("GET", paging.NextLink, nil) 3345 if ctx != nil { 3346 req = req.WithContext(ctx) 3347 } 3348 res, err = r.client.Do(req) 3349 if err != nil { 3350 return nil, err 3351 } 3352 } 3353 } 3354 3355 // GetN performs GET request for WindowsInformationProtectionWipeAction collection, max N pages 3356 func (r *DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequest) GetN(ctx context.Context, n int) ([]WindowsInformationProtectionWipeAction, error) { 3357 var query string 3358 if r.query != nil { 3359 query = "?" + r.query.Encode() 3360 } 3361 return r.Paging(ctx, "GET", query, nil, n) 3362 } 3363 3364 // Get performs GET request for WindowsInformationProtectionWipeAction collection 3365 func (r *DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequest) Get(ctx context.Context) ([]WindowsInformationProtectionWipeAction, error) { 3366 return r.GetN(ctx, 0) 3367 } 3368 3369 // Add performs POST request for WindowsInformationProtectionWipeAction collection 3370 func (r *DeviceAppManagementWindowsInformationProtectionWipeActionsCollectionRequest) Add(ctx context.Context, reqObj *WindowsInformationProtectionWipeAction) (resObj *WindowsInformationProtectionWipeAction, err error) { 3371 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 3372 return 3373 } 3374 3375 // WindowsManagementApp is navigation property 3376 func (b *DeviceAppManagementRequestBuilder) WindowsManagementApp() *WindowsManagementAppRequestBuilder { 3377 bb := &WindowsManagementAppRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3378 bb.baseURL += "/windowsManagementApp" 3379 return bb 3380 } 3381 3382 // Assignments returns request builder for DeviceCompliancePolicyAssignment collection 3383 func (b *DeviceCompliancePolicyRequestBuilder) Assignments() *DeviceCompliancePolicyAssignmentsCollectionRequestBuilder { 3384 bb := &DeviceCompliancePolicyAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3385 bb.baseURL += "/assignments" 3386 return bb 3387 } 3388 3389 // DeviceCompliancePolicyAssignmentsCollectionRequestBuilder is request builder for DeviceCompliancePolicyAssignment collection 3390 type DeviceCompliancePolicyAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder } 3391 3392 // Request returns request for DeviceCompliancePolicyAssignment collection 3393 func (b *DeviceCompliancePolicyAssignmentsCollectionRequestBuilder) Request() *DeviceCompliancePolicyAssignmentsCollectionRequest { 3394 return &DeviceCompliancePolicyAssignmentsCollectionRequest{ 3395 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 3396 } 3397 } 3398 3399 // ID returns request builder for DeviceCompliancePolicyAssignment item 3400 func (b *DeviceCompliancePolicyAssignmentsCollectionRequestBuilder) ID(id string) *DeviceCompliancePolicyAssignmentRequestBuilder { 3401 bb := &DeviceCompliancePolicyAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3402 bb.baseURL += "/" + id 3403 return bb 3404 } 3405 3406 // DeviceCompliancePolicyAssignmentsCollectionRequest is request for DeviceCompliancePolicyAssignment collection 3407 type DeviceCompliancePolicyAssignmentsCollectionRequest struct{ BaseRequest } 3408 3409 // Paging perfoms paging operation for DeviceCompliancePolicyAssignment collection 3410 func (r *DeviceCompliancePolicyAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceCompliancePolicyAssignment, error) { 3411 req, err := r.NewJSONRequest(method, path, obj) 3412 if err != nil { 3413 return nil, err 3414 } 3415 if ctx != nil { 3416 req = req.WithContext(ctx) 3417 } 3418 res, err := r.client.Do(req) 3419 if err != nil { 3420 return nil, err 3421 } 3422 var values []DeviceCompliancePolicyAssignment 3423 for { 3424 if res.StatusCode != http.StatusOK { 3425 b, _ := ioutil.ReadAll(res.Body) 3426 res.Body.Close() 3427 errRes := &ErrorResponse{Response: res} 3428 err := jsonx.Unmarshal(b, errRes) 3429 if err != nil { 3430 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 3431 } 3432 return nil, errRes 3433 } 3434 var ( 3435 paging Paging 3436 value []DeviceCompliancePolicyAssignment 3437 ) 3438 err := jsonx.NewDecoder(res.Body).Decode(&paging) 3439 res.Body.Close() 3440 if err != nil { 3441 return nil, err 3442 } 3443 err = jsonx.Unmarshal(paging.Value, &value) 3444 if err != nil { 3445 return nil, err 3446 } 3447 values = append(values, value...) 3448 if n >= 0 { 3449 n-- 3450 } 3451 if n == 0 || len(paging.NextLink) == 0 { 3452 return values, nil 3453 } 3454 req, err = http.NewRequest("GET", paging.NextLink, nil) 3455 if ctx != nil { 3456 req = req.WithContext(ctx) 3457 } 3458 res, err = r.client.Do(req) 3459 if err != nil { 3460 return nil, err 3461 } 3462 } 3463 } 3464 3465 // GetN performs GET request for DeviceCompliancePolicyAssignment collection, max N pages 3466 func (r *DeviceCompliancePolicyAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceCompliancePolicyAssignment, error) { 3467 var query string 3468 if r.query != nil { 3469 query = "?" + r.query.Encode() 3470 } 3471 return r.Paging(ctx, "GET", query, nil, n) 3472 } 3473 3474 // Get performs GET request for DeviceCompliancePolicyAssignment collection 3475 func (r *DeviceCompliancePolicyAssignmentsCollectionRequest) Get(ctx context.Context) ([]DeviceCompliancePolicyAssignment, error) { 3476 return r.GetN(ctx, 0) 3477 } 3478 3479 // Add performs POST request for DeviceCompliancePolicyAssignment collection 3480 func (r *DeviceCompliancePolicyAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceCompliancePolicyAssignment) (resObj *DeviceCompliancePolicyAssignment, err error) { 3481 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 3482 return 3483 } 3484 3485 // DeviceSettingStateSummaries returns request builder for SettingStateDeviceSummary collection 3486 func (b *DeviceCompliancePolicyRequestBuilder) DeviceSettingStateSummaries() *DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequestBuilder { 3487 bb := &DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3488 bb.baseURL += "/deviceSettingStateSummaries" 3489 return bb 3490 } 3491 3492 // DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequestBuilder is request builder for SettingStateDeviceSummary collection 3493 type DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequestBuilder struct{ BaseRequestBuilder } 3494 3495 // Request returns request for SettingStateDeviceSummary collection 3496 func (b *DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequestBuilder) Request() *DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequest { 3497 return &DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequest{ 3498 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 3499 } 3500 } 3501 3502 // ID returns request builder for SettingStateDeviceSummary item 3503 func (b *DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequestBuilder) ID(id string) *SettingStateDeviceSummaryRequestBuilder { 3504 bb := &SettingStateDeviceSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3505 bb.baseURL += "/" + id 3506 return bb 3507 } 3508 3509 // DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequest is request for SettingStateDeviceSummary collection 3510 type DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequest struct{ BaseRequest } 3511 3512 // Paging perfoms paging operation for SettingStateDeviceSummary collection 3513 func (r *DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]SettingStateDeviceSummary, error) { 3514 req, err := r.NewJSONRequest(method, path, obj) 3515 if err != nil { 3516 return nil, err 3517 } 3518 if ctx != nil { 3519 req = req.WithContext(ctx) 3520 } 3521 res, err := r.client.Do(req) 3522 if err != nil { 3523 return nil, err 3524 } 3525 var values []SettingStateDeviceSummary 3526 for { 3527 if res.StatusCode != http.StatusOK { 3528 b, _ := ioutil.ReadAll(res.Body) 3529 res.Body.Close() 3530 errRes := &ErrorResponse{Response: res} 3531 err := jsonx.Unmarshal(b, errRes) 3532 if err != nil { 3533 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 3534 } 3535 return nil, errRes 3536 } 3537 var ( 3538 paging Paging 3539 value []SettingStateDeviceSummary 3540 ) 3541 err := jsonx.NewDecoder(res.Body).Decode(&paging) 3542 res.Body.Close() 3543 if err != nil { 3544 return nil, err 3545 } 3546 err = jsonx.Unmarshal(paging.Value, &value) 3547 if err != nil { 3548 return nil, err 3549 } 3550 values = append(values, value...) 3551 if n >= 0 { 3552 n-- 3553 } 3554 if n == 0 || len(paging.NextLink) == 0 { 3555 return values, nil 3556 } 3557 req, err = http.NewRequest("GET", paging.NextLink, nil) 3558 if ctx != nil { 3559 req = req.WithContext(ctx) 3560 } 3561 res, err = r.client.Do(req) 3562 if err != nil { 3563 return nil, err 3564 } 3565 } 3566 } 3567 3568 // GetN performs GET request for SettingStateDeviceSummary collection, max N pages 3569 func (r *DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequest) GetN(ctx context.Context, n int) ([]SettingStateDeviceSummary, error) { 3570 var query string 3571 if r.query != nil { 3572 query = "?" + r.query.Encode() 3573 } 3574 return r.Paging(ctx, "GET", query, nil, n) 3575 } 3576 3577 // Get performs GET request for SettingStateDeviceSummary collection 3578 func (r *DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequest) Get(ctx context.Context) ([]SettingStateDeviceSummary, error) { 3579 return r.GetN(ctx, 0) 3580 } 3581 3582 // Add performs POST request for SettingStateDeviceSummary collection 3583 func (r *DeviceCompliancePolicyDeviceSettingStateSummariesCollectionRequest) Add(ctx context.Context, reqObj *SettingStateDeviceSummary) (resObj *SettingStateDeviceSummary, err error) { 3584 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 3585 return 3586 } 3587 3588 // DeviceStatusOverview is navigation property 3589 func (b *DeviceCompliancePolicyRequestBuilder) DeviceStatusOverview() *DeviceComplianceDeviceOverviewRequestBuilder { 3590 bb := &DeviceComplianceDeviceOverviewRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3591 bb.baseURL += "/deviceStatusOverview" 3592 return bb 3593 } 3594 3595 // DeviceStatuses returns request builder for DeviceComplianceDeviceStatus collection 3596 func (b *DeviceCompliancePolicyRequestBuilder) DeviceStatuses() *DeviceCompliancePolicyDeviceStatusesCollectionRequestBuilder { 3597 bb := &DeviceCompliancePolicyDeviceStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3598 bb.baseURL += "/deviceStatuses" 3599 return bb 3600 } 3601 3602 // DeviceCompliancePolicyDeviceStatusesCollectionRequestBuilder is request builder for DeviceComplianceDeviceStatus collection 3603 type DeviceCompliancePolicyDeviceStatusesCollectionRequestBuilder struct{ BaseRequestBuilder } 3604 3605 // Request returns request for DeviceComplianceDeviceStatus collection 3606 func (b *DeviceCompliancePolicyDeviceStatusesCollectionRequestBuilder) Request() *DeviceCompliancePolicyDeviceStatusesCollectionRequest { 3607 return &DeviceCompliancePolicyDeviceStatusesCollectionRequest{ 3608 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 3609 } 3610 } 3611 3612 // ID returns request builder for DeviceComplianceDeviceStatus item 3613 func (b *DeviceCompliancePolicyDeviceStatusesCollectionRequestBuilder) ID(id string) *DeviceComplianceDeviceStatusRequestBuilder { 3614 bb := &DeviceComplianceDeviceStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3615 bb.baseURL += "/" + id 3616 return bb 3617 } 3618 3619 // DeviceCompliancePolicyDeviceStatusesCollectionRequest is request for DeviceComplianceDeviceStatus collection 3620 type DeviceCompliancePolicyDeviceStatusesCollectionRequest struct{ BaseRequest } 3621 3622 // Paging perfoms paging operation for DeviceComplianceDeviceStatus collection 3623 func (r *DeviceCompliancePolicyDeviceStatusesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceComplianceDeviceStatus, error) { 3624 req, err := r.NewJSONRequest(method, path, obj) 3625 if err != nil { 3626 return nil, err 3627 } 3628 if ctx != nil { 3629 req = req.WithContext(ctx) 3630 } 3631 res, err := r.client.Do(req) 3632 if err != nil { 3633 return nil, err 3634 } 3635 var values []DeviceComplianceDeviceStatus 3636 for { 3637 if res.StatusCode != http.StatusOK { 3638 b, _ := ioutil.ReadAll(res.Body) 3639 res.Body.Close() 3640 errRes := &ErrorResponse{Response: res} 3641 err := jsonx.Unmarshal(b, errRes) 3642 if err != nil { 3643 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 3644 } 3645 return nil, errRes 3646 } 3647 var ( 3648 paging Paging 3649 value []DeviceComplianceDeviceStatus 3650 ) 3651 err := jsonx.NewDecoder(res.Body).Decode(&paging) 3652 res.Body.Close() 3653 if err != nil { 3654 return nil, err 3655 } 3656 err = jsonx.Unmarshal(paging.Value, &value) 3657 if err != nil { 3658 return nil, err 3659 } 3660 values = append(values, value...) 3661 if n >= 0 { 3662 n-- 3663 } 3664 if n == 0 || len(paging.NextLink) == 0 { 3665 return values, nil 3666 } 3667 req, err = http.NewRequest("GET", paging.NextLink, nil) 3668 if ctx != nil { 3669 req = req.WithContext(ctx) 3670 } 3671 res, err = r.client.Do(req) 3672 if err != nil { 3673 return nil, err 3674 } 3675 } 3676 } 3677 3678 // GetN performs GET request for DeviceComplianceDeviceStatus collection, max N pages 3679 func (r *DeviceCompliancePolicyDeviceStatusesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceComplianceDeviceStatus, error) { 3680 var query string 3681 if r.query != nil { 3682 query = "?" + r.query.Encode() 3683 } 3684 return r.Paging(ctx, "GET", query, nil, n) 3685 } 3686 3687 // Get performs GET request for DeviceComplianceDeviceStatus collection 3688 func (r *DeviceCompliancePolicyDeviceStatusesCollectionRequest) Get(ctx context.Context) ([]DeviceComplianceDeviceStatus, error) { 3689 return r.GetN(ctx, 0) 3690 } 3691 3692 // Add performs POST request for DeviceComplianceDeviceStatus collection 3693 func (r *DeviceCompliancePolicyDeviceStatusesCollectionRequest) Add(ctx context.Context, reqObj *DeviceComplianceDeviceStatus) (resObj *DeviceComplianceDeviceStatus, err error) { 3694 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 3695 return 3696 } 3697 3698 // ScheduledActionsForRule returns request builder for DeviceComplianceScheduledActionForRule collection 3699 func (b *DeviceCompliancePolicyRequestBuilder) ScheduledActionsForRule() *DeviceCompliancePolicyScheduledActionsForRuleCollectionRequestBuilder { 3700 bb := &DeviceCompliancePolicyScheduledActionsForRuleCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3701 bb.baseURL += "/scheduledActionsForRule" 3702 return bb 3703 } 3704 3705 // DeviceCompliancePolicyScheduledActionsForRuleCollectionRequestBuilder is request builder for DeviceComplianceScheduledActionForRule collection 3706 type DeviceCompliancePolicyScheduledActionsForRuleCollectionRequestBuilder struct{ BaseRequestBuilder } 3707 3708 // Request returns request for DeviceComplianceScheduledActionForRule collection 3709 func (b *DeviceCompliancePolicyScheduledActionsForRuleCollectionRequestBuilder) Request() *DeviceCompliancePolicyScheduledActionsForRuleCollectionRequest { 3710 return &DeviceCompliancePolicyScheduledActionsForRuleCollectionRequest{ 3711 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 3712 } 3713 } 3714 3715 // ID returns request builder for DeviceComplianceScheduledActionForRule item 3716 func (b *DeviceCompliancePolicyScheduledActionsForRuleCollectionRequestBuilder) ID(id string) *DeviceComplianceScheduledActionForRuleRequestBuilder { 3717 bb := &DeviceComplianceScheduledActionForRuleRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3718 bb.baseURL += "/" + id 3719 return bb 3720 } 3721 3722 // DeviceCompliancePolicyScheduledActionsForRuleCollectionRequest is request for DeviceComplianceScheduledActionForRule collection 3723 type DeviceCompliancePolicyScheduledActionsForRuleCollectionRequest struct{ BaseRequest } 3724 3725 // Paging perfoms paging operation for DeviceComplianceScheduledActionForRule collection 3726 func (r *DeviceCompliancePolicyScheduledActionsForRuleCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceComplianceScheduledActionForRule, error) { 3727 req, err := r.NewJSONRequest(method, path, obj) 3728 if err != nil { 3729 return nil, err 3730 } 3731 if ctx != nil { 3732 req = req.WithContext(ctx) 3733 } 3734 res, err := r.client.Do(req) 3735 if err != nil { 3736 return nil, err 3737 } 3738 var values []DeviceComplianceScheduledActionForRule 3739 for { 3740 if res.StatusCode != http.StatusOK { 3741 b, _ := ioutil.ReadAll(res.Body) 3742 res.Body.Close() 3743 errRes := &ErrorResponse{Response: res} 3744 err := jsonx.Unmarshal(b, errRes) 3745 if err != nil { 3746 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 3747 } 3748 return nil, errRes 3749 } 3750 var ( 3751 paging Paging 3752 value []DeviceComplianceScheduledActionForRule 3753 ) 3754 err := jsonx.NewDecoder(res.Body).Decode(&paging) 3755 res.Body.Close() 3756 if err != nil { 3757 return nil, err 3758 } 3759 err = jsonx.Unmarshal(paging.Value, &value) 3760 if err != nil { 3761 return nil, err 3762 } 3763 values = append(values, value...) 3764 if n >= 0 { 3765 n-- 3766 } 3767 if n == 0 || len(paging.NextLink) == 0 { 3768 return values, nil 3769 } 3770 req, err = http.NewRequest("GET", paging.NextLink, nil) 3771 if ctx != nil { 3772 req = req.WithContext(ctx) 3773 } 3774 res, err = r.client.Do(req) 3775 if err != nil { 3776 return nil, err 3777 } 3778 } 3779 } 3780 3781 // GetN performs GET request for DeviceComplianceScheduledActionForRule collection, max N pages 3782 func (r *DeviceCompliancePolicyScheduledActionsForRuleCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceComplianceScheduledActionForRule, error) { 3783 var query string 3784 if r.query != nil { 3785 query = "?" + r.query.Encode() 3786 } 3787 return r.Paging(ctx, "GET", query, nil, n) 3788 } 3789 3790 // Get performs GET request for DeviceComplianceScheduledActionForRule collection 3791 func (r *DeviceCompliancePolicyScheduledActionsForRuleCollectionRequest) Get(ctx context.Context) ([]DeviceComplianceScheduledActionForRule, error) { 3792 return r.GetN(ctx, 0) 3793 } 3794 3795 // Add performs POST request for DeviceComplianceScheduledActionForRule collection 3796 func (r *DeviceCompliancePolicyScheduledActionsForRuleCollectionRequest) Add(ctx context.Context, reqObj *DeviceComplianceScheduledActionForRule) (resObj *DeviceComplianceScheduledActionForRule, err error) { 3797 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 3798 return 3799 } 3800 3801 // UserStatusOverview is navigation property 3802 func (b *DeviceCompliancePolicyRequestBuilder) UserStatusOverview() *DeviceComplianceUserOverviewRequestBuilder { 3803 bb := &DeviceComplianceUserOverviewRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3804 bb.baseURL += "/userStatusOverview" 3805 return bb 3806 } 3807 3808 // UserStatuses returns request builder for DeviceComplianceUserStatus collection 3809 func (b *DeviceCompliancePolicyRequestBuilder) UserStatuses() *DeviceCompliancePolicyUserStatusesCollectionRequestBuilder { 3810 bb := &DeviceCompliancePolicyUserStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3811 bb.baseURL += "/userStatuses" 3812 return bb 3813 } 3814 3815 // DeviceCompliancePolicyUserStatusesCollectionRequestBuilder is request builder for DeviceComplianceUserStatus collection 3816 type DeviceCompliancePolicyUserStatusesCollectionRequestBuilder struct{ BaseRequestBuilder } 3817 3818 // Request returns request for DeviceComplianceUserStatus collection 3819 func (b *DeviceCompliancePolicyUserStatusesCollectionRequestBuilder) Request() *DeviceCompliancePolicyUserStatusesCollectionRequest { 3820 return &DeviceCompliancePolicyUserStatusesCollectionRequest{ 3821 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 3822 } 3823 } 3824 3825 // ID returns request builder for DeviceComplianceUserStatus item 3826 func (b *DeviceCompliancePolicyUserStatusesCollectionRequestBuilder) ID(id string) *DeviceComplianceUserStatusRequestBuilder { 3827 bb := &DeviceComplianceUserStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3828 bb.baseURL += "/" + id 3829 return bb 3830 } 3831 3832 // DeviceCompliancePolicyUserStatusesCollectionRequest is request for DeviceComplianceUserStatus collection 3833 type DeviceCompliancePolicyUserStatusesCollectionRequest struct{ BaseRequest } 3834 3835 // Paging perfoms paging operation for DeviceComplianceUserStatus collection 3836 func (r *DeviceCompliancePolicyUserStatusesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceComplianceUserStatus, error) { 3837 req, err := r.NewJSONRequest(method, path, obj) 3838 if err != nil { 3839 return nil, err 3840 } 3841 if ctx != nil { 3842 req = req.WithContext(ctx) 3843 } 3844 res, err := r.client.Do(req) 3845 if err != nil { 3846 return nil, err 3847 } 3848 var values []DeviceComplianceUserStatus 3849 for { 3850 if res.StatusCode != http.StatusOK { 3851 b, _ := ioutil.ReadAll(res.Body) 3852 res.Body.Close() 3853 errRes := &ErrorResponse{Response: res} 3854 err := jsonx.Unmarshal(b, errRes) 3855 if err != nil { 3856 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 3857 } 3858 return nil, errRes 3859 } 3860 var ( 3861 paging Paging 3862 value []DeviceComplianceUserStatus 3863 ) 3864 err := jsonx.NewDecoder(res.Body).Decode(&paging) 3865 res.Body.Close() 3866 if err != nil { 3867 return nil, err 3868 } 3869 err = jsonx.Unmarshal(paging.Value, &value) 3870 if err != nil { 3871 return nil, err 3872 } 3873 values = append(values, value...) 3874 if n >= 0 { 3875 n-- 3876 } 3877 if n == 0 || len(paging.NextLink) == 0 { 3878 return values, nil 3879 } 3880 req, err = http.NewRequest("GET", paging.NextLink, nil) 3881 if ctx != nil { 3882 req = req.WithContext(ctx) 3883 } 3884 res, err = r.client.Do(req) 3885 if err != nil { 3886 return nil, err 3887 } 3888 } 3889 } 3890 3891 // GetN performs GET request for DeviceComplianceUserStatus collection, max N pages 3892 func (r *DeviceCompliancePolicyUserStatusesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceComplianceUserStatus, error) { 3893 var query string 3894 if r.query != nil { 3895 query = "?" + r.query.Encode() 3896 } 3897 return r.Paging(ctx, "GET", query, nil, n) 3898 } 3899 3900 // Get performs GET request for DeviceComplianceUserStatus collection 3901 func (r *DeviceCompliancePolicyUserStatusesCollectionRequest) Get(ctx context.Context) ([]DeviceComplianceUserStatus, error) { 3902 return r.GetN(ctx, 0) 3903 } 3904 3905 // Add performs POST request for DeviceComplianceUserStatus collection 3906 func (r *DeviceCompliancePolicyUserStatusesCollectionRequest) Add(ctx context.Context, reqObj *DeviceComplianceUserStatus) (resObj *DeviceComplianceUserStatus, err error) { 3907 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 3908 return 3909 } 3910 3911 // DeviceCompliancePolicy is navigation property 3912 func (b *DeviceCompliancePolicyGroupAssignmentRequestBuilder) DeviceCompliancePolicy() *DeviceCompliancePolicyRequestBuilder { 3913 bb := &DeviceCompliancePolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3914 bb.baseURL += "/deviceCompliancePolicy" 3915 return bb 3916 } 3917 3918 // DeviceComplianceSettingStates returns request builder for DeviceComplianceSettingState collection 3919 func (b *DeviceCompliancePolicySettingStateSummaryRequestBuilder) DeviceComplianceSettingStates() *DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequestBuilder { 3920 bb := &DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3921 bb.baseURL += "/deviceComplianceSettingStates" 3922 return bb 3923 } 3924 3925 // DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequestBuilder is request builder for DeviceComplianceSettingState collection 3926 type DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequestBuilder struct{ BaseRequestBuilder } 3927 3928 // Request returns request for DeviceComplianceSettingState collection 3929 func (b *DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequestBuilder) Request() *DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequest { 3930 return &DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequest{ 3931 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 3932 } 3933 } 3934 3935 // ID returns request builder for DeviceComplianceSettingState item 3936 func (b *DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequestBuilder) ID(id string) *DeviceComplianceSettingStateRequestBuilder { 3937 bb := &DeviceComplianceSettingStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 3938 bb.baseURL += "/" + id 3939 return bb 3940 } 3941 3942 // DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequest is request for DeviceComplianceSettingState collection 3943 type DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequest struct{ BaseRequest } 3944 3945 // Paging perfoms paging operation for DeviceComplianceSettingState collection 3946 func (r *DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceComplianceSettingState, error) { 3947 req, err := r.NewJSONRequest(method, path, obj) 3948 if err != nil { 3949 return nil, err 3950 } 3951 if ctx != nil { 3952 req = req.WithContext(ctx) 3953 } 3954 res, err := r.client.Do(req) 3955 if err != nil { 3956 return nil, err 3957 } 3958 var values []DeviceComplianceSettingState 3959 for { 3960 if res.StatusCode != http.StatusOK { 3961 b, _ := ioutil.ReadAll(res.Body) 3962 res.Body.Close() 3963 errRes := &ErrorResponse{Response: res} 3964 err := jsonx.Unmarshal(b, errRes) 3965 if err != nil { 3966 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 3967 } 3968 return nil, errRes 3969 } 3970 var ( 3971 paging Paging 3972 value []DeviceComplianceSettingState 3973 ) 3974 err := jsonx.NewDecoder(res.Body).Decode(&paging) 3975 res.Body.Close() 3976 if err != nil { 3977 return nil, err 3978 } 3979 err = jsonx.Unmarshal(paging.Value, &value) 3980 if err != nil { 3981 return nil, err 3982 } 3983 values = append(values, value...) 3984 if n >= 0 { 3985 n-- 3986 } 3987 if n == 0 || len(paging.NextLink) == 0 { 3988 return values, nil 3989 } 3990 req, err = http.NewRequest("GET", paging.NextLink, nil) 3991 if ctx != nil { 3992 req = req.WithContext(ctx) 3993 } 3994 res, err = r.client.Do(req) 3995 if err != nil { 3996 return nil, err 3997 } 3998 } 3999 } 4000 4001 // GetN performs GET request for DeviceComplianceSettingState collection, max N pages 4002 func (r *DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceComplianceSettingState, error) { 4003 var query string 4004 if r.query != nil { 4005 query = "?" + r.query.Encode() 4006 } 4007 return r.Paging(ctx, "GET", query, nil, n) 4008 } 4009 4010 // Get performs GET request for DeviceComplianceSettingState collection 4011 func (r *DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequest) Get(ctx context.Context) ([]DeviceComplianceSettingState, error) { 4012 return r.GetN(ctx, 0) 4013 } 4014 4015 // Add performs POST request for DeviceComplianceSettingState collection 4016 func (r *DeviceCompliancePolicySettingStateSummaryDeviceComplianceSettingStatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceComplianceSettingState) (resObj *DeviceComplianceSettingState, err error) { 4017 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 4018 return 4019 } 4020 4021 // ScheduledActionConfigurations returns request builder for DeviceComplianceActionItem collection 4022 func (b *DeviceComplianceScheduledActionForRuleRequestBuilder) ScheduledActionConfigurations() *DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequestBuilder { 4023 bb := &DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4024 bb.baseURL += "/scheduledActionConfigurations" 4025 return bb 4026 } 4027 4028 // DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequestBuilder is request builder for DeviceComplianceActionItem collection 4029 type DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } 4030 4031 // Request returns request for DeviceComplianceActionItem collection 4032 func (b *DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequestBuilder) Request() *DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequest { 4033 return &DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequest{ 4034 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 4035 } 4036 } 4037 4038 // ID returns request builder for DeviceComplianceActionItem item 4039 func (b *DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequestBuilder) ID(id string) *DeviceComplianceActionItemRequestBuilder { 4040 bb := &DeviceComplianceActionItemRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4041 bb.baseURL += "/" + id 4042 return bb 4043 } 4044 4045 // DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequest is request for DeviceComplianceActionItem collection 4046 type DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequest struct{ BaseRequest } 4047 4048 // Paging perfoms paging operation for DeviceComplianceActionItem collection 4049 func (r *DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceComplianceActionItem, error) { 4050 req, err := r.NewJSONRequest(method, path, obj) 4051 if err != nil { 4052 return nil, err 4053 } 4054 if ctx != nil { 4055 req = req.WithContext(ctx) 4056 } 4057 res, err := r.client.Do(req) 4058 if err != nil { 4059 return nil, err 4060 } 4061 var values []DeviceComplianceActionItem 4062 for { 4063 if res.StatusCode != http.StatusOK { 4064 b, _ := ioutil.ReadAll(res.Body) 4065 res.Body.Close() 4066 errRes := &ErrorResponse{Response: res} 4067 err := jsonx.Unmarshal(b, errRes) 4068 if err != nil { 4069 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 4070 } 4071 return nil, errRes 4072 } 4073 var ( 4074 paging Paging 4075 value []DeviceComplianceActionItem 4076 ) 4077 err := jsonx.NewDecoder(res.Body).Decode(&paging) 4078 res.Body.Close() 4079 if err != nil { 4080 return nil, err 4081 } 4082 err = jsonx.Unmarshal(paging.Value, &value) 4083 if err != nil { 4084 return nil, err 4085 } 4086 values = append(values, value...) 4087 if n >= 0 { 4088 n-- 4089 } 4090 if n == 0 || len(paging.NextLink) == 0 { 4091 return values, nil 4092 } 4093 req, err = http.NewRequest("GET", paging.NextLink, nil) 4094 if ctx != nil { 4095 req = req.WithContext(ctx) 4096 } 4097 res, err = r.client.Do(req) 4098 if err != nil { 4099 return nil, err 4100 } 4101 } 4102 } 4103 4104 // GetN performs GET request for DeviceComplianceActionItem collection, max N pages 4105 func (r *DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceComplianceActionItem, error) { 4106 var query string 4107 if r.query != nil { 4108 query = "?" + r.query.Encode() 4109 } 4110 return r.Paging(ctx, "GET", query, nil, n) 4111 } 4112 4113 // Get performs GET request for DeviceComplianceActionItem collection 4114 func (r *DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequest) Get(ctx context.Context) ([]DeviceComplianceActionItem, error) { 4115 return r.GetN(ctx, 0) 4116 } 4117 4118 // Add performs POST request for DeviceComplianceActionItem collection 4119 func (r *DeviceComplianceScheduledActionForRuleScheduledActionConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *DeviceComplianceActionItem) (resObj *DeviceComplianceActionItem, err error) { 4120 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 4121 return 4122 } 4123 4124 // Assignments returns request builder for DeviceConfigurationAssignment collection 4125 func (b *DeviceConfigurationRequestBuilder) Assignments() *DeviceConfigurationAssignmentsCollectionRequestBuilder { 4126 bb := &DeviceConfigurationAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4127 bb.baseURL += "/assignments" 4128 return bb 4129 } 4130 4131 // DeviceConfigurationAssignmentsCollectionRequestBuilder is request builder for DeviceConfigurationAssignment collection 4132 type DeviceConfigurationAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder } 4133 4134 // Request returns request for DeviceConfigurationAssignment collection 4135 func (b *DeviceConfigurationAssignmentsCollectionRequestBuilder) Request() *DeviceConfigurationAssignmentsCollectionRequest { 4136 return &DeviceConfigurationAssignmentsCollectionRequest{ 4137 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 4138 } 4139 } 4140 4141 // ID returns request builder for DeviceConfigurationAssignment item 4142 func (b *DeviceConfigurationAssignmentsCollectionRequestBuilder) ID(id string) *DeviceConfigurationAssignmentRequestBuilder { 4143 bb := &DeviceConfigurationAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4144 bb.baseURL += "/" + id 4145 return bb 4146 } 4147 4148 // DeviceConfigurationAssignmentsCollectionRequest is request for DeviceConfigurationAssignment collection 4149 type DeviceConfigurationAssignmentsCollectionRequest struct{ BaseRequest } 4150 4151 // Paging perfoms paging operation for DeviceConfigurationAssignment collection 4152 func (r *DeviceConfigurationAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceConfigurationAssignment, error) { 4153 req, err := r.NewJSONRequest(method, path, obj) 4154 if err != nil { 4155 return nil, err 4156 } 4157 if ctx != nil { 4158 req = req.WithContext(ctx) 4159 } 4160 res, err := r.client.Do(req) 4161 if err != nil { 4162 return nil, err 4163 } 4164 var values []DeviceConfigurationAssignment 4165 for { 4166 if res.StatusCode != http.StatusOK { 4167 b, _ := ioutil.ReadAll(res.Body) 4168 res.Body.Close() 4169 errRes := &ErrorResponse{Response: res} 4170 err := jsonx.Unmarshal(b, errRes) 4171 if err != nil { 4172 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 4173 } 4174 return nil, errRes 4175 } 4176 var ( 4177 paging Paging 4178 value []DeviceConfigurationAssignment 4179 ) 4180 err := jsonx.NewDecoder(res.Body).Decode(&paging) 4181 res.Body.Close() 4182 if err != nil { 4183 return nil, err 4184 } 4185 err = jsonx.Unmarshal(paging.Value, &value) 4186 if err != nil { 4187 return nil, err 4188 } 4189 values = append(values, value...) 4190 if n >= 0 { 4191 n-- 4192 } 4193 if n == 0 || len(paging.NextLink) == 0 { 4194 return values, nil 4195 } 4196 req, err = http.NewRequest("GET", paging.NextLink, nil) 4197 if ctx != nil { 4198 req = req.WithContext(ctx) 4199 } 4200 res, err = r.client.Do(req) 4201 if err != nil { 4202 return nil, err 4203 } 4204 } 4205 } 4206 4207 // GetN performs GET request for DeviceConfigurationAssignment collection, max N pages 4208 func (r *DeviceConfigurationAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceConfigurationAssignment, error) { 4209 var query string 4210 if r.query != nil { 4211 query = "?" + r.query.Encode() 4212 } 4213 return r.Paging(ctx, "GET", query, nil, n) 4214 } 4215 4216 // Get performs GET request for DeviceConfigurationAssignment collection 4217 func (r *DeviceConfigurationAssignmentsCollectionRequest) Get(ctx context.Context) ([]DeviceConfigurationAssignment, error) { 4218 return r.GetN(ctx, 0) 4219 } 4220 4221 // Add performs POST request for DeviceConfigurationAssignment collection 4222 func (r *DeviceConfigurationAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceConfigurationAssignment) (resObj *DeviceConfigurationAssignment, err error) { 4223 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 4224 return 4225 } 4226 4227 // DeviceSettingStateSummaries returns request builder for SettingStateDeviceSummary collection 4228 func (b *DeviceConfigurationRequestBuilder) DeviceSettingStateSummaries() *DeviceConfigurationDeviceSettingStateSummariesCollectionRequestBuilder { 4229 bb := &DeviceConfigurationDeviceSettingStateSummariesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4230 bb.baseURL += "/deviceSettingStateSummaries" 4231 return bb 4232 } 4233 4234 // DeviceConfigurationDeviceSettingStateSummariesCollectionRequestBuilder is request builder for SettingStateDeviceSummary collection 4235 type DeviceConfigurationDeviceSettingStateSummariesCollectionRequestBuilder struct{ BaseRequestBuilder } 4236 4237 // Request returns request for SettingStateDeviceSummary collection 4238 func (b *DeviceConfigurationDeviceSettingStateSummariesCollectionRequestBuilder) Request() *DeviceConfigurationDeviceSettingStateSummariesCollectionRequest { 4239 return &DeviceConfigurationDeviceSettingStateSummariesCollectionRequest{ 4240 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 4241 } 4242 } 4243 4244 // ID returns request builder for SettingStateDeviceSummary item 4245 func (b *DeviceConfigurationDeviceSettingStateSummariesCollectionRequestBuilder) ID(id string) *SettingStateDeviceSummaryRequestBuilder { 4246 bb := &SettingStateDeviceSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4247 bb.baseURL += "/" + id 4248 return bb 4249 } 4250 4251 // DeviceConfigurationDeviceSettingStateSummariesCollectionRequest is request for SettingStateDeviceSummary collection 4252 type DeviceConfigurationDeviceSettingStateSummariesCollectionRequest struct{ BaseRequest } 4253 4254 // Paging perfoms paging operation for SettingStateDeviceSummary collection 4255 func (r *DeviceConfigurationDeviceSettingStateSummariesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]SettingStateDeviceSummary, error) { 4256 req, err := r.NewJSONRequest(method, path, obj) 4257 if err != nil { 4258 return nil, err 4259 } 4260 if ctx != nil { 4261 req = req.WithContext(ctx) 4262 } 4263 res, err := r.client.Do(req) 4264 if err != nil { 4265 return nil, err 4266 } 4267 var values []SettingStateDeviceSummary 4268 for { 4269 if res.StatusCode != http.StatusOK { 4270 b, _ := ioutil.ReadAll(res.Body) 4271 res.Body.Close() 4272 errRes := &ErrorResponse{Response: res} 4273 err := jsonx.Unmarshal(b, errRes) 4274 if err != nil { 4275 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 4276 } 4277 return nil, errRes 4278 } 4279 var ( 4280 paging Paging 4281 value []SettingStateDeviceSummary 4282 ) 4283 err := jsonx.NewDecoder(res.Body).Decode(&paging) 4284 res.Body.Close() 4285 if err != nil { 4286 return nil, err 4287 } 4288 err = jsonx.Unmarshal(paging.Value, &value) 4289 if err != nil { 4290 return nil, err 4291 } 4292 values = append(values, value...) 4293 if n >= 0 { 4294 n-- 4295 } 4296 if n == 0 || len(paging.NextLink) == 0 { 4297 return values, nil 4298 } 4299 req, err = http.NewRequest("GET", paging.NextLink, nil) 4300 if ctx != nil { 4301 req = req.WithContext(ctx) 4302 } 4303 res, err = r.client.Do(req) 4304 if err != nil { 4305 return nil, err 4306 } 4307 } 4308 } 4309 4310 // GetN performs GET request for SettingStateDeviceSummary collection, max N pages 4311 func (r *DeviceConfigurationDeviceSettingStateSummariesCollectionRequest) GetN(ctx context.Context, n int) ([]SettingStateDeviceSummary, error) { 4312 var query string 4313 if r.query != nil { 4314 query = "?" + r.query.Encode() 4315 } 4316 return r.Paging(ctx, "GET", query, nil, n) 4317 } 4318 4319 // Get performs GET request for SettingStateDeviceSummary collection 4320 func (r *DeviceConfigurationDeviceSettingStateSummariesCollectionRequest) Get(ctx context.Context) ([]SettingStateDeviceSummary, error) { 4321 return r.GetN(ctx, 0) 4322 } 4323 4324 // Add performs POST request for SettingStateDeviceSummary collection 4325 func (r *DeviceConfigurationDeviceSettingStateSummariesCollectionRequest) Add(ctx context.Context, reqObj *SettingStateDeviceSummary) (resObj *SettingStateDeviceSummary, err error) { 4326 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 4327 return 4328 } 4329 4330 // DeviceStatusOverview is navigation property 4331 func (b *DeviceConfigurationRequestBuilder) DeviceStatusOverview() *DeviceConfigurationDeviceOverviewRequestBuilder { 4332 bb := &DeviceConfigurationDeviceOverviewRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4333 bb.baseURL += "/deviceStatusOverview" 4334 return bb 4335 } 4336 4337 // DeviceStatuses returns request builder for DeviceConfigurationDeviceStatus collection 4338 func (b *DeviceConfigurationRequestBuilder) DeviceStatuses() *DeviceConfigurationDeviceStatusesCollectionRequestBuilder { 4339 bb := &DeviceConfigurationDeviceStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4340 bb.baseURL += "/deviceStatuses" 4341 return bb 4342 } 4343 4344 // DeviceConfigurationDeviceStatusesCollectionRequestBuilder is request builder for DeviceConfigurationDeviceStatus collection 4345 type DeviceConfigurationDeviceStatusesCollectionRequestBuilder struct{ BaseRequestBuilder } 4346 4347 // Request returns request for DeviceConfigurationDeviceStatus collection 4348 func (b *DeviceConfigurationDeviceStatusesCollectionRequestBuilder) Request() *DeviceConfigurationDeviceStatusesCollectionRequest { 4349 return &DeviceConfigurationDeviceStatusesCollectionRequest{ 4350 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 4351 } 4352 } 4353 4354 // ID returns request builder for DeviceConfigurationDeviceStatus item 4355 func (b *DeviceConfigurationDeviceStatusesCollectionRequestBuilder) ID(id string) *DeviceConfigurationDeviceStatusRequestBuilder { 4356 bb := &DeviceConfigurationDeviceStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4357 bb.baseURL += "/" + id 4358 return bb 4359 } 4360 4361 // DeviceConfigurationDeviceStatusesCollectionRequest is request for DeviceConfigurationDeviceStatus collection 4362 type DeviceConfigurationDeviceStatusesCollectionRequest struct{ BaseRequest } 4363 4364 // Paging perfoms paging operation for DeviceConfigurationDeviceStatus collection 4365 func (r *DeviceConfigurationDeviceStatusesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceConfigurationDeviceStatus, error) { 4366 req, err := r.NewJSONRequest(method, path, obj) 4367 if err != nil { 4368 return nil, err 4369 } 4370 if ctx != nil { 4371 req = req.WithContext(ctx) 4372 } 4373 res, err := r.client.Do(req) 4374 if err != nil { 4375 return nil, err 4376 } 4377 var values []DeviceConfigurationDeviceStatus 4378 for { 4379 if res.StatusCode != http.StatusOK { 4380 b, _ := ioutil.ReadAll(res.Body) 4381 res.Body.Close() 4382 errRes := &ErrorResponse{Response: res} 4383 err := jsonx.Unmarshal(b, errRes) 4384 if err != nil { 4385 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 4386 } 4387 return nil, errRes 4388 } 4389 var ( 4390 paging Paging 4391 value []DeviceConfigurationDeviceStatus 4392 ) 4393 err := jsonx.NewDecoder(res.Body).Decode(&paging) 4394 res.Body.Close() 4395 if err != nil { 4396 return nil, err 4397 } 4398 err = jsonx.Unmarshal(paging.Value, &value) 4399 if err != nil { 4400 return nil, err 4401 } 4402 values = append(values, value...) 4403 if n >= 0 { 4404 n-- 4405 } 4406 if n == 0 || len(paging.NextLink) == 0 { 4407 return values, nil 4408 } 4409 req, err = http.NewRequest("GET", paging.NextLink, nil) 4410 if ctx != nil { 4411 req = req.WithContext(ctx) 4412 } 4413 res, err = r.client.Do(req) 4414 if err != nil { 4415 return nil, err 4416 } 4417 } 4418 } 4419 4420 // GetN performs GET request for DeviceConfigurationDeviceStatus collection, max N pages 4421 func (r *DeviceConfigurationDeviceStatusesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceConfigurationDeviceStatus, error) { 4422 var query string 4423 if r.query != nil { 4424 query = "?" + r.query.Encode() 4425 } 4426 return r.Paging(ctx, "GET", query, nil, n) 4427 } 4428 4429 // Get performs GET request for DeviceConfigurationDeviceStatus collection 4430 func (r *DeviceConfigurationDeviceStatusesCollectionRequest) Get(ctx context.Context) ([]DeviceConfigurationDeviceStatus, error) { 4431 return r.GetN(ctx, 0) 4432 } 4433 4434 // Add performs POST request for DeviceConfigurationDeviceStatus collection 4435 func (r *DeviceConfigurationDeviceStatusesCollectionRequest) Add(ctx context.Context, reqObj *DeviceConfigurationDeviceStatus) (resObj *DeviceConfigurationDeviceStatus, err error) { 4436 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 4437 return 4438 } 4439 4440 // GroupAssignments returns request builder for DeviceConfigurationGroupAssignment collection 4441 func (b *DeviceConfigurationRequestBuilder) GroupAssignments() *DeviceConfigurationGroupAssignmentsCollectionRequestBuilder { 4442 bb := &DeviceConfigurationGroupAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4443 bb.baseURL += "/groupAssignments" 4444 return bb 4445 } 4446 4447 // DeviceConfigurationGroupAssignmentsCollectionRequestBuilder is request builder for DeviceConfigurationGroupAssignment collection 4448 type DeviceConfigurationGroupAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder } 4449 4450 // Request returns request for DeviceConfigurationGroupAssignment collection 4451 func (b *DeviceConfigurationGroupAssignmentsCollectionRequestBuilder) Request() *DeviceConfigurationGroupAssignmentsCollectionRequest { 4452 return &DeviceConfigurationGroupAssignmentsCollectionRequest{ 4453 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 4454 } 4455 } 4456 4457 // ID returns request builder for DeviceConfigurationGroupAssignment item 4458 func (b *DeviceConfigurationGroupAssignmentsCollectionRequestBuilder) ID(id string) *DeviceConfigurationGroupAssignmentRequestBuilder { 4459 bb := &DeviceConfigurationGroupAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4460 bb.baseURL += "/" + id 4461 return bb 4462 } 4463 4464 // DeviceConfigurationGroupAssignmentsCollectionRequest is request for DeviceConfigurationGroupAssignment collection 4465 type DeviceConfigurationGroupAssignmentsCollectionRequest struct{ BaseRequest } 4466 4467 // Paging perfoms paging operation for DeviceConfigurationGroupAssignment collection 4468 func (r *DeviceConfigurationGroupAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceConfigurationGroupAssignment, error) { 4469 req, err := r.NewJSONRequest(method, path, obj) 4470 if err != nil { 4471 return nil, err 4472 } 4473 if ctx != nil { 4474 req = req.WithContext(ctx) 4475 } 4476 res, err := r.client.Do(req) 4477 if err != nil { 4478 return nil, err 4479 } 4480 var values []DeviceConfigurationGroupAssignment 4481 for { 4482 if res.StatusCode != http.StatusOK { 4483 b, _ := ioutil.ReadAll(res.Body) 4484 res.Body.Close() 4485 errRes := &ErrorResponse{Response: res} 4486 err := jsonx.Unmarshal(b, errRes) 4487 if err != nil { 4488 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 4489 } 4490 return nil, errRes 4491 } 4492 var ( 4493 paging Paging 4494 value []DeviceConfigurationGroupAssignment 4495 ) 4496 err := jsonx.NewDecoder(res.Body).Decode(&paging) 4497 res.Body.Close() 4498 if err != nil { 4499 return nil, err 4500 } 4501 err = jsonx.Unmarshal(paging.Value, &value) 4502 if err != nil { 4503 return nil, err 4504 } 4505 values = append(values, value...) 4506 if n >= 0 { 4507 n-- 4508 } 4509 if n == 0 || len(paging.NextLink) == 0 { 4510 return values, nil 4511 } 4512 req, err = http.NewRequest("GET", paging.NextLink, nil) 4513 if ctx != nil { 4514 req = req.WithContext(ctx) 4515 } 4516 res, err = r.client.Do(req) 4517 if err != nil { 4518 return nil, err 4519 } 4520 } 4521 } 4522 4523 // GetN performs GET request for DeviceConfigurationGroupAssignment collection, max N pages 4524 func (r *DeviceConfigurationGroupAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceConfigurationGroupAssignment, error) { 4525 var query string 4526 if r.query != nil { 4527 query = "?" + r.query.Encode() 4528 } 4529 return r.Paging(ctx, "GET", query, nil, n) 4530 } 4531 4532 // Get performs GET request for DeviceConfigurationGroupAssignment collection 4533 func (r *DeviceConfigurationGroupAssignmentsCollectionRequest) Get(ctx context.Context) ([]DeviceConfigurationGroupAssignment, error) { 4534 return r.GetN(ctx, 0) 4535 } 4536 4537 // Add performs POST request for DeviceConfigurationGroupAssignment collection 4538 func (r *DeviceConfigurationGroupAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceConfigurationGroupAssignment) (resObj *DeviceConfigurationGroupAssignment, err error) { 4539 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 4540 return 4541 } 4542 4543 // UserStatusOverview is navigation property 4544 func (b *DeviceConfigurationRequestBuilder) UserStatusOverview() *DeviceConfigurationUserOverviewRequestBuilder { 4545 bb := &DeviceConfigurationUserOverviewRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4546 bb.baseURL += "/userStatusOverview" 4547 return bb 4548 } 4549 4550 // UserStatuses returns request builder for DeviceConfigurationUserStatus collection 4551 func (b *DeviceConfigurationRequestBuilder) UserStatuses() *DeviceConfigurationUserStatusesCollectionRequestBuilder { 4552 bb := &DeviceConfigurationUserStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4553 bb.baseURL += "/userStatuses" 4554 return bb 4555 } 4556 4557 // DeviceConfigurationUserStatusesCollectionRequestBuilder is request builder for DeviceConfigurationUserStatus collection 4558 type DeviceConfigurationUserStatusesCollectionRequestBuilder struct{ BaseRequestBuilder } 4559 4560 // Request returns request for DeviceConfigurationUserStatus collection 4561 func (b *DeviceConfigurationUserStatusesCollectionRequestBuilder) Request() *DeviceConfigurationUserStatusesCollectionRequest { 4562 return &DeviceConfigurationUserStatusesCollectionRequest{ 4563 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 4564 } 4565 } 4566 4567 // ID returns request builder for DeviceConfigurationUserStatus item 4568 func (b *DeviceConfigurationUserStatusesCollectionRequestBuilder) ID(id string) *DeviceConfigurationUserStatusRequestBuilder { 4569 bb := &DeviceConfigurationUserStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4570 bb.baseURL += "/" + id 4571 return bb 4572 } 4573 4574 // DeviceConfigurationUserStatusesCollectionRequest is request for DeviceConfigurationUserStatus collection 4575 type DeviceConfigurationUserStatusesCollectionRequest struct{ BaseRequest } 4576 4577 // Paging perfoms paging operation for DeviceConfigurationUserStatus collection 4578 func (r *DeviceConfigurationUserStatusesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceConfigurationUserStatus, error) { 4579 req, err := r.NewJSONRequest(method, path, obj) 4580 if err != nil { 4581 return nil, err 4582 } 4583 if ctx != nil { 4584 req = req.WithContext(ctx) 4585 } 4586 res, err := r.client.Do(req) 4587 if err != nil { 4588 return nil, err 4589 } 4590 var values []DeviceConfigurationUserStatus 4591 for { 4592 if res.StatusCode != http.StatusOK { 4593 b, _ := ioutil.ReadAll(res.Body) 4594 res.Body.Close() 4595 errRes := &ErrorResponse{Response: res} 4596 err := jsonx.Unmarshal(b, errRes) 4597 if err != nil { 4598 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 4599 } 4600 return nil, errRes 4601 } 4602 var ( 4603 paging Paging 4604 value []DeviceConfigurationUserStatus 4605 ) 4606 err := jsonx.NewDecoder(res.Body).Decode(&paging) 4607 res.Body.Close() 4608 if err != nil { 4609 return nil, err 4610 } 4611 err = jsonx.Unmarshal(paging.Value, &value) 4612 if err != nil { 4613 return nil, err 4614 } 4615 values = append(values, value...) 4616 if n >= 0 { 4617 n-- 4618 } 4619 if n == 0 || len(paging.NextLink) == 0 { 4620 return values, nil 4621 } 4622 req, err = http.NewRequest("GET", paging.NextLink, nil) 4623 if ctx != nil { 4624 req = req.WithContext(ctx) 4625 } 4626 res, err = r.client.Do(req) 4627 if err != nil { 4628 return nil, err 4629 } 4630 } 4631 } 4632 4633 // GetN performs GET request for DeviceConfigurationUserStatus collection, max N pages 4634 func (r *DeviceConfigurationUserStatusesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceConfigurationUserStatus, error) { 4635 var query string 4636 if r.query != nil { 4637 query = "?" + r.query.Encode() 4638 } 4639 return r.Paging(ctx, "GET", query, nil, n) 4640 } 4641 4642 // Get performs GET request for DeviceConfigurationUserStatus collection 4643 func (r *DeviceConfigurationUserStatusesCollectionRequest) Get(ctx context.Context) ([]DeviceConfigurationUserStatus, error) { 4644 return r.GetN(ctx, 0) 4645 } 4646 4647 // Add performs POST request for DeviceConfigurationUserStatus collection 4648 func (r *DeviceConfigurationUserStatusesCollectionRequest) Add(ctx context.Context, reqObj *DeviceConfigurationUserStatus) (resObj *DeviceConfigurationUserStatus, err error) { 4649 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 4650 return 4651 } 4652 4653 // DeviceConfiguration is navigation property 4654 func (b *DeviceConfigurationGroupAssignmentRequestBuilder) DeviceConfiguration() *DeviceConfigurationRequestBuilder { 4655 bb := &DeviceConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4656 bb.baseURL += "/deviceConfiguration" 4657 return bb 4658 } 4659 4660 // Assignments returns request builder for EnrollmentConfigurationAssignment collection 4661 func (b *DeviceEnrollmentConfigurationRequestBuilder) Assignments() *DeviceEnrollmentConfigurationAssignmentsCollectionRequestBuilder { 4662 bb := &DeviceEnrollmentConfigurationAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4663 bb.baseURL += "/assignments" 4664 return bb 4665 } 4666 4667 // DeviceEnrollmentConfigurationAssignmentsCollectionRequestBuilder is request builder for EnrollmentConfigurationAssignment collection 4668 type DeviceEnrollmentConfigurationAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder } 4669 4670 // Request returns request for EnrollmentConfigurationAssignment collection 4671 func (b *DeviceEnrollmentConfigurationAssignmentsCollectionRequestBuilder) Request() *DeviceEnrollmentConfigurationAssignmentsCollectionRequest { 4672 return &DeviceEnrollmentConfigurationAssignmentsCollectionRequest{ 4673 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 4674 } 4675 } 4676 4677 // ID returns request builder for EnrollmentConfigurationAssignment item 4678 func (b *DeviceEnrollmentConfigurationAssignmentsCollectionRequestBuilder) ID(id string) *EnrollmentConfigurationAssignmentRequestBuilder { 4679 bb := &EnrollmentConfigurationAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4680 bb.baseURL += "/" + id 4681 return bb 4682 } 4683 4684 // DeviceEnrollmentConfigurationAssignmentsCollectionRequest is request for EnrollmentConfigurationAssignment collection 4685 type DeviceEnrollmentConfigurationAssignmentsCollectionRequest struct{ BaseRequest } 4686 4687 // Paging perfoms paging operation for EnrollmentConfigurationAssignment collection 4688 func (r *DeviceEnrollmentConfigurationAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]EnrollmentConfigurationAssignment, error) { 4689 req, err := r.NewJSONRequest(method, path, obj) 4690 if err != nil { 4691 return nil, err 4692 } 4693 if ctx != nil { 4694 req = req.WithContext(ctx) 4695 } 4696 res, err := r.client.Do(req) 4697 if err != nil { 4698 return nil, err 4699 } 4700 var values []EnrollmentConfigurationAssignment 4701 for { 4702 if res.StatusCode != http.StatusOK { 4703 b, _ := ioutil.ReadAll(res.Body) 4704 res.Body.Close() 4705 errRes := &ErrorResponse{Response: res} 4706 err := jsonx.Unmarshal(b, errRes) 4707 if err != nil { 4708 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 4709 } 4710 return nil, errRes 4711 } 4712 var ( 4713 paging Paging 4714 value []EnrollmentConfigurationAssignment 4715 ) 4716 err := jsonx.NewDecoder(res.Body).Decode(&paging) 4717 res.Body.Close() 4718 if err != nil { 4719 return nil, err 4720 } 4721 err = jsonx.Unmarshal(paging.Value, &value) 4722 if err != nil { 4723 return nil, err 4724 } 4725 values = append(values, value...) 4726 if n >= 0 { 4727 n-- 4728 } 4729 if n == 0 || len(paging.NextLink) == 0 { 4730 return values, nil 4731 } 4732 req, err = http.NewRequest("GET", paging.NextLink, nil) 4733 if ctx != nil { 4734 req = req.WithContext(ctx) 4735 } 4736 res, err = r.client.Do(req) 4737 if err != nil { 4738 return nil, err 4739 } 4740 } 4741 } 4742 4743 // GetN performs GET request for EnrollmentConfigurationAssignment collection, max N pages 4744 func (r *DeviceEnrollmentConfigurationAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]EnrollmentConfigurationAssignment, error) { 4745 var query string 4746 if r.query != nil { 4747 query = "?" + r.query.Encode() 4748 } 4749 return r.Paging(ctx, "GET", query, nil, n) 4750 } 4751 4752 // Get performs GET request for EnrollmentConfigurationAssignment collection 4753 func (r *DeviceEnrollmentConfigurationAssignmentsCollectionRequest) Get(ctx context.Context) ([]EnrollmentConfigurationAssignment, error) { 4754 return r.GetN(ctx, 0) 4755 } 4756 4757 // Add performs POST request for EnrollmentConfigurationAssignment collection 4758 func (r *DeviceEnrollmentConfigurationAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *EnrollmentConfigurationAssignment) (resObj *EnrollmentConfigurationAssignment, err error) { 4759 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 4760 return 4761 } 4762 4763 // Assignments returns request builder for DeviceHealthScriptAssignment collection 4764 func (b *DeviceHealthScriptRequestBuilder) Assignments() *DeviceHealthScriptAssignmentsCollectionRequestBuilder { 4765 bb := &DeviceHealthScriptAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4766 bb.baseURL += "/assignments" 4767 return bb 4768 } 4769 4770 // DeviceHealthScriptAssignmentsCollectionRequestBuilder is request builder for DeviceHealthScriptAssignment collection 4771 type DeviceHealthScriptAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder } 4772 4773 // Request returns request for DeviceHealthScriptAssignment collection 4774 func (b *DeviceHealthScriptAssignmentsCollectionRequestBuilder) Request() *DeviceHealthScriptAssignmentsCollectionRequest { 4775 return &DeviceHealthScriptAssignmentsCollectionRequest{ 4776 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 4777 } 4778 } 4779 4780 // ID returns request builder for DeviceHealthScriptAssignment item 4781 func (b *DeviceHealthScriptAssignmentsCollectionRequestBuilder) ID(id string) *DeviceHealthScriptAssignmentRequestBuilder { 4782 bb := &DeviceHealthScriptAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4783 bb.baseURL += "/" + id 4784 return bb 4785 } 4786 4787 // DeviceHealthScriptAssignmentsCollectionRequest is request for DeviceHealthScriptAssignment collection 4788 type DeviceHealthScriptAssignmentsCollectionRequest struct{ BaseRequest } 4789 4790 // Paging perfoms paging operation for DeviceHealthScriptAssignment collection 4791 func (r *DeviceHealthScriptAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceHealthScriptAssignment, error) { 4792 req, err := r.NewJSONRequest(method, path, obj) 4793 if err != nil { 4794 return nil, err 4795 } 4796 if ctx != nil { 4797 req = req.WithContext(ctx) 4798 } 4799 res, err := r.client.Do(req) 4800 if err != nil { 4801 return nil, err 4802 } 4803 var values []DeviceHealthScriptAssignment 4804 for { 4805 if res.StatusCode != http.StatusOK { 4806 b, _ := ioutil.ReadAll(res.Body) 4807 res.Body.Close() 4808 errRes := &ErrorResponse{Response: res} 4809 err := jsonx.Unmarshal(b, errRes) 4810 if err != nil { 4811 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 4812 } 4813 return nil, errRes 4814 } 4815 var ( 4816 paging Paging 4817 value []DeviceHealthScriptAssignment 4818 ) 4819 err := jsonx.NewDecoder(res.Body).Decode(&paging) 4820 res.Body.Close() 4821 if err != nil { 4822 return nil, err 4823 } 4824 err = jsonx.Unmarshal(paging.Value, &value) 4825 if err != nil { 4826 return nil, err 4827 } 4828 values = append(values, value...) 4829 if n >= 0 { 4830 n-- 4831 } 4832 if n == 0 || len(paging.NextLink) == 0 { 4833 return values, nil 4834 } 4835 req, err = http.NewRequest("GET", paging.NextLink, nil) 4836 if ctx != nil { 4837 req = req.WithContext(ctx) 4838 } 4839 res, err = r.client.Do(req) 4840 if err != nil { 4841 return nil, err 4842 } 4843 } 4844 } 4845 4846 // GetN performs GET request for DeviceHealthScriptAssignment collection, max N pages 4847 func (r *DeviceHealthScriptAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceHealthScriptAssignment, error) { 4848 var query string 4849 if r.query != nil { 4850 query = "?" + r.query.Encode() 4851 } 4852 return r.Paging(ctx, "GET", query, nil, n) 4853 } 4854 4855 // Get performs GET request for DeviceHealthScriptAssignment collection 4856 func (r *DeviceHealthScriptAssignmentsCollectionRequest) Get(ctx context.Context) ([]DeviceHealthScriptAssignment, error) { 4857 return r.GetN(ctx, 0) 4858 } 4859 4860 // Add performs POST request for DeviceHealthScriptAssignment collection 4861 func (r *DeviceHealthScriptAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceHealthScriptAssignment) (resObj *DeviceHealthScriptAssignment, err error) { 4862 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 4863 return 4864 } 4865 4866 // DeviceRunStates returns request builder for DeviceHealthScriptDeviceState collection 4867 func (b *DeviceHealthScriptRequestBuilder) DeviceRunStates() *DeviceHealthScriptDeviceRunStatesCollectionRequestBuilder { 4868 bb := &DeviceHealthScriptDeviceRunStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4869 bb.baseURL += "/deviceRunStates" 4870 return bb 4871 } 4872 4873 // DeviceHealthScriptDeviceRunStatesCollectionRequestBuilder is request builder for DeviceHealthScriptDeviceState collection 4874 type DeviceHealthScriptDeviceRunStatesCollectionRequestBuilder struct{ BaseRequestBuilder } 4875 4876 // Request returns request for DeviceHealthScriptDeviceState collection 4877 func (b *DeviceHealthScriptDeviceRunStatesCollectionRequestBuilder) Request() *DeviceHealthScriptDeviceRunStatesCollectionRequest { 4878 return &DeviceHealthScriptDeviceRunStatesCollectionRequest{ 4879 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 4880 } 4881 } 4882 4883 // ID returns request builder for DeviceHealthScriptDeviceState item 4884 func (b *DeviceHealthScriptDeviceRunStatesCollectionRequestBuilder) ID(id string) *DeviceHealthScriptDeviceStateRequestBuilder { 4885 bb := &DeviceHealthScriptDeviceStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4886 bb.baseURL += "/" + id 4887 return bb 4888 } 4889 4890 // DeviceHealthScriptDeviceRunStatesCollectionRequest is request for DeviceHealthScriptDeviceState collection 4891 type DeviceHealthScriptDeviceRunStatesCollectionRequest struct{ BaseRequest } 4892 4893 // Paging perfoms paging operation for DeviceHealthScriptDeviceState collection 4894 func (r *DeviceHealthScriptDeviceRunStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceHealthScriptDeviceState, error) { 4895 req, err := r.NewJSONRequest(method, path, obj) 4896 if err != nil { 4897 return nil, err 4898 } 4899 if ctx != nil { 4900 req = req.WithContext(ctx) 4901 } 4902 res, err := r.client.Do(req) 4903 if err != nil { 4904 return nil, err 4905 } 4906 var values []DeviceHealthScriptDeviceState 4907 for { 4908 if res.StatusCode != http.StatusOK { 4909 b, _ := ioutil.ReadAll(res.Body) 4910 res.Body.Close() 4911 errRes := &ErrorResponse{Response: res} 4912 err := jsonx.Unmarshal(b, errRes) 4913 if err != nil { 4914 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 4915 } 4916 return nil, errRes 4917 } 4918 var ( 4919 paging Paging 4920 value []DeviceHealthScriptDeviceState 4921 ) 4922 err := jsonx.NewDecoder(res.Body).Decode(&paging) 4923 res.Body.Close() 4924 if err != nil { 4925 return nil, err 4926 } 4927 err = jsonx.Unmarshal(paging.Value, &value) 4928 if err != nil { 4929 return nil, err 4930 } 4931 values = append(values, value...) 4932 if n >= 0 { 4933 n-- 4934 } 4935 if n == 0 || len(paging.NextLink) == 0 { 4936 return values, nil 4937 } 4938 req, err = http.NewRequest("GET", paging.NextLink, nil) 4939 if ctx != nil { 4940 req = req.WithContext(ctx) 4941 } 4942 res, err = r.client.Do(req) 4943 if err != nil { 4944 return nil, err 4945 } 4946 } 4947 } 4948 4949 // GetN performs GET request for DeviceHealthScriptDeviceState collection, max N pages 4950 func (r *DeviceHealthScriptDeviceRunStatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceHealthScriptDeviceState, error) { 4951 var query string 4952 if r.query != nil { 4953 query = "?" + r.query.Encode() 4954 } 4955 return r.Paging(ctx, "GET", query, nil, n) 4956 } 4957 4958 // Get performs GET request for DeviceHealthScriptDeviceState collection 4959 func (r *DeviceHealthScriptDeviceRunStatesCollectionRequest) Get(ctx context.Context) ([]DeviceHealthScriptDeviceState, error) { 4960 return r.GetN(ctx, 0) 4961 } 4962 4963 // Add performs POST request for DeviceHealthScriptDeviceState collection 4964 func (r *DeviceHealthScriptDeviceRunStatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceHealthScriptDeviceState) (resObj *DeviceHealthScriptDeviceState, err error) { 4965 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 4966 return 4967 } 4968 4969 // RunSummary is navigation property 4970 func (b *DeviceHealthScriptRequestBuilder) RunSummary() *DeviceHealthScriptRunSummaryRequestBuilder { 4971 bb := &DeviceHealthScriptRunSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4972 bb.baseURL += "/runSummary" 4973 return bb 4974 } 4975 4976 // ManagedDevice is navigation property 4977 func (b *DeviceHealthScriptDeviceStateRequestBuilder) ManagedDevice() *ManagedDeviceRequestBuilder { 4978 bb := &ManagedDeviceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4979 bb.baseURL += "/managedDevice" 4980 return bb 4981 } 4982 4983 // AdvancedThreatProtectionOnboardingStateSummary is navigation property 4984 func (b *DeviceManagementRequestBuilder) AdvancedThreatProtectionOnboardingStateSummary() *AdvancedThreatProtectionOnboardingStateSummaryRequestBuilder { 4985 bb := &AdvancedThreatProtectionOnboardingStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4986 bb.baseURL += "/advancedThreatProtectionOnboardingStateSummary" 4987 return bb 4988 } 4989 4990 // AndroidDeviceOwnerEnrollmentProfiles returns request builder for AndroidDeviceOwnerEnrollmentProfile collection 4991 func (b *DeviceManagementRequestBuilder) AndroidDeviceOwnerEnrollmentProfiles() *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder { 4992 bb := &DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 4993 bb.baseURL += "/androidDeviceOwnerEnrollmentProfiles" 4994 return bb 4995 } 4996 4997 // DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder is request builder for AndroidDeviceOwnerEnrollmentProfile collection 4998 type DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } 4999 5000 // Request returns request for AndroidDeviceOwnerEnrollmentProfile collection 5001 func (b *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder) Request() *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest { 5002 return &DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest{ 5003 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 5004 } 5005 } 5006 5007 // ID returns request builder for AndroidDeviceOwnerEnrollmentProfile item 5008 func (b *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder) ID(id string) *AndroidDeviceOwnerEnrollmentProfileRequestBuilder { 5009 bb := &AndroidDeviceOwnerEnrollmentProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5010 bb.baseURL += "/" + id 5011 return bb 5012 } 5013 5014 // DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest is request for AndroidDeviceOwnerEnrollmentProfile collection 5015 type DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest struct{ BaseRequest } 5016 5017 // Paging perfoms paging operation for AndroidDeviceOwnerEnrollmentProfile collection 5018 func (r *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]AndroidDeviceOwnerEnrollmentProfile, error) { 5019 req, err := r.NewJSONRequest(method, path, obj) 5020 if err != nil { 5021 return nil, err 5022 } 5023 if ctx != nil { 5024 req = req.WithContext(ctx) 5025 } 5026 res, err := r.client.Do(req) 5027 if err != nil { 5028 return nil, err 5029 } 5030 var values []AndroidDeviceOwnerEnrollmentProfile 5031 for { 5032 if res.StatusCode != http.StatusOK { 5033 b, _ := ioutil.ReadAll(res.Body) 5034 res.Body.Close() 5035 errRes := &ErrorResponse{Response: res} 5036 err := jsonx.Unmarshal(b, errRes) 5037 if err != nil { 5038 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 5039 } 5040 return nil, errRes 5041 } 5042 var ( 5043 paging Paging 5044 value []AndroidDeviceOwnerEnrollmentProfile 5045 ) 5046 err := jsonx.NewDecoder(res.Body).Decode(&paging) 5047 res.Body.Close() 5048 if err != nil { 5049 return nil, err 5050 } 5051 err = jsonx.Unmarshal(paging.Value, &value) 5052 if err != nil { 5053 return nil, err 5054 } 5055 values = append(values, value...) 5056 if n >= 0 { 5057 n-- 5058 } 5059 if n == 0 || len(paging.NextLink) == 0 { 5060 return values, nil 5061 } 5062 req, err = http.NewRequest("GET", paging.NextLink, nil) 5063 if ctx != nil { 5064 req = req.WithContext(ctx) 5065 } 5066 res, err = r.client.Do(req) 5067 if err != nil { 5068 return nil, err 5069 } 5070 } 5071 } 5072 5073 // GetN performs GET request for AndroidDeviceOwnerEnrollmentProfile collection, max N pages 5074 func (r *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]AndroidDeviceOwnerEnrollmentProfile, error) { 5075 var query string 5076 if r.query != nil { 5077 query = "?" + r.query.Encode() 5078 } 5079 return r.Paging(ctx, "GET", query, nil, n) 5080 } 5081 5082 // Get performs GET request for AndroidDeviceOwnerEnrollmentProfile collection 5083 func (r *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest) Get(ctx context.Context) ([]AndroidDeviceOwnerEnrollmentProfile, error) { 5084 return r.GetN(ctx, 0) 5085 } 5086 5087 // Add performs POST request for AndroidDeviceOwnerEnrollmentProfile collection 5088 func (r *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest) Add(ctx context.Context, reqObj *AndroidDeviceOwnerEnrollmentProfile) (resObj *AndroidDeviceOwnerEnrollmentProfile, err error) { 5089 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 5090 return 5091 } 5092 5093 // AndroidForWorkAppConfigurationSchemas returns request builder for AndroidForWorkAppConfigurationSchema collection 5094 func (b *DeviceManagementRequestBuilder) AndroidForWorkAppConfigurationSchemas() *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder { 5095 bb := &DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5096 bb.baseURL += "/androidForWorkAppConfigurationSchemas" 5097 return bb 5098 } 5099 5100 // DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder is request builder for AndroidForWorkAppConfigurationSchema collection 5101 type DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder struct{ BaseRequestBuilder } 5102 5103 // Request returns request for AndroidForWorkAppConfigurationSchema collection 5104 func (b *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder) Request() *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest { 5105 return &DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest{ 5106 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 5107 } 5108 } 5109 5110 // ID returns request builder for AndroidForWorkAppConfigurationSchema item 5111 func (b *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder) ID(id string) *AndroidForWorkAppConfigurationSchemaRequestBuilder { 5112 bb := &AndroidForWorkAppConfigurationSchemaRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5113 bb.baseURL += "/" + id 5114 return bb 5115 } 5116 5117 // DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest is request for AndroidForWorkAppConfigurationSchema collection 5118 type DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest struct{ BaseRequest } 5119 5120 // Paging perfoms paging operation for AndroidForWorkAppConfigurationSchema collection 5121 func (r *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]AndroidForWorkAppConfigurationSchema, error) { 5122 req, err := r.NewJSONRequest(method, path, obj) 5123 if err != nil { 5124 return nil, err 5125 } 5126 if ctx != nil { 5127 req = req.WithContext(ctx) 5128 } 5129 res, err := r.client.Do(req) 5130 if err != nil { 5131 return nil, err 5132 } 5133 var values []AndroidForWorkAppConfigurationSchema 5134 for { 5135 if res.StatusCode != http.StatusOK { 5136 b, _ := ioutil.ReadAll(res.Body) 5137 res.Body.Close() 5138 errRes := &ErrorResponse{Response: res} 5139 err := jsonx.Unmarshal(b, errRes) 5140 if err != nil { 5141 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 5142 } 5143 return nil, errRes 5144 } 5145 var ( 5146 paging Paging 5147 value []AndroidForWorkAppConfigurationSchema 5148 ) 5149 err := jsonx.NewDecoder(res.Body).Decode(&paging) 5150 res.Body.Close() 5151 if err != nil { 5152 return nil, err 5153 } 5154 err = jsonx.Unmarshal(paging.Value, &value) 5155 if err != nil { 5156 return nil, err 5157 } 5158 values = append(values, value...) 5159 if n >= 0 { 5160 n-- 5161 } 5162 if n == 0 || len(paging.NextLink) == 0 { 5163 return values, nil 5164 } 5165 req, err = http.NewRequest("GET", paging.NextLink, nil) 5166 if ctx != nil { 5167 req = req.WithContext(ctx) 5168 } 5169 res, err = r.client.Do(req) 5170 if err != nil { 5171 return nil, err 5172 } 5173 } 5174 } 5175 5176 // GetN performs GET request for AndroidForWorkAppConfigurationSchema collection, max N pages 5177 func (r *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest) GetN(ctx context.Context, n int) ([]AndroidForWorkAppConfigurationSchema, error) { 5178 var query string 5179 if r.query != nil { 5180 query = "?" + r.query.Encode() 5181 } 5182 return r.Paging(ctx, "GET", query, nil, n) 5183 } 5184 5185 // Get performs GET request for AndroidForWorkAppConfigurationSchema collection 5186 func (r *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest) Get(ctx context.Context) ([]AndroidForWorkAppConfigurationSchema, error) { 5187 return r.GetN(ctx, 0) 5188 } 5189 5190 // Add performs POST request for AndroidForWorkAppConfigurationSchema collection 5191 func (r *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest) Add(ctx context.Context, reqObj *AndroidForWorkAppConfigurationSchema) (resObj *AndroidForWorkAppConfigurationSchema, err error) { 5192 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 5193 return 5194 } 5195 5196 // AndroidForWorkEnrollmentProfiles returns request builder for AndroidForWorkEnrollmentProfile collection 5197 func (b *DeviceManagementRequestBuilder) AndroidForWorkEnrollmentProfiles() *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder { 5198 bb := &DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5199 bb.baseURL += "/androidForWorkEnrollmentProfiles" 5200 return bb 5201 } 5202 5203 // DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder is request builder for AndroidForWorkEnrollmentProfile collection 5204 type DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } 5205 5206 // Request returns request for AndroidForWorkEnrollmentProfile collection 5207 func (b *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder) Request() *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest { 5208 return &DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest{ 5209 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 5210 } 5211 } 5212 5213 // ID returns request builder for AndroidForWorkEnrollmentProfile item 5214 func (b *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder) ID(id string) *AndroidForWorkEnrollmentProfileRequestBuilder { 5215 bb := &AndroidForWorkEnrollmentProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5216 bb.baseURL += "/" + id 5217 return bb 5218 } 5219 5220 // DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest is request for AndroidForWorkEnrollmentProfile collection 5221 type DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest struct{ BaseRequest } 5222 5223 // Paging perfoms paging operation for AndroidForWorkEnrollmentProfile collection 5224 func (r *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]AndroidForWorkEnrollmentProfile, error) { 5225 req, err := r.NewJSONRequest(method, path, obj) 5226 if err != nil { 5227 return nil, err 5228 } 5229 if ctx != nil { 5230 req = req.WithContext(ctx) 5231 } 5232 res, err := r.client.Do(req) 5233 if err != nil { 5234 return nil, err 5235 } 5236 var values []AndroidForWorkEnrollmentProfile 5237 for { 5238 if res.StatusCode != http.StatusOK { 5239 b, _ := ioutil.ReadAll(res.Body) 5240 res.Body.Close() 5241 errRes := &ErrorResponse{Response: res} 5242 err := jsonx.Unmarshal(b, errRes) 5243 if err != nil { 5244 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 5245 } 5246 return nil, errRes 5247 } 5248 var ( 5249 paging Paging 5250 value []AndroidForWorkEnrollmentProfile 5251 ) 5252 err := jsonx.NewDecoder(res.Body).Decode(&paging) 5253 res.Body.Close() 5254 if err != nil { 5255 return nil, err 5256 } 5257 err = jsonx.Unmarshal(paging.Value, &value) 5258 if err != nil { 5259 return nil, err 5260 } 5261 values = append(values, value...) 5262 if n >= 0 { 5263 n-- 5264 } 5265 if n == 0 || len(paging.NextLink) == 0 { 5266 return values, nil 5267 } 5268 req, err = http.NewRequest("GET", paging.NextLink, nil) 5269 if ctx != nil { 5270 req = req.WithContext(ctx) 5271 } 5272 res, err = r.client.Do(req) 5273 if err != nil { 5274 return nil, err 5275 } 5276 } 5277 } 5278 5279 // GetN performs GET request for AndroidForWorkEnrollmentProfile collection, max N pages 5280 func (r *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]AndroidForWorkEnrollmentProfile, error) { 5281 var query string 5282 if r.query != nil { 5283 query = "?" + r.query.Encode() 5284 } 5285 return r.Paging(ctx, "GET", query, nil, n) 5286 } 5287 5288 // Get performs GET request for AndroidForWorkEnrollmentProfile collection 5289 func (r *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest) Get(ctx context.Context) ([]AndroidForWorkEnrollmentProfile, error) { 5290 return r.GetN(ctx, 0) 5291 } 5292 5293 // Add performs POST request for AndroidForWorkEnrollmentProfile collection 5294 func (r *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest) Add(ctx context.Context, reqObj *AndroidForWorkEnrollmentProfile) (resObj *AndroidForWorkEnrollmentProfile, err error) { 5295 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 5296 return 5297 } 5298 5299 // AndroidForWorkSettings is navigation property 5300 func (b *DeviceManagementRequestBuilder) AndroidForWorkSettings() *AndroidForWorkSettingsRequestBuilder { 5301 bb := &AndroidForWorkSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5302 bb.baseURL += "/androidForWorkSettings" 5303 return bb 5304 } 5305 5306 // AndroidManagedStoreAccountEnterpriseSettings is navigation property 5307 func (b *DeviceManagementRequestBuilder) AndroidManagedStoreAccountEnterpriseSettings() *AndroidManagedStoreAccountEnterpriseSettingsRequestBuilder { 5308 bb := &AndroidManagedStoreAccountEnterpriseSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5309 bb.baseURL += "/androidManagedStoreAccountEnterpriseSettings" 5310 return bb 5311 } 5312 5313 // AndroidManagedStoreAppConfigurationSchemas returns request builder for AndroidManagedStoreAppConfigurationSchema collection 5314 func (b *DeviceManagementRequestBuilder) AndroidManagedStoreAppConfigurationSchemas() *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder { 5315 bb := &DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5316 bb.baseURL += "/androidManagedStoreAppConfigurationSchemas" 5317 return bb 5318 } 5319 5320 // DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder is request builder for AndroidManagedStoreAppConfigurationSchema collection 5321 type DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder struct{ BaseRequestBuilder } 5322 5323 // Request returns request for AndroidManagedStoreAppConfigurationSchema collection 5324 func (b *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder) Request() *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest { 5325 return &DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest{ 5326 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 5327 } 5328 } 5329 5330 // ID returns request builder for AndroidManagedStoreAppConfigurationSchema item 5331 func (b *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder) ID(id string) *AndroidManagedStoreAppConfigurationSchemaRequestBuilder { 5332 bb := &AndroidManagedStoreAppConfigurationSchemaRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5333 bb.baseURL += "/" + id 5334 return bb 5335 } 5336 5337 // DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest is request for AndroidManagedStoreAppConfigurationSchema collection 5338 type DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest struct{ BaseRequest } 5339 5340 // Paging perfoms paging operation for AndroidManagedStoreAppConfigurationSchema collection 5341 func (r *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]AndroidManagedStoreAppConfigurationSchema, error) { 5342 req, err := r.NewJSONRequest(method, path, obj) 5343 if err != nil { 5344 return nil, err 5345 } 5346 if ctx != nil { 5347 req = req.WithContext(ctx) 5348 } 5349 res, err := r.client.Do(req) 5350 if err != nil { 5351 return nil, err 5352 } 5353 var values []AndroidManagedStoreAppConfigurationSchema 5354 for { 5355 if res.StatusCode != http.StatusOK { 5356 b, _ := ioutil.ReadAll(res.Body) 5357 res.Body.Close() 5358 errRes := &ErrorResponse{Response: res} 5359 err := jsonx.Unmarshal(b, errRes) 5360 if err != nil { 5361 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 5362 } 5363 return nil, errRes 5364 } 5365 var ( 5366 paging Paging 5367 value []AndroidManagedStoreAppConfigurationSchema 5368 ) 5369 err := jsonx.NewDecoder(res.Body).Decode(&paging) 5370 res.Body.Close() 5371 if err != nil { 5372 return nil, err 5373 } 5374 err = jsonx.Unmarshal(paging.Value, &value) 5375 if err != nil { 5376 return nil, err 5377 } 5378 values = append(values, value...) 5379 if n >= 0 { 5380 n-- 5381 } 5382 if n == 0 || len(paging.NextLink) == 0 { 5383 return values, nil 5384 } 5385 req, err = http.NewRequest("GET", paging.NextLink, nil) 5386 if ctx != nil { 5387 req = req.WithContext(ctx) 5388 } 5389 res, err = r.client.Do(req) 5390 if err != nil { 5391 return nil, err 5392 } 5393 } 5394 } 5395 5396 // GetN performs GET request for AndroidManagedStoreAppConfigurationSchema collection, max N pages 5397 func (r *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest) GetN(ctx context.Context, n int) ([]AndroidManagedStoreAppConfigurationSchema, error) { 5398 var query string 5399 if r.query != nil { 5400 query = "?" + r.query.Encode() 5401 } 5402 return r.Paging(ctx, "GET", query, nil, n) 5403 } 5404 5405 // Get performs GET request for AndroidManagedStoreAppConfigurationSchema collection 5406 func (r *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest) Get(ctx context.Context) ([]AndroidManagedStoreAppConfigurationSchema, error) { 5407 return r.GetN(ctx, 0) 5408 } 5409 5410 // Add performs POST request for AndroidManagedStoreAppConfigurationSchema collection 5411 func (r *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest) Add(ctx context.Context, reqObj *AndroidManagedStoreAppConfigurationSchema) (resObj *AndroidManagedStoreAppConfigurationSchema, err error) { 5412 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 5413 return 5414 } 5415 5416 // ApplePushNotificationCertificate is navigation property 5417 func (b *DeviceManagementRequestBuilder) ApplePushNotificationCertificate() *ApplePushNotificationCertificateRequestBuilder { 5418 bb := &ApplePushNotificationCertificateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5419 bb.baseURL += "/applePushNotificationCertificate" 5420 return bb 5421 } 5422 5423 // AppleUserInitiatedEnrollmentProfiles returns request builder for AppleUserInitiatedEnrollmentProfile collection 5424 func (b *DeviceManagementRequestBuilder) AppleUserInitiatedEnrollmentProfiles() *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder { 5425 bb := &DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5426 bb.baseURL += "/appleUserInitiatedEnrollmentProfiles" 5427 return bb 5428 } 5429 5430 // DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder is request builder for AppleUserInitiatedEnrollmentProfile collection 5431 type DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } 5432 5433 // Request returns request for AppleUserInitiatedEnrollmentProfile collection 5434 func (b *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder) Request() *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest { 5435 return &DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest{ 5436 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 5437 } 5438 } 5439 5440 // ID returns request builder for AppleUserInitiatedEnrollmentProfile item 5441 func (b *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder) ID(id string) *AppleUserInitiatedEnrollmentProfileRequestBuilder { 5442 bb := &AppleUserInitiatedEnrollmentProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5443 bb.baseURL += "/" + id 5444 return bb 5445 } 5446 5447 // DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest is request for AppleUserInitiatedEnrollmentProfile collection 5448 type DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest struct{ BaseRequest } 5449 5450 // Paging perfoms paging operation for AppleUserInitiatedEnrollmentProfile collection 5451 func (r *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]AppleUserInitiatedEnrollmentProfile, error) { 5452 req, err := r.NewJSONRequest(method, path, obj) 5453 if err != nil { 5454 return nil, err 5455 } 5456 if ctx != nil { 5457 req = req.WithContext(ctx) 5458 } 5459 res, err := r.client.Do(req) 5460 if err != nil { 5461 return nil, err 5462 } 5463 var values []AppleUserInitiatedEnrollmentProfile 5464 for { 5465 if res.StatusCode != http.StatusOK { 5466 b, _ := ioutil.ReadAll(res.Body) 5467 res.Body.Close() 5468 errRes := &ErrorResponse{Response: res} 5469 err := jsonx.Unmarshal(b, errRes) 5470 if err != nil { 5471 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 5472 } 5473 return nil, errRes 5474 } 5475 var ( 5476 paging Paging 5477 value []AppleUserInitiatedEnrollmentProfile 5478 ) 5479 err := jsonx.NewDecoder(res.Body).Decode(&paging) 5480 res.Body.Close() 5481 if err != nil { 5482 return nil, err 5483 } 5484 err = jsonx.Unmarshal(paging.Value, &value) 5485 if err != nil { 5486 return nil, err 5487 } 5488 values = append(values, value...) 5489 if n >= 0 { 5490 n-- 5491 } 5492 if n == 0 || len(paging.NextLink) == 0 { 5493 return values, nil 5494 } 5495 req, err = http.NewRequest("GET", paging.NextLink, nil) 5496 if ctx != nil { 5497 req = req.WithContext(ctx) 5498 } 5499 res, err = r.client.Do(req) 5500 if err != nil { 5501 return nil, err 5502 } 5503 } 5504 } 5505 5506 // GetN performs GET request for AppleUserInitiatedEnrollmentProfile collection, max N pages 5507 func (r *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]AppleUserInitiatedEnrollmentProfile, error) { 5508 var query string 5509 if r.query != nil { 5510 query = "?" + r.query.Encode() 5511 } 5512 return r.Paging(ctx, "GET", query, nil, n) 5513 } 5514 5515 // Get performs GET request for AppleUserInitiatedEnrollmentProfile collection 5516 func (r *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest) Get(ctx context.Context) ([]AppleUserInitiatedEnrollmentProfile, error) { 5517 return r.GetN(ctx, 0) 5518 } 5519 5520 // Add performs POST request for AppleUserInitiatedEnrollmentProfile collection 5521 func (r *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest) Add(ctx context.Context, reqObj *AppleUserInitiatedEnrollmentProfile) (resObj *AppleUserInitiatedEnrollmentProfile, err error) { 5522 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 5523 return 5524 } 5525 5526 // AuditEvents returns request builder for AuditEvent collection 5527 func (b *DeviceManagementRequestBuilder) AuditEvents() *DeviceManagementAuditEventsCollectionRequestBuilder { 5528 bb := &DeviceManagementAuditEventsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5529 bb.baseURL += "/auditEvents" 5530 return bb 5531 } 5532 5533 // DeviceManagementAuditEventsCollectionRequestBuilder is request builder for AuditEvent collection 5534 type DeviceManagementAuditEventsCollectionRequestBuilder struct{ BaseRequestBuilder } 5535 5536 // Request returns request for AuditEvent collection 5537 func (b *DeviceManagementAuditEventsCollectionRequestBuilder) Request() *DeviceManagementAuditEventsCollectionRequest { 5538 return &DeviceManagementAuditEventsCollectionRequest{ 5539 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 5540 } 5541 } 5542 5543 // ID returns request builder for AuditEvent item 5544 func (b *DeviceManagementAuditEventsCollectionRequestBuilder) ID(id string) *AuditEventRequestBuilder { 5545 bb := &AuditEventRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5546 bb.baseURL += "/" + id 5547 return bb 5548 } 5549 5550 // DeviceManagementAuditEventsCollectionRequest is request for AuditEvent collection 5551 type DeviceManagementAuditEventsCollectionRequest struct{ BaseRequest } 5552 5553 // Paging perfoms paging operation for AuditEvent collection 5554 func (r *DeviceManagementAuditEventsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]AuditEvent, error) { 5555 req, err := r.NewJSONRequest(method, path, obj) 5556 if err != nil { 5557 return nil, err 5558 } 5559 if ctx != nil { 5560 req = req.WithContext(ctx) 5561 } 5562 res, err := r.client.Do(req) 5563 if err != nil { 5564 return nil, err 5565 } 5566 var values []AuditEvent 5567 for { 5568 if res.StatusCode != http.StatusOK { 5569 b, _ := ioutil.ReadAll(res.Body) 5570 res.Body.Close() 5571 errRes := &ErrorResponse{Response: res} 5572 err := jsonx.Unmarshal(b, errRes) 5573 if err != nil { 5574 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 5575 } 5576 return nil, errRes 5577 } 5578 var ( 5579 paging Paging 5580 value []AuditEvent 5581 ) 5582 err := jsonx.NewDecoder(res.Body).Decode(&paging) 5583 res.Body.Close() 5584 if err != nil { 5585 return nil, err 5586 } 5587 err = jsonx.Unmarshal(paging.Value, &value) 5588 if err != nil { 5589 return nil, err 5590 } 5591 values = append(values, value...) 5592 if n >= 0 { 5593 n-- 5594 } 5595 if n == 0 || len(paging.NextLink) == 0 { 5596 return values, nil 5597 } 5598 req, err = http.NewRequest("GET", paging.NextLink, nil) 5599 if ctx != nil { 5600 req = req.WithContext(ctx) 5601 } 5602 res, err = r.client.Do(req) 5603 if err != nil { 5604 return nil, err 5605 } 5606 } 5607 } 5608 5609 // GetN performs GET request for AuditEvent collection, max N pages 5610 func (r *DeviceManagementAuditEventsCollectionRequest) GetN(ctx context.Context, n int) ([]AuditEvent, error) { 5611 var query string 5612 if r.query != nil { 5613 query = "?" + r.query.Encode() 5614 } 5615 return r.Paging(ctx, "GET", query, nil, n) 5616 } 5617 5618 // Get performs GET request for AuditEvent collection 5619 func (r *DeviceManagementAuditEventsCollectionRequest) Get(ctx context.Context) ([]AuditEvent, error) { 5620 return r.GetN(ctx, 0) 5621 } 5622 5623 // Add performs POST request for AuditEvent collection 5624 func (r *DeviceManagementAuditEventsCollectionRequest) Add(ctx context.Context, reqObj *AuditEvent) (resObj *AuditEvent, err error) { 5625 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 5626 return 5627 } 5628 5629 // AutopilotEvents returns request builder for DeviceManagementAutopilotEvent collection 5630 func (b *DeviceManagementRequestBuilder) AutopilotEvents() *DeviceManagementAutopilotEventsCollectionRequestBuilder { 5631 bb := &DeviceManagementAutopilotEventsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5632 bb.baseURL += "/autopilotEvents" 5633 return bb 5634 } 5635 5636 // DeviceManagementAutopilotEventsCollectionRequestBuilder is request builder for DeviceManagementAutopilotEvent collection 5637 type DeviceManagementAutopilotEventsCollectionRequestBuilder struct{ BaseRequestBuilder } 5638 5639 // Request returns request for DeviceManagementAutopilotEvent collection 5640 func (b *DeviceManagementAutopilotEventsCollectionRequestBuilder) Request() *DeviceManagementAutopilotEventsCollectionRequest { 5641 return &DeviceManagementAutopilotEventsCollectionRequest{ 5642 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 5643 } 5644 } 5645 5646 // ID returns request builder for DeviceManagementAutopilotEvent item 5647 func (b *DeviceManagementAutopilotEventsCollectionRequestBuilder) ID(id string) *DeviceManagementAutopilotEventRequestBuilder { 5648 bb := &DeviceManagementAutopilotEventRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5649 bb.baseURL += "/" + id 5650 return bb 5651 } 5652 5653 // DeviceManagementAutopilotEventsCollectionRequest is request for DeviceManagementAutopilotEvent collection 5654 type DeviceManagementAutopilotEventsCollectionRequest struct{ BaseRequest } 5655 5656 // Paging perfoms paging operation for DeviceManagementAutopilotEvent collection 5657 func (r *DeviceManagementAutopilotEventsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementAutopilotEvent, error) { 5658 req, err := r.NewJSONRequest(method, path, obj) 5659 if err != nil { 5660 return nil, err 5661 } 5662 if ctx != nil { 5663 req = req.WithContext(ctx) 5664 } 5665 res, err := r.client.Do(req) 5666 if err != nil { 5667 return nil, err 5668 } 5669 var values []DeviceManagementAutopilotEvent 5670 for { 5671 if res.StatusCode != http.StatusOK { 5672 b, _ := ioutil.ReadAll(res.Body) 5673 res.Body.Close() 5674 errRes := &ErrorResponse{Response: res} 5675 err := jsonx.Unmarshal(b, errRes) 5676 if err != nil { 5677 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 5678 } 5679 return nil, errRes 5680 } 5681 var ( 5682 paging Paging 5683 value []DeviceManagementAutopilotEvent 5684 ) 5685 err := jsonx.NewDecoder(res.Body).Decode(&paging) 5686 res.Body.Close() 5687 if err != nil { 5688 return nil, err 5689 } 5690 err = jsonx.Unmarshal(paging.Value, &value) 5691 if err != nil { 5692 return nil, err 5693 } 5694 values = append(values, value...) 5695 if n >= 0 { 5696 n-- 5697 } 5698 if n == 0 || len(paging.NextLink) == 0 { 5699 return values, nil 5700 } 5701 req, err = http.NewRequest("GET", paging.NextLink, nil) 5702 if ctx != nil { 5703 req = req.WithContext(ctx) 5704 } 5705 res, err = r.client.Do(req) 5706 if err != nil { 5707 return nil, err 5708 } 5709 } 5710 } 5711 5712 // GetN performs GET request for DeviceManagementAutopilotEvent collection, max N pages 5713 func (r *DeviceManagementAutopilotEventsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementAutopilotEvent, error) { 5714 var query string 5715 if r.query != nil { 5716 query = "?" + r.query.Encode() 5717 } 5718 return r.Paging(ctx, "GET", query, nil, n) 5719 } 5720 5721 // Get performs GET request for DeviceManagementAutopilotEvent collection 5722 func (r *DeviceManagementAutopilotEventsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementAutopilotEvent, error) { 5723 return r.GetN(ctx, 0) 5724 } 5725 5726 // Add performs POST request for DeviceManagementAutopilotEvent collection 5727 func (r *DeviceManagementAutopilotEventsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementAutopilotEvent) (resObj *DeviceManagementAutopilotEvent, err error) { 5728 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 5729 return 5730 } 5731 5732 // CartToClassAssociations returns request builder for CartToClassAssociation collection 5733 func (b *DeviceManagementRequestBuilder) CartToClassAssociations() *DeviceManagementCartToClassAssociationsCollectionRequestBuilder { 5734 bb := &DeviceManagementCartToClassAssociationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5735 bb.baseURL += "/cartToClassAssociations" 5736 return bb 5737 } 5738 5739 // DeviceManagementCartToClassAssociationsCollectionRequestBuilder is request builder for CartToClassAssociation collection 5740 type DeviceManagementCartToClassAssociationsCollectionRequestBuilder struct{ BaseRequestBuilder } 5741 5742 // Request returns request for CartToClassAssociation collection 5743 func (b *DeviceManagementCartToClassAssociationsCollectionRequestBuilder) Request() *DeviceManagementCartToClassAssociationsCollectionRequest { 5744 return &DeviceManagementCartToClassAssociationsCollectionRequest{ 5745 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 5746 } 5747 } 5748 5749 // ID returns request builder for CartToClassAssociation item 5750 func (b *DeviceManagementCartToClassAssociationsCollectionRequestBuilder) ID(id string) *CartToClassAssociationRequestBuilder { 5751 bb := &CartToClassAssociationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5752 bb.baseURL += "/" + id 5753 return bb 5754 } 5755 5756 // DeviceManagementCartToClassAssociationsCollectionRequest is request for CartToClassAssociation collection 5757 type DeviceManagementCartToClassAssociationsCollectionRequest struct{ BaseRequest } 5758 5759 // Paging perfoms paging operation for CartToClassAssociation collection 5760 func (r *DeviceManagementCartToClassAssociationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]CartToClassAssociation, error) { 5761 req, err := r.NewJSONRequest(method, path, obj) 5762 if err != nil { 5763 return nil, err 5764 } 5765 if ctx != nil { 5766 req = req.WithContext(ctx) 5767 } 5768 res, err := r.client.Do(req) 5769 if err != nil { 5770 return nil, err 5771 } 5772 var values []CartToClassAssociation 5773 for { 5774 if res.StatusCode != http.StatusOK { 5775 b, _ := ioutil.ReadAll(res.Body) 5776 res.Body.Close() 5777 errRes := &ErrorResponse{Response: res} 5778 err := jsonx.Unmarshal(b, errRes) 5779 if err != nil { 5780 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 5781 } 5782 return nil, errRes 5783 } 5784 var ( 5785 paging Paging 5786 value []CartToClassAssociation 5787 ) 5788 err := jsonx.NewDecoder(res.Body).Decode(&paging) 5789 res.Body.Close() 5790 if err != nil { 5791 return nil, err 5792 } 5793 err = jsonx.Unmarshal(paging.Value, &value) 5794 if err != nil { 5795 return nil, err 5796 } 5797 values = append(values, value...) 5798 if n >= 0 { 5799 n-- 5800 } 5801 if n == 0 || len(paging.NextLink) == 0 { 5802 return values, nil 5803 } 5804 req, err = http.NewRequest("GET", paging.NextLink, nil) 5805 if ctx != nil { 5806 req = req.WithContext(ctx) 5807 } 5808 res, err = r.client.Do(req) 5809 if err != nil { 5810 return nil, err 5811 } 5812 } 5813 } 5814 5815 // GetN performs GET request for CartToClassAssociation collection, max N pages 5816 func (r *DeviceManagementCartToClassAssociationsCollectionRequest) GetN(ctx context.Context, n int) ([]CartToClassAssociation, error) { 5817 var query string 5818 if r.query != nil { 5819 query = "?" + r.query.Encode() 5820 } 5821 return r.Paging(ctx, "GET", query, nil, n) 5822 } 5823 5824 // Get performs GET request for CartToClassAssociation collection 5825 func (r *DeviceManagementCartToClassAssociationsCollectionRequest) Get(ctx context.Context) ([]CartToClassAssociation, error) { 5826 return r.GetN(ctx, 0) 5827 } 5828 5829 // Add performs POST request for CartToClassAssociation collection 5830 func (r *DeviceManagementCartToClassAssociationsCollectionRequest) Add(ctx context.Context, reqObj *CartToClassAssociation) (resObj *CartToClassAssociation, err error) { 5831 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 5832 return 5833 } 5834 5835 // Categories returns request builder for DeviceManagementSettingCategory collection 5836 func (b *DeviceManagementRequestBuilder) Categories() *DeviceManagementCategoriesCollectionRequestBuilder { 5837 bb := &DeviceManagementCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5838 bb.baseURL += "/categories" 5839 return bb 5840 } 5841 5842 // DeviceManagementCategoriesCollectionRequestBuilder is request builder for DeviceManagementSettingCategory collection 5843 type DeviceManagementCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder } 5844 5845 // Request returns request for DeviceManagementSettingCategory collection 5846 func (b *DeviceManagementCategoriesCollectionRequestBuilder) Request() *DeviceManagementCategoriesCollectionRequest { 5847 return &DeviceManagementCategoriesCollectionRequest{ 5848 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 5849 } 5850 } 5851 5852 // ID returns request builder for DeviceManagementSettingCategory item 5853 func (b *DeviceManagementCategoriesCollectionRequestBuilder) ID(id string) *DeviceManagementSettingCategoryRequestBuilder { 5854 bb := &DeviceManagementSettingCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5855 bb.baseURL += "/" + id 5856 return bb 5857 } 5858 5859 // DeviceManagementCategoriesCollectionRequest is request for DeviceManagementSettingCategory collection 5860 type DeviceManagementCategoriesCollectionRequest struct{ BaseRequest } 5861 5862 // Paging perfoms paging operation for DeviceManagementSettingCategory collection 5863 func (r *DeviceManagementCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementSettingCategory, error) { 5864 req, err := r.NewJSONRequest(method, path, obj) 5865 if err != nil { 5866 return nil, err 5867 } 5868 if ctx != nil { 5869 req = req.WithContext(ctx) 5870 } 5871 res, err := r.client.Do(req) 5872 if err != nil { 5873 return nil, err 5874 } 5875 var values []DeviceManagementSettingCategory 5876 for { 5877 if res.StatusCode != http.StatusOK { 5878 b, _ := ioutil.ReadAll(res.Body) 5879 res.Body.Close() 5880 errRes := &ErrorResponse{Response: res} 5881 err := jsonx.Unmarshal(b, errRes) 5882 if err != nil { 5883 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 5884 } 5885 return nil, errRes 5886 } 5887 var ( 5888 paging Paging 5889 value []DeviceManagementSettingCategory 5890 ) 5891 err := jsonx.NewDecoder(res.Body).Decode(&paging) 5892 res.Body.Close() 5893 if err != nil { 5894 return nil, err 5895 } 5896 err = jsonx.Unmarshal(paging.Value, &value) 5897 if err != nil { 5898 return nil, err 5899 } 5900 values = append(values, value...) 5901 if n >= 0 { 5902 n-- 5903 } 5904 if n == 0 || len(paging.NextLink) == 0 { 5905 return values, nil 5906 } 5907 req, err = http.NewRequest("GET", paging.NextLink, nil) 5908 if ctx != nil { 5909 req = req.WithContext(ctx) 5910 } 5911 res, err = r.client.Do(req) 5912 if err != nil { 5913 return nil, err 5914 } 5915 } 5916 } 5917 5918 // GetN performs GET request for DeviceManagementSettingCategory collection, max N pages 5919 func (r *DeviceManagementCategoriesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementSettingCategory, error) { 5920 var query string 5921 if r.query != nil { 5922 query = "?" + r.query.Encode() 5923 } 5924 return r.Paging(ctx, "GET", query, nil, n) 5925 } 5926 5927 // Get performs GET request for DeviceManagementSettingCategory collection 5928 func (r *DeviceManagementCategoriesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingCategory, error) { 5929 return r.GetN(ctx, 0) 5930 } 5931 5932 // Add performs POST request for DeviceManagementSettingCategory collection 5933 func (r *DeviceManagementCategoriesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingCategory) (resObj *DeviceManagementSettingCategory, err error) { 5934 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 5935 return 5936 } 5937 5938 // ComplianceManagementPartners returns request builder for ComplianceManagementPartner collection 5939 func (b *DeviceManagementRequestBuilder) ComplianceManagementPartners() *DeviceManagementComplianceManagementPartnersCollectionRequestBuilder { 5940 bb := &DeviceManagementComplianceManagementPartnersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5941 bb.baseURL += "/complianceManagementPartners" 5942 return bb 5943 } 5944 5945 // DeviceManagementComplianceManagementPartnersCollectionRequestBuilder is request builder for ComplianceManagementPartner collection 5946 type DeviceManagementComplianceManagementPartnersCollectionRequestBuilder struct{ BaseRequestBuilder } 5947 5948 // Request returns request for ComplianceManagementPartner collection 5949 func (b *DeviceManagementComplianceManagementPartnersCollectionRequestBuilder) Request() *DeviceManagementComplianceManagementPartnersCollectionRequest { 5950 return &DeviceManagementComplianceManagementPartnersCollectionRequest{ 5951 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 5952 } 5953 } 5954 5955 // ID returns request builder for ComplianceManagementPartner item 5956 func (b *DeviceManagementComplianceManagementPartnersCollectionRequestBuilder) ID(id string) *ComplianceManagementPartnerRequestBuilder { 5957 bb := &ComplianceManagementPartnerRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 5958 bb.baseURL += "/" + id 5959 return bb 5960 } 5961 5962 // DeviceManagementComplianceManagementPartnersCollectionRequest is request for ComplianceManagementPartner collection 5963 type DeviceManagementComplianceManagementPartnersCollectionRequest struct{ BaseRequest } 5964 5965 // Paging perfoms paging operation for ComplianceManagementPartner collection 5966 func (r *DeviceManagementComplianceManagementPartnersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ComplianceManagementPartner, error) { 5967 req, err := r.NewJSONRequest(method, path, obj) 5968 if err != nil { 5969 return nil, err 5970 } 5971 if ctx != nil { 5972 req = req.WithContext(ctx) 5973 } 5974 res, err := r.client.Do(req) 5975 if err != nil { 5976 return nil, err 5977 } 5978 var values []ComplianceManagementPartner 5979 for { 5980 if res.StatusCode != http.StatusOK { 5981 b, _ := ioutil.ReadAll(res.Body) 5982 res.Body.Close() 5983 errRes := &ErrorResponse{Response: res} 5984 err := jsonx.Unmarshal(b, errRes) 5985 if err != nil { 5986 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 5987 } 5988 return nil, errRes 5989 } 5990 var ( 5991 paging Paging 5992 value []ComplianceManagementPartner 5993 ) 5994 err := jsonx.NewDecoder(res.Body).Decode(&paging) 5995 res.Body.Close() 5996 if err != nil { 5997 return nil, err 5998 } 5999 err = jsonx.Unmarshal(paging.Value, &value) 6000 if err != nil { 6001 return nil, err 6002 } 6003 values = append(values, value...) 6004 if n >= 0 { 6005 n-- 6006 } 6007 if n == 0 || len(paging.NextLink) == 0 { 6008 return values, nil 6009 } 6010 req, err = http.NewRequest("GET", paging.NextLink, nil) 6011 if ctx != nil { 6012 req = req.WithContext(ctx) 6013 } 6014 res, err = r.client.Do(req) 6015 if err != nil { 6016 return nil, err 6017 } 6018 } 6019 } 6020 6021 // GetN performs GET request for ComplianceManagementPartner collection, max N pages 6022 func (r *DeviceManagementComplianceManagementPartnersCollectionRequest) GetN(ctx context.Context, n int) ([]ComplianceManagementPartner, error) { 6023 var query string 6024 if r.query != nil { 6025 query = "?" + r.query.Encode() 6026 } 6027 return r.Paging(ctx, "GET", query, nil, n) 6028 } 6029 6030 // Get performs GET request for ComplianceManagementPartner collection 6031 func (r *DeviceManagementComplianceManagementPartnersCollectionRequest) Get(ctx context.Context) ([]ComplianceManagementPartner, error) { 6032 return r.GetN(ctx, 0) 6033 } 6034 6035 // Add performs POST request for ComplianceManagementPartner collection 6036 func (r *DeviceManagementComplianceManagementPartnersCollectionRequest) Add(ctx context.Context, reqObj *ComplianceManagementPartner) (resObj *ComplianceManagementPartner, err error) { 6037 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 6038 return 6039 } 6040 6041 // ConditionalAccessSettings is navigation property 6042 func (b *DeviceManagementRequestBuilder) ConditionalAccessSettings() *OnPremisesConditionalAccessSettingsRequestBuilder { 6043 bb := &OnPremisesConditionalAccessSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6044 bb.baseURL += "/conditionalAccessSettings" 6045 return bb 6046 } 6047 6048 // DataSharingConsents returns request builder for DataSharingConsent collection 6049 func (b *DeviceManagementRequestBuilder) DataSharingConsents() *DeviceManagementDataSharingConsentsCollectionRequestBuilder { 6050 bb := &DeviceManagementDataSharingConsentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6051 bb.baseURL += "/dataSharingConsents" 6052 return bb 6053 } 6054 6055 // DeviceManagementDataSharingConsentsCollectionRequestBuilder is request builder for DataSharingConsent collection 6056 type DeviceManagementDataSharingConsentsCollectionRequestBuilder struct{ BaseRequestBuilder } 6057 6058 // Request returns request for DataSharingConsent collection 6059 func (b *DeviceManagementDataSharingConsentsCollectionRequestBuilder) Request() *DeviceManagementDataSharingConsentsCollectionRequest { 6060 return &DeviceManagementDataSharingConsentsCollectionRequest{ 6061 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 6062 } 6063 } 6064 6065 // ID returns request builder for DataSharingConsent item 6066 func (b *DeviceManagementDataSharingConsentsCollectionRequestBuilder) ID(id string) *DataSharingConsentRequestBuilder { 6067 bb := &DataSharingConsentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6068 bb.baseURL += "/" + id 6069 return bb 6070 } 6071 6072 // DeviceManagementDataSharingConsentsCollectionRequest is request for DataSharingConsent collection 6073 type DeviceManagementDataSharingConsentsCollectionRequest struct{ BaseRequest } 6074 6075 // Paging perfoms paging operation for DataSharingConsent collection 6076 func (r *DeviceManagementDataSharingConsentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DataSharingConsent, error) { 6077 req, err := r.NewJSONRequest(method, path, obj) 6078 if err != nil { 6079 return nil, err 6080 } 6081 if ctx != nil { 6082 req = req.WithContext(ctx) 6083 } 6084 res, err := r.client.Do(req) 6085 if err != nil { 6086 return nil, err 6087 } 6088 var values []DataSharingConsent 6089 for { 6090 if res.StatusCode != http.StatusOK { 6091 b, _ := ioutil.ReadAll(res.Body) 6092 res.Body.Close() 6093 errRes := &ErrorResponse{Response: res} 6094 err := jsonx.Unmarshal(b, errRes) 6095 if err != nil { 6096 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 6097 } 6098 return nil, errRes 6099 } 6100 var ( 6101 paging Paging 6102 value []DataSharingConsent 6103 ) 6104 err := jsonx.NewDecoder(res.Body).Decode(&paging) 6105 res.Body.Close() 6106 if err != nil { 6107 return nil, err 6108 } 6109 err = jsonx.Unmarshal(paging.Value, &value) 6110 if err != nil { 6111 return nil, err 6112 } 6113 values = append(values, value...) 6114 if n >= 0 { 6115 n-- 6116 } 6117 if n == 0 || len(paging.NextLink) == 0 { 6118 return values, nil 6119 } 6120 req, err = http.NewRequest("GET", paging.NextLink, nil) 6121 if ctx != nil { 6122 req = req.WithContext(ctx) 6123 } 6124 res, err = r.client.Do(req) 6125 if err != nil { 6126 return nil, err 6127 } 6128 } 6129 } 6130 6131 // GetN performs GET request for DataSharingConsent collection, max N pages 6132 func (r *DeviceManagementDataSharingConsentsCollectionRequest) GetN(ctx context.Context, n int) ([]DataSharingConsent, error) { 6133 var query string 6134 if r.query != nil { 6135 query = "?" + r.query.Encode() 6136 } 6137 return r.Paging(ctx, "GET", query, nil, n) 6138 } 6139 6140 // Get performs GET request for DataSharingConsent collection 6141 func (r *DeviceManagementDataSharingConsentsCollectionRequest) Get(ctx context.Context) ([]DataSharingConsent, error) { 6142 return r.GetN(ctx, 0) 6143 } 6144 6145 // Add performs POST request for DataSharingConsent collection 6146 func (r *DeviceManagementDataSharingConsentsCollectionRequest) Add(ctx context.Context, reqObj *DataSharingConsent) (resObj *DataSharingConsent, err error) { 6147 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 6148 return 6149 } 6150 6151 // DepOnboardingSettings returns request builder for DepOnboardingSetting collection 6152 func (b *DeviceManagementRequestBuilder) DepOnboardingSettings() *DeviceManagementDepOnboardingSettingsCollectionRequestBuilder { 6153 bb := &DeviceManagementDepOnboardingSettingsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6154 bb.baseURL += "/depOnboardingSettings" 6155 return bb 6156 } 6157 6158 // DeviceManagementDepOnboardingSettingsCollectionRequestBuilder is request builder for DepOnboardingSetting collection 6159 type DeviceManagementDepOnboardingSettingsCollectionRequestBuilder struct{ BaseRequestBuilder } 6160 6161 // Request returns request for DepOnboardingSetting collection 6162 func (b *DeviceManagementDepOnboardingSettingsCollectionRequestBuilder) Request() *DeviceManagementDepOnboardingSettingsCollectionRequest { 6163 return &DeviceManagementDepOnboardingSettingsCollectionRequest{ 6164 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 6165 } 6166 } 6167 6168 // ID returns request builder for DepOnboardingSetting item 6169 func (b *DeviceManagementDepOnboardingSettingsCollectionRequestBuilder) ID(id string) *DepOnboardingSettingRequestBuilder { 6170 bb := &DepOnboardingSettingRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6171 bb.baseURL += "/" + id 6172 return bb 6173 } 6174 6175 // DeviceManagementDepOnboardingSettingsCollectionRequest is request for DepOnboardingSetting collection 6176 type DeviceManagementDepOnboardingSettingsCollectionRequest struct{ BaseRequest } 6177 6178 // Paging perfoms paging operation for DepOnboardingSetting collection 6179 func (r *DeviceManagementDepOnboardingSettingsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DepOnboardingSetting, error) { 6180 req, err := r.NewJSONRequest(method, path, obj) 6181 if err != nil { 6182 return nil, err 6183 } 6184 if ctx != nil { 6185 req = req.WithContext(ctx) 6186 } 6187 res, err := r.client.Do(req) 6188 if err != nil { 6189 return nil, err 6190 } 6191 var values []DepOnboardingSetting 6192 for { 6193 if res.StatusCode != http.StatusOK { 6194 b, _ := ioutil.ReadAll(res.Body) 6195 res.Body.Close() 6196 errRes := &ErrorResponse{Response: res} 6197 err := jsonx.Unmarshal(b, errRes) 6198 if err != nil { 6199 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 6200 } 6201 return nil, errRes 6202 } 6203 var ( 6204 paging Paging 6205 value []DepOnboardingSetting 6206 ) 6207 err := jsonx.NewDecoder(res.Body).Decode(&paging) 6208 res.Body.Close() 6209 if err != nil { 6210 return nil, err 6211 } 6212 err = jsonx.Unmarshal(paging.Value, &value) 6213 if err != nil { 6214 return nil, err 6215 } 6216 values = append(values, value...) 6217 if n >= 0 { 6218 n-- 6219 } 6220 if n == 0 || len(paging.NextLink) == 0 { 6221 return values, nil 6222 } 6223 req, err = http.NewRequest("GET", paging.NextLink, nil) 6224 if ctx != nil { 6225 req = req.WithContext(ctx) 6226 } 6227 res, err = r.client.Do(req) 6228 if err != nil { 6229 return nil, err 6230 } 6231 } 6232 } 6233 6234 // GetN performs GET request for DepOnboardingSetting collection, max N pages 6235 func (r *DeviceManagementDepOnboardingSettingsCollectionRequest) GetN(ctx context.Context, n int) ([]DepOnboardingSetting, error) { 6236 var query string 6237 if r.query != nil { 6238 query = "?" + r.query.Encode() 6239 } 6240 return r.Paging(ctx, "GET", query, nil, n) 6241 } 6242 6243 // Get performs GET request for DepOnboardingSetting collection 6244 func (r *DeviceManagementDepOnboardingSettingsCollectionRequest) Get(ctx context.Context) ([]DepOnboardingSetting, error) { 6245 return r.GetN(ctx, 0) 6246 } 6247 6248 // Add performs POST request for DepOnboardingSetting collection 6249 func (r *DeviceManagementDepOnboardingSettingsCollectionRequest) Add(ctx context.Context, reqObj *DepOnboardingSetting) (resObj *DepOnboardingSetting, err error) { 6250 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 6251 return 6252 } 6253 6254 // DerivedCredentials returns request builder for DeviceManagementDerivedCredentialSettings collection 6255 func (b *DeviceManagementRequestBuilder) DerivedCredentials() *DeviceManagementDerivedCredentialsCollectionRequestBuilder { 6256 bb := &DeviceManagementDerivedCredentialsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6257 bb.baseURL += "/derivedCredentials" 6258 return bb 6259 } 6260 6261 // DeviceManagementDerivedCredentialsCollectionRequestBuilder is request builder for DeviceManagementDerivedCredentialSettings collection 6262 type DeviceManagementDerivedCredentialsCollectionRequestBuilder struct{ BaseRequestBuilder } 6263 6264 // Request returns request for DeviceManagementDerivedCredentialSettings collection 6265 func (b *DeviceManagementDerivedCredentialsCollectionRequestBuilder) Request() *DeviceManagementDerivedCredentialsCollectionRequest { 6266 return &DeviceManagementDerivedCredentialsCollectionRequest{ 6267 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 6268 } 6269 } 6270 6271 // ID returns request builder for DeviceManagementDerivedCredentialSettings item 6272 func (b *DeviceManagementDerivedCredentialsCollectionRequestBuilder) ID(id string) *DeviceManagementDerivedCredentialSettingsRequestBuilder { 6273 bb := &DeviceManagementDerivedCredentialSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6274 bb.baseURL += "/" + id 6275 return bb 6276 } 6277 6278 // DeviceManagementDerivedCredentialsCollectionRequest is request for DeviceManagementDerivedCredentialSettings collection 6279 type DeviceManagementDerivedCredentialsCollectionRequest struct{ BaseRequest } 6280 6281 // Paging perfoms paging operation for DeviceManagementDerivedCredentialSettings collection 6282 func (r *DeviceManagementDerivedCredentialsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementDerivedCredentialSettings, error) { 6283 req, err := r.NewJSONRequest(method, path, obj) 6284 if err != nil { 6285 return nil, err 6286 } 6287 if ctx != nil { 6288 req = req.WithContext(ctx) 6289 } 6290 res, err := r.client.Do(req) 6291 if err != nil { 6292 return nil, err 6293 } 6294 var values []DeviceManagementDerivedCredentialSettings 6295 for { 6296 if res.StatusCode != http.StatusOK { 6297 b, _ := ioutil.ReadAll(res.Body) 6298 res.Body.Close() 6299 errRes := &ErrorResponse{Response: res} 6300 err := jsonx.Unmarshal(b, errRes) 6301 if err != nil { 6302 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 6303 } 6304 return nil, errRes 6305 } 6306 var ( 6307 paging Paging 6308 value []DeviceManagementDerivedCredentialSettings 6309 ) 6310 err := jsonx.NewDecoder(res.Body).Decode(&paging) 6311 res.Body.Close() 6312 if err != nil { 6313 return nil, err 6314 } 6315 err = jsonx.Unmarshal(paging.Value, &value) 6316 if err != nil { 6317 return nil, err 6318 } 6319 values = append(values, value...) 6320 if n >= 0 { 6321 n-- 6322 } 6323 if n == 0 || len(paging.NextLink) == 0 { 6324 return values, nil 6325 } 6326 req, err = http.NewRequest("GET", paging.NextLink, nil) 6327 if ctx != nil { 6328 req = req.WithContext(ctx) 6329 } 6330 res, err = r.client.Do(req) 6331 if err != nil { 6332 return nil, err 6333 } 6334 } 6335 } 6336 6337 // GetN performs GET request for DeviceManagementDerivedCredentialSettings collection, max N pages 6338 func (r *DeviceManagementDerivedCredentialsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementDerivedCredentialSettings, error) { 6339 var query string 6340 if r.query != nil { 6341 query = "?" + r.query.Encode() 6342 } 6343 return r.Paging(ctx, "GET", query, nil, n) 6344 } 6345 6346 // Get performs GET request for DeviceManagementDerivedCredentialSettings collection 6347 func (r *DeviceManagementDerivedCredentialsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementDerivedCredentialSettings, error) { 6348 return r.GetN(ctx, 0) 6349 } 6350 6351 // Add performs POST request for DeviceManagementDerivedCredentialSettings collection 6352 func (r *DeviceManagementDerivedCredentialsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementDerivedCredentialSettings) (resObj *DeviceManagementDerivedCredentialSettings, err error) { 6353 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 6354 return 6355 } 6356 6357 // DetectedApps returns request builder for DetectedApp collection 6358 func (b *DeviceManagementRequestBuilder) DetectedApps() *DeviceManagementDetectedAppsCollectionRequestBuilder { 6359 bb := &DeviceManagementDetectedAppsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6360 bb.baseURL += "/detectedApps" 6361 return bb 6362 } 6363 6364 // DeviceManagementDetectedAppsCollectionRequestBuilder is request builder for DetectedApp collection 6365 type DeviceManagementDetectedAppsCollectionRequestBuilder struct{ BaseRequestBuilder } 6366 6367 // Request returns request for DetectedApp collection 6368 func (b *DeviceManagementDetectedAppsCollectionRequestBuilder) Request() *DeviceManagementDetectedAppsCollectionRequest { 6369 return &DeviceManagementDetectedAppsCollectionRequest{ 6370 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 6371 } 6372 } 6373 6374 // ID returns request builder for DetectedApp item 6375 func (b *DeviceManagementDetectedAppsCollectionRequestBuilder) ID(id string) *DetectedAppRequestBuilder { 6376 bb := &DetectedAppRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6377 bb.baseURL += "/" + id 6378 return bb 6379 } 6380 6381 // DeviceManagementDetectedAppsCollectionRequest is request for DetectedApp collection 6382 type DeviceManagementDetectedAppsCollectionRequest struct{ BaseRequest } 6383 6384 // Paging perfoms paging operation for DetectedApp collection 6385 func (r *DeviceManagementDetectedAppsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DetectedApp, error) { 6386 req, err := r.NewJSONRequest(method, path, obj) 6387 if err != nil { 6388 return nil, err 6389 } 6390 if ctx != nil { 6391 req = req.WithContext(ctx) 6392 } 6393 res, err := r.client.Do(req) 6394 if err != nil { 6395 return nil, err 6396 } 6397 var values []DetectedApp 6398 for { 6399 if res.StatusCode != http.StatusOK { 6400 b, _ := ioutil.ReadAll(res.Body) 6401 res.Body.Close() 6402 errRes := &ErrorResponse{Response: res} 6403 err := jsonx.Unmarshal(b, errRes) 6404 if err != nil { 6405 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 6406 } 6407 return nil, errRes 6408 } 6409 var ( 6410 paging Paging 6411 value []DetectedApp 6412 ) 6413 err := jsonx.NewDecoder(res.Body).Decode(&paging) 6414 res.Body.Close() 6415 if err != nil { 6416 return nil, err 6417 } 6418 err = jsonx.Unmarshal(paging.Value, &value) 6419 if err != nil { 6420 return nil, err 6421 } 6422 values = append(values, value...) 6423 if n >= 0 { 6424 n-- 6425 } 6426 if n == 0 || len(paging.NextLink) == 0 { 6427 return values, nil 6428 } 6429 req, err = http.NewRequest("GET", paging.NextLink, nil) 6430 if ctx != nil { 6431 req = req.WithContext(ctx) 6432 } 6433 res, err = r.client.Do(req) 6434 if err != nil { 6435 return nil, err 6436 } 6437 } 6438 } 6439 6440 // GetN performs GET request for DetectedApp collection, max N pages 6441 func (r *DeviceManagementDetectedAppsCollectionRequest) GetN(ctx context.Context, n int) ([]DetectedApp, error) { 6442 var query string 6443 if r.query != nil { 6444 query = "?" + r.query.Encode() 6445 } 6446 return r.Paging(ctx, "GET", query, nil, n) 6447 } 6448 6449 // Get performs GET request for DetectedApp collection 6450 func (r *DeviceManagementDetectedAppsCollectionRequest) Get(ctx context.Context) ([]DetectedApp, error) { 6451 return r.GetN(ctx, 0) 6452 } 6453 6454 // Add performs POST request for DetectedApp collection 6455 func (r *DeviceManagementDetectedAppsCollectionRequest) Add(ctx context.Context, reqObj *DetectedApp) (resObj *DetectedApp, err error) { 6456 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 6457 return 6458 } 6459 6460 // DeviceCategories returns request builder for DeviceCategory collection 6461 func (b *DeviceManagementRequestBuilder) DeviceCategories() *DeviceManagementDeviceCategoriesCollectionRequestBuilder { 6462 bb := &DeviceManagementDeviceCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6463 bb.baseURL += "/deviceCategories" 6464 return bb 6465 } 6466 6467 // DeviceManagementDeviceCategoriesCollectionRequestBuilder is request builder for DeviceCategory collection 6468 type DeviceManagementDeviceCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder } 6469 6470 // Request returns request for DeviceCategory collection 6471 func (b *DeviceManagementDeviceCategoriesCollectionRequestBuilder) Request() *DeviceManagementDeviceCategoriesCollectionRequest { 6472 return &DeviceManagementDeviceCategoriesCollectionRequest{ 6473 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 6474 } 6475 } 6476 6477 // ID returns request builder for DeviceCategory item 6478 func (b *DeviceManagementDeviceCategoriesCollectionRequestBuilder) ID(id string) *DeviceCategoryRequestBuilder { 6479 bb := &DeviceCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6480 bb.baseURL += "/" + id 6481 return bb 6482 } 6483 6484 // DeviceManagementDeviceCategoriesCollectionRequest is request for DeviceCategory collection 6485 type DeviceManagementDeviceCategoriesCollectionRequest struct{ BaseRequest } 6486 6487 // Paging perfoms paging operation for DeviceCategory collection 6488 func (r *DeviceManagementDeviceCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceCategory, error) { 6489 req, err := r.NewJSONRequest(method, path, obj) 6490 if err != nil { 6491 return nil, err 6492 } 6493 if ctx != nil { 6494 req = req.WithContext(ctx) 6495 } 6496 res, err := r.client.Do(req) 6497 if err != nil { 6498 return nil, err 6499 } 6500 var values []DeviceCategory 6501 for { 6502 if res.StatusCode != http.StatusOK { 6503 b, _ := ioutil.ReadAll(res.Body) 6504 res.Body.Close() 6505 errRes := &ErrorResponse{Response: res} 6506 err := jsonx.Unmarshal(b, errRes) 6507 if err != nil { 6508 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 6509 } 6510 return nil, errRes 6511 } 6512 var ( 6513 paging Paging 6514 value []DeviceCategory 6515 ) 6516 err := jsonx.NewDecoder(res.Body).Decode(&paging) 6517 res.Body.Close() 6518 if err != nil { 6519 return nil, err 6520 } 6521 err = jsonx.Unmarshal(paging.Value, &value) 6522 if err != nil { 6523 return nil, err 6524 } 6525 values = append(values, value...) 6526 if n >= 0 { 6527 n-- 6528 } 6529 if n == 0 || len(paging.NextLink) == 0 { 6530 return values, nil 6531 } 6532 req, err = http.NewRequest("GET", paging.NextLink, nil) 6533 if ctx != nil { 6534 req = req.WithContext(ctx) 6535 } 6536 res, err = r.client.Do(req) 6537 if err != nil { 6538 return nil, err 6539 } 6540 } 6541 } 6542 6543 // GetN performs GET request for DeviceCategory collection, max N pages 6544 func (r *DeviceManagementDeviceCategoriesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceCategory, error) { 6545 var query string 6546 if r.query != nil { 6547 query = "?" + r.query.Encode() 6548 } 6549 return r.Paging(ctx, "GET", query, nil, n) 6550 } 6551 6552 // Get performs GET request for DeviceCategory collection 6553 func (r *DeviceManagementDeviceCategoriesCollectionRequest) Get(ctx context.Context) ([]DeviceCategory, error) { 6554 return r.GetN(ctx, 0) 6555 } 6556 6557 // Add performs POST request for DeviceCategory collection 6558 func (r *DeviceManagementDeviceCategoriesCollectionRequest) Add(ctx context.Context, reqObj *DeviceCategory) (resObj *DeviceCategory, err error) { 6559 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 6560 return 6561 } 6562 6563 // DeviceCompliancePolicies returns request builder for DeviceCompliancePolicy collection 6564 func (b *DeviceManagementRequestBuilder) DeviceCompliancePolicies() *DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder { 6565 bb := &DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6566 bb.baseURL += "/deviceCompliancePolicies" 6567 return bb 6568 } 6569 6570 // DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder is request builder for DeviceCompliancePolicy collection 6571 type DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder struct{ BaseRequestBuilder } 6572 6573 // Request returns request for DeviceCompliancePolicy collection 6574 func (b *DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder) Request() *DeviceManagementDeviceCompliancePoliciesCollectionRequest { 6575 return &DeviceManagementDeviceCompliancePoliciesCollectionRequest{ 6576 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 6577 } 6578 } 6579 6580 // ID returns request builder for DeviceCompliancePolicy item 6581 func (b *DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder) ID(id string) *DeviceCompliancePolicyRequestBuilder { 6582 bb := &DeviceCompliancePolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6583 bb.baseURL += "/" + id 6584 return bb 6585 } 6586 6587 // DeviceManagementDeviceCompliancePoliciesCollectionRequest is request for DeviceCompliancePolicy collection 6588 type DeviceManagementDeviceCompliancePoliciesCollectionRequest struct{ BaseRequest } 6589 6590 // Paging perfoms paging operation for DeviceCompliancePolicy collection 6591 func (r *DeviceManagementDeviceCompliancePoliciesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceCompliancePolicy, error) { 6592 req, err := r.NewJSONRequest(method, path, obj) 6593 if err != nil { 6594 return nil, err 6595 } 6596 if ctx != nil { 6597 req = req.WithContext(ctx) 6598 } 6599 res, err := r.client.Do(req) 6600 if err != nil { 6601 return nil, err 6602 } 6603 var values []DeviceCompliancePolicy 6604 for { 6605 if res.StatusCode != http.StatusOK { 6606 b, _ := ioutil.ReadAll(res.Body) 6607 res.Body.Close() 6608 errRes := &ErrorResponse{Response: res} 6609 err := jsonx.Unmarshal(b, errRes) 6610 if err != nil { 6611 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 6612 } 6613 return nil, errRes 6614 } 6615 var ( 6616 paging Paging 6617 value []DeviceCompliancePolicy 6618 ) 6619 err := jsonx.NewDecoder(res.Body).Decode(&paging) 6620 res.Body.Close() 6621 if err != nil { 6622 return nil, err 6623 } 6624 err = jsonx.Unmarshal(paging.Value, &value) 6625 if err != nil { 6626 return nil, err 6627 } 6628 values = append(values, value...) 6629 if n >= 0 { 6630 n-- 6631 } 6632 if n == 0 || len(paging.NextLink) == 0 { 6633 return values, nil 6634 } 6635 req, err = http.NewRequest("GET", paging.NextLink, nil) 6636 if ctx != nil { 6637 req = req.WithContext(ctx) 6638 } 6639 res, err = r.client.Do(req) 6640 if err != nil { 6641 return nil, err 6642 } 6643 } 6644 } 6645 6646 // GetN performs GET request for DeviceCompliancePolicy collection, max N pages 6647 func (r *DeviceManagementDeviceCompliancePoliciesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceCompliancePolicy, error) { 6648 var query string 6649 if r.query != nil { 6650 query = "?" + r.query.Encode() 6651 } 6652 return r.Paging(ctx, "GET", query, nil, n) 6653 } 6654 6655 // Get performs GET request for DeviceCompliancePolicy collection 6656 func (r *DeviceManagementDeviceCompliancePoliciesCollectionRequest) Get(ctx context.Context) ([]DeviceCompliancePolicy, error) { 6657 return r.GetN(ctx, 0) 6658 } 6659 6660 // Add performs POST request for DeviceCompliancePolicy collection 6661 func (r *DeviceManagementDeviceCompliancePoliciesCollectionRequest) Add(ctx context.Context, reqObj *DeviceCompliancePolicy) (resObj *DeviceCompliancePolicy, err error) { 6662 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 6663 return 6664 } 6665 6666 // DeviceCompliancePolicyDeviceStateSummary is navigation property 6667 func (b *DeviceManagementRequestBuilder) DeviceCompliancePolicyDeviceStateSummary() *DeviceCompliancePolicyDeviceStateSummaryRequestBuilder { 6668 bb := &DeviceCompliancePolicyDeviceStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6669 bb.baseURL += "/deviceCompliancePolicyDeviceStateSummary" 6670 return bb 6671 } 6672 6673 // DeviceCompliancePolicySettingStateSummaries returns request builder for DeviceCompliancePolicySettingStateSummary collection 6674 func (b *DeviceManagementRequestBuilder) DeviceCompliancePolicySettingStateSummaries() *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder { 6675 bb := &DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6676 bb.baseURL += "/deviceCompliancePolicySettingStateSummaries" 6677 return bb 6678 } 6679 6680 // DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder is request builder for DeviceCompliancePolicySettingStateSummary collection 6681 type DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder struct{ BaseRequestBuilder } 6682 6683 // Request returns request for DeviceCompliancePolicySettingStateSummary collection 6684 func (b *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder) Request() *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest { 6685 return &DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest{ 6686 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 6687 } 6688 } 6689 6690 // ID returns request builder for DeviceCompliancePolicySettingStateSummary item 6691 func (b *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder) ID(id string) *DeviceCompliancePolicySettingStateSummaryRequestBuilder { 6692 bb := &DeviceCompliancePolicySettingStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6693 bb.baseURL += "/" + id 6694 return bb 6695 } 6696 6697 // DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest is request for DeviceCompliancePolicySettingStateSummary collection 6698 type DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest struct{ BaseRequest } 6699 6700 // Paging perfoms paging operation for DeviceCompliancePolicySettingStateSummary collection 6701 func (r *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceCompliancePolicySettingStateSummary, error) { 6702 req, err := r.NewJSONRequest(method, path, obj) 6703 if err != nil { 6704 return nil, err 6705 } 6706 if ctx != nil { 6707 req = req.WithContext(ctx) 6708 } 6709 res, err := r.client.Do(req) 6710 if err != nil { 6711 return nil, err 6712 } 6713 var values []DeviceCompliancePolicySettingStateSummary 6714 for { 6715 if res.StatusCode != http.StatusOK { 6716 b, _ := ioutil.ReadAll(res.Body) 6717 res.Body.Close() 6718 errRes := &ErrorResponse{Response: res} 6719 err := jsonx.Unmarshal(b, errRes) 6720 if err != nil { 6721 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 6722 } 6723 return nil, errRes 6724 } 6725 var ( 6726 paging Paging 6727 value []DeviceCompliancePolicySettingStateSummary 6728 ) 6729 err := jsonx.NewDecoder(res.Body).Decode(&paging) 6730 res.Body.Close() 6731 if err != nil { 6732 return nil, err 6733 } 6734 err = jsonx.Unmarshal(paging.Value, &value) 6735 if err != nil { 6736 return nil, err 6737 } 6738 values = append(values, value...) 6739 if n >= 0 { 6740 n-- 6741 } 6742 if n == 0 || len(paging.NextLink) == 0 { 6743 return values, nil 6744 } 6745 req, err = http.NewRequest("GET", paging.NextLink, nil) 6746 if ctx != nil { 6747 req = req.WithContext(ctx) 6748 } 6749 res, err = r.client.Do(req) 6750 if err != nil { 6751 return nil, err 6752 } 6753 } 6754 } 6755 6756 // GetN performs GET request for DeviceCompliancePolicySettingStateSummary collection, max N pages 6757 func (r *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceCompliancePolicySettingStateSummary, error) { 6758 var query string 6759 if r.query != nil { 6760 query = "?" + r.query.Encode() 6761 } 6762 return r.Paging(ctx, "GET", query, nil, n) 6763 } 6764 6765 // Get performs GET request for DeviceCompliancePolicySettingStateSummary collection 6766 func (r *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest) Get(ctx context.Context) ([]DeviceCompliancePolicySettingStateSummary, error) { 6767 return r.GetN(ctx, 0) 6768 } 6769 6770 // Add performs POST request for DeviceCompliancePolicySettingStateSummary collection 6771 func (r *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest) Add(ctx context.Context, reqObj *DeviceCompliancePolicySettingStateSummary) (resObj *DeviceCompliancePolicySettingStateSummary, err error) { 6772 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 6773 return 6774 } 6775 6776 // DeviceConfigurationConflictSummary returns request builder for DeviceConfigurationConflictSummary collection 6777 func (b *DeviceManagementRequestBuilder) DeviceConfigurationConflictSummary() *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder { 6778 bb := &DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6779 bb.baseURL += "/deviceConfigurationConflictSummary" 6780 return bb 6781 } 6782 6783 // DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder is request builder for DeviceConfigurationConflictSummary collection 6784 type DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder struct{ BaseRequestBuilder } 6785 6786 // Request returns request for DeviceConfigurationConflictSummary collection 6787 func (b *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder) Request() *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest { 6788 return &DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest{ 6789 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 6790 } 6791 } 6792 6793 // ID returns request builder for DeviceConfigurationConflictSummary item 6794 func (b *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder) ID(id string) *DeviceConfigurationConflictSummaryRequestBuilder { 6795 bb := &DeviceConfigurationConflictSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6796 bb.baseURL += "/" + id 6797 return bb 6798 } 6799 6800 // DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest is request for DeviceConfigurationConflictSummary collection 6801 type DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest struct{ BaseRequest } 6802 6803 // Paging perfoms paging operation for DeviceConfigurationConflictSummary collection 6804 func (r *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceConfigurationConflictSummary, error) { 6805 req, err := r.NewJSONRequest(method, path, obj) 6806 if err != nil { 6807 return nil, err 6808 } 6809 if ctx != nil { 6810 req = req.WithContext(ctx) 6811 } 6812 res, err := r.client.Do(req) 6813 if err != nil { 6814 return nil, err 6815 } 6816 var values []DeviceConfigurationConflictSummary 6817 for { 6818 if res.StatusCode != http.StatusOK { 6819 b, _ := ioutil.ReadAll(res.Body) 6820 res.Body.Close() 6821 errRes := &ErrorResponse{Response: res} 6822 err := jsonx.Unmarshal(b, errRes) 6823 if err != nil { 6824 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 6825 } 6826 return nil, errRes 6827 } 6828 var ( 6829 paging Paging 6830 value []DeviceConfigurationConflictSummary 6831 ) 6832 err := jsonx.NewDecoder(res.Body).Decode(&paging) 6833 res.Body.Close() 6834 if err != nil { 6835 return nil, err 6836 } 6837 err = jsonx.Unmarshal(paging.Value, &value) 6838 if err != nil { 6839 return nil, err 6840 } 6841 values = append(values, value...) 6842 if n >= 0 { 6843 n-- 6844 } 6845 if n == 0 || len(paging.NextLink) == 0 { 6846 return values, nil 6847 } 6848 req, err = http.NewRequest("GET", paging.NextLink, nil) 6849 if ctx != nil { 6850 req = req.WithContext(ctx) 6851 } 6852 res, err = r.client.Do(req) 6853 if err != nil { 6854 return nil, err 6855 } 6856 } 6857 } 6858 6859 // GetN performs GET request for DeviceConfigurationConflictSummary collection, max N pages 6860 func (r *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceConfigurationConflictSummary, error) { 6861 var query string 6862 if r.query != nil { 6863 query = "?" + r.query.Encode() 6864 } 6865 return r.Paging(ctx, "GET", query, nil, n) 6866 } 6867 6868 // Get performs GET request for DeviceConfigurationConflictSummary collection 6869 func (r *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest) Get(ctx context.Context) ([]DeviceConfigurationConflictSummary, error) { 6870 return r.GetN(ctx, 0) 6871 } 6872 6873 // Add performs POST request for DeviceConfigurationConflictSummary collection 6874 func (r *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest) Add(ctx context.Context, reqObj *DeviceConfigurationConflictSummary) (resObj *DeviceConfigurationConflictSummary, err error) { 6875 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 6876 return 6877 } 6878 6879 // DeviceConfigurationDeviceStateSummaries is navigation property 6880 func (b *DeviceManagementRequestBuilder) DeviceConfigurationDeviceStateSummaries() *DeviceConfigurationDeviceStateSummaryRequestBuilder { 6881 bb := &DeviceConfigurationDeviceStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6882 bb.baseURL += "/deviceConfigurationDeviceStateSummaries" 6883 return bb 6884 } 6885 6886 // DeviceConfigurationRestrictedAppsViolations returns request builder for RestrictedAppsViolation collection 6887 func (b *DeviceManagementRequestBuilder) DeviceConfigurationRestrictedAppsViolations() *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder { 6888 bb := &DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6889 bb.baseURL += "/deviceConfigurationRestrictedAppsViolations" 6890 return bb 6891 } 6892 6893 // DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder is request builder for RestrictedAppsViolation collection 6894 type DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder struct{ BaseRequestBuilder } 6895 6896 // Request returns request for RestrictedAppsViolation collection 6897 func (b *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder) Request() *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest { 6898 return &DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest{ 6899 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 6900 } 6901 } 6902 6903 // ID returns request builder for RestrictedAppsViolation item 6904 func (b *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder) ID(id string) *RestrictedAppsViolationRequestBuilder { 6905 bb := &RestrictedAppsViolationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6906 bb.baseURL += "/" + id 6907 return bb 6908 } 6909 6910 // DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest is request for RestrictedAppsViolation collection 6911 type DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest struct{ BaseRequest } 6912 6913 // Paging perfoms paging operation for RestrictedAppsViolation collection 6914 func (r *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]RestrictedAppsViolation, error) { 6915 req, err := r.NewJSONRequest(method, path, obj) 6916 if err != nil { 6917 return nil, err 6918 } 6919 if ctx != nil { 6920 req = req.WithContext(ctx) 6921 } 6922 res, err := r.client.Do(req) 6923 if err != nil { 6924 return nil, err 6925 } 6926 var values []RestrictedAppsViolation 6927 for { 6928 if res.StatusCode != http.StatusOK { 6929 b, _ := ioutil.ReadAll(res.Body) 6930 res.Body.Close() 6931 errRes := &ErrorResponse{Response: res} 6932 err := jsonx.Unmarshal(b, errRes) 6933 if err != nil { 6934 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 6935 } 6936 return nil, errRes 6937 } 6938 var ( 6939 paging Paging 6940 value []RestrictedAppsViolation 6941 ) 6942 err := jsonx.NewDecoder(res.Body).Decode(&paging) 6943 res.Body.Close() 6944 if err != nil { 6945 return nil, err 6946 } 6947 err = jsonx.Unmarshal(paging.Value, &value) 6948 if err != nil { 6949 return nil, err 6950 } 6951 values = append(values, value...) 6952 if n >= 0 { 6953 n-- 6954 } 6955 if n == 0 || len(paging.NextLink) == 0 { 6956 return values, nil 6957 } 6958 req, err = http.NewRequest("GET", paging.NextLink, nil) 6959 if ctx != nil { 6960 req = req.WithContext(ctx) 6961 } 6962 res, err = r.client.Do(req) 6963 if err != nil { 6964 return nil, err 6965 } 6966 } 6967 } 6968 6969 // GetN performs GET request for RestrictedAppsViolation collection, max N pages 6970 func (r *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest) GetN(ctx context.Context, n int) ([]RestrictedAppsViolation, error) { 6971 var query string 6972 if r.query != nil { 6973 query = "?" + r.query.Encode() 6974 } 6975 return r.Paging(ctx, "GET", query, nil, n) 6976 } 6977 6978 // Get performs GET request for RestrictedAppsViolation collection 6979 func (r *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest) Get(ctx context.Context) ([]RestrictedAppsViolation, error) { 6980 return r.GetN(ctx, 0) 6981 } 6982 6983 // Add performs POST request for RestrictedAppsViolation collection 6984 func (r *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest) Add(ctx context.Context, reqObj *RestrictedAppsViolation) (resObj *RestrictedAppsViolation, err error) { 6985 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 6986 return 6987 } 6988 6989 // DeviceConfigurationUserStateSummaries is navigation property 6990 func (b *DeviceManagementRequestBuilder) DeviceConfigurationUserStateSummaries() *DeviceConfigurationUserStateSummaryRequestBuilder { 6991 bb := &DeviceConfigurationUserStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6992 bb.baseURL += "/deviceConfigurationUserStateSummaries" 6993 return bb 6994 } 6995 6996 // DeviceConfigurations returns request builder for DeviceConfiguration collection 6997 func (b *DeviceManagementRequestBuilder) DeviceConfigurations() *DeviceManagementDeviceConfigurationsCollectionRequestBuilder { 6998 bb := &DeviceManagementDeviceConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 6999 bb.baseURL += "/deviceConfigurations" 7000 return bb 7001 } 7002 7003 // DeviceManagementDeviceConfigurationsCollectionRequestBuilder is request builder for DeviceConfiguration collection 7004 type DeviceManagementDeviceConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } 7005 7006 // Request returns request for DeviceConfiguration collection 7007 func (b *DeviceManagementDeviceConfigurationsCollectionRequestBuilder) Request() *DeviceManagementDeviceConfigurationsCollectionRequest { 7008 return &DeviceManagementDeviceConfigurationsCollectionRequest{ 7009 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 7010 } 7011 } 7012 7013 // ID returns request builder for DeviceConfiguration item 7014 func (b *DeviceManagementDeviceConfigurationsCollectionRequestBuilder) ID(id string) *DeviceConfigurationRequestBuilder { 7015 bb := &DeviceConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7016 bb.baseURL += "/" + id 7017 return bb 7018 } 7019 7020 // DeviceManagementDeviceConfigurationsCollectionRequest is request for DeviceConfiguration collection 7021 type DeviceManagementDeviceConfigurationsCollectionRequest struct{ BaseRequest } 7022 7023 // Paging perfoms paging operation for DeviceConfiguration collection 7024 func (r *DeviceManagementDeviceConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceConfiguration, error) { 7025 req, err := r.NewJSONRequest(method, path, obj) 7026 if err != nil { 7027 return nil, err 7028 } 7029 if ctx != nil { 7030 req = req.WithContext(ctx) 7031 } 7032 res, err := r.client.Do(req) 7033 if err != nil { 7034 return nil, err 7035 } 7036 var values []DeviceConfiguration 7037 for { 7038 if res.StatusCode != http.StatusOK { 7039 b, _ := ioutil.ReadAll(res.Body) 7040 res.Body.Close() 7041 errRes := &ErrorResponse{Response: res} 7042 err := jsonx.Unmarshal(b, errRes) 7043 if err != nil { 7044 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 7045 } 7046 return nil, errRes 7047 } 7048 var ( 7049 paging Paging 7050 value []DeviceConfiguration 7051 ) 7052 err := jsonx.NewDecoder(res.Body).Decode(&paging) 7053 res.Body.Close() 7054 if err != nil { 7055 return nil, err 7056 } 7057 err = jsonx.Unmarshal(paging.Value, &value) 7058 if err != nil { 7059 return nil, err 7060 } 7061 values = append(values, value...) 7062 if n >= 0 { 7063 n-- 7064 } 7065 if n == 0 || len(paging.NextLink) == 0 { 7066 return values, nil 7067 } 7068 req, err = http.NewRequest("GET", paging.NextLink, nil) 7069 if ctx != nil { 7070 req = req.WithContext(ctx) 7071 } 7072 res, err = r.client.Do(req) 7073 if err != nil { 7074 return nil, err 7075 } 7076 } 7077 } 7078 7079 // GetN performs GET request for DeviceConfiguration collection, max N pages 7080 func (r *DeviceManagementDeviceConfigurationsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceConfiguration, error) { 7081 var query string 7082 if r.query != nil { 7083 query = "?" + r.query.Encode() 7084 } 7085 return r.Paging(ctx, "GET", query, nil, n) 7086 } 7087 7088 // Get performs GET request for DeviceConfiguration collection 7089 func (r *DeviceManagementDeviceConfigurationsCollectionRequest) Get(ctx context.Context) ([]DeviceConfiguration, error) { 7090 return r.GetN(ctx, 0) 7091 } 7092 7093 // Add performs POST request for DeviceConfiguration collection 7094 func (r *DeviceManagementDeviceConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *DeviceConfiguration) (resObj *DeviceConfiguration, err error) { 7095 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 7096 return 7097 } 7098 7099 // DeviceConfigurationsAllManagedDeviceCertificateStates returns request builder for ManagedAllDeviceCertificateState collection 7100 func (b *DeviceManagementRequestBuilder) DeviceConfigurationsAllManagedDeviceCertificateStates() *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder { 7101 bb := &DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7102 bb.baseURL += "/deviceConfigurationsAllManagedDeviceCertificateStates" 7103 return bb 7104 } 7105 7106 // DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder is request builder for ManagedAllDeviceCertificateState collection 7107 type DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder struct{ BaseRequestBuilder } 7108 7109 // Request returns request for ManagedAllDeviceCertificateState collection 7110 func (b *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder) Request() *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest { 7111 return &DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest{ 7112 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 7113 } 7114 } 7115 7116 // ID returns request builder for ManagedAllDeviceCertificateState item 7117 func (b *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder) ID(id string) *ManagedAllDeviceCertificateStateRequestBuilder { 7118 bb := &ManagedAllDeviceCertificateStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7119 bb.baseURL += "/" + id 7120 return bb 7121 } 7122 7123 // DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest is request for ManagedAllDeviceCertificateState collection 7124 type DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest struct{ BaseRequest } 7125 7126 // Paging perfoms paging operation for ManagedAllDeviceCertificateState collection 7127 func (r *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedAllDeviceCertificateState, error) { 7128 req, err := r.NewJSONRequest(method, path, obj) 7129 if err != nil { 7130 return nil, err 7131 } 7132 if ctx != nil { 7133 req = req.WithContext(ctx) 7134 } 7135 res, err := r.client.Do(req) 7136 if err != nil { 7137 return nil, err 7138 } 7139 var values []ManagedAllDeviceCertificateState 7140 for { 7141 if res.StatusCode != http.StatusOK { 7142 b, _ := ioutil.ReadAll(res.Body) 7143 res.Body.Close() 7144 errRes := &ErrorResponse{Response: res} 7145 err := jsonx.Unmarshal(b, errRes) 7146 if err != nil { 7147 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 7148 } 7149 return nil, errRes 7150 } 7151 var ( 7152 paging Paging 7153 value []ManagedAllDeviceCertificateState 7154 ) 7155 err := jsonx.NewDecoder(res.Body).Decode(&paging) 7156 res.Body.Close() 7157 if err != nil { 7158 return nil, err 7159 } 7160 err = jsonx.Unmarshal(paging.Value, &value) 7161 if err != nil { 7162 return nil, err 7163 } 7164 values = append(values, value...) 7165 if n >= 0 { 7166 n-- 7167 } 7168 if n == 0 || len(paging.NextLink) == 0 { 7169 return values, nil 7170 } 7171 req, err = http.NewRequest("GET", paging.NextLink, nil) 7172 if ctx != nil { 7173 req = req.WithContext(ctx) 7174 } 7175 res, err = r.client.Do(req) 7176 if err != nil { 7177 return nil, err 7178 } 7179 } 7180 } 7181 7182 // GetN performs GET request for ManagedAllDeviceCertificateState collection, max N pages 7183 func (r *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedAllDeviceCertificateState, error) { 7184 var query string 7185 if r.query != nil { 7186 query = "?" + r.query.Encode() 7187 } 7188 return r.Paging(ctx, "GET", query, nil, n) 7189 } 7190 7191 // Get performs GET request for ManagedAllDeviceCertificateState collection 7192 func (r *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest) Get(ctx context.Context) ([]ManagedAllDeviceCertificateState, error) { 7193 return r.GetN(ctx, 0) 7194 } 7195 7196 // Add performs POST request for ManagedAllDeviceCertificateState collection 7197 func (r *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest) Add(ctx context.Context, reqObj *ManagedAllDeviceCertificateState) (resObj *ManagedAllDeviceCertificateState, err error) { 7198 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 7199 return 7200 } 7201 7202 // DeviceEnrollmentConfigurations returns request builder for DeviceEnrollmentConfiguration collection 7203 func (b *DeviceManagementRequestBuilder) DeviceEnrollmentConfigurations() *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder { 7204 bb := &DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7205 bb.baseURL += "/deviceEnrollmentConfigurations" 7206 return bb 7207 } 7208 7209 // DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder is request builder for DeviceEnrollmentConfiguration collection 7210 type DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } 7211 7212 // Request returns request for DeviceEnrollmentConfiguration collection 7213 func (b *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder) Request() *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest { 7214 return &DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest{ 7215 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 7216 } 7217 } 7218 7219 // ID returns request builder for DeviceEnrollmentConfiguration item 7220 func (b *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder) ID(id string) *DeviceEnrollmentConfigurationRequestBuilder { 7221 bb := &DeviceEnrollmentConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7222 bb.baseURL += "/" + id 7223 return bb 7224 } 7225 7226 // DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest is request for DeviceEnrollmentConfiguration collection 7227 type DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest struct{ BaseRequest } 7228 7229 // Paging perfoms paging operation for DeviceEnrollmentConfiguration collection 7230 func (r *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceEnrollmentConfiguration, error) { 7231 req, err := r.NewJSONRequest(method, path, obj) 7232 if err != nil { 7233 return nil, err 7234 } 7235 if ctx != nil { 7236 req = req.WithContext(ctx) 7237 } 7238 res, err := r.client.Do(req) 7239 if err != nil { 7240 return nil, err 7241 } 7242 var values []DeviceEnrollmentConfiguration 7243 for { 7244 if res.StatusCode != http.StatusOK { 7245 b, _ := ioutil.ReadAll(res.Body) 7246 res.Body.Close() 7247 errRes := &ErrorResponse{Response: res} 7248 err := jsonx.Unmarshal(b, errRes) 7249 if err != nil { 7250 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 7251 } 7252 return nil, errRes 7253 } 7254 var ( 7255 paging Paging 7256 value []DeviceEnrollmentConfiguration 7257 ) 7258 err := jsonx.NewDecoder(res.Body).Decode(&paging) 7259 res.Body.Close() 7260 if err != nil { 7261 return nil, err 7262 } 7263 err = jsonx.Unmarshal(paging.Value, &value) 7264 if err != nil { 7265 return nil, err 7266 } 7267 values = append(values, value...) 7268 if n >= 0 { 7269 n-- 7270 } 7271 if n == 0 || len(paging.NextLink) == 0 { 7272 return values, nil 7273 } 7274 req, err = http.NewRequest("GET", paging.NextLink, nil) 7275 if ctx != nil { 7276 req = req.WithContext(ctx) 7277 } 7278 res, err = r.client.Do(req) 7279 if err != nil { 7280 return nil, err 7281 } 7282 } 7283 } 7284 7285 // GetN performs GET request for DeviceEnrollmentConfiguration collection, max N pages 7286 func (r *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceEnrollmentConfiguration, error) { 7287 var query string 7288 if r.query != nil { 7289 query = "?" + r.query.Encode() 7290 } 7291 return r.Paging(ctx, "GET", query, nil, n) 7292 } 7293 7294 // Get performs GET request for DeviceEnrollmentConfiguration collection 7295 func (r *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest) Get(ctx context.Context) ([]DeviceEnrollmentConfiguration, error) { 7296 return r.GetN(ctx, 0) 7297 } 7298 7299 // Add performs POST request for DeviceEnrollmentConfiguration collection 7300 func (r *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *DeviceEnrollmentConfiguration) (resObj *DeviceEnrollmentConfiguration, err error) { 7301 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 7302 return 7303 } 7304 7305 // DeviceHealthScripts returns request builder for DeviceHealthScript collection 7306 func (b *DeviceManagementRequestBuilder) DeviceHealthScripts() *DeviceManagementDeviceHealthScriptsCollectionRequestBuilder { 7307 bb := &DeviceManagementDeviceHealthScriptsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7308 bb.baseURL += "/deviceHealthScripts" 7309 return bb 7310 } 7311 7312 // DeviceManagementDeviceHealthScriptsCollectionRequestBuilder is request builder for DeviceHealthScript collection 7313 type DeviceManagementDeviceHealthScriptsCollectionRequestBuilder struct{ BaseRequestBuilder } 7314 7315 // Request returns request for DeviceHealthScript collection 7316 func (b *DeviceManagementDeviceHealthScriptsCollectionRequestBuilder) Request() *DeviceManagementDeviceHealthScriptsCollectionRequest { 7317 return &DeviceManagementDeviceHealthScriptsCollectionRequest{ 7318 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 7319 } 7320 } 7321 7322 // ID returns request builder for DeviceHealthScript item 7323 func (b *DeviceManagementDeviceHealthScriptsCollectionRequestBuilder) ID(id string) *DeviceHealthScriptRequestBuilder { 7324 bb := &DeviceHealthScriptRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7325 bb.baseURL += "/" + id 7326 return bb 7327 } 7328 7329 // DeviceManagementDeviceHealthScriptsCollectionRequest is request for DeviceHealthScript collection 7330 type DeviceManagementDeviceHealthScriptsCollectionRequest struct{ BaseRequest } 7331 7332 // Paging perfoms paging operation for DeviceHealthScript collection 7333 func (r *DeviceManagementDeviceHealthScriptsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceHealthScript, error) { 7334 req, err := r.NewJSONRequest(method, path, obj) 7335 if err != nil { 7336 return nil, err 7337 } 7338 if ctx != nil { 7339 req = req.WithContext(ctx) 7340 } 7341 res, err := r.client.Do(req) 7342 if err != nil { 7343 return nil, err 7344 } 7345 var values []DeviceHealthScript 7346 for { 7347 if res.StatusCode != http.StatusOK { 7348 b, _ := ioutil.ReadAll(res.Body) 7349 res.Body.Close() 7350 errRes := &ErrorResponse{Response: res} 7351 err := jsonx.Unmarshal(b, errRes) 7352 if err != nil { 7353 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 7354 } 7355 return nil, errRes 7356 } 7357 var ( 7358 paging Paging 7359 value []DeviceHealthScript 7360 ) 7361 err := jsonx.NewDecoder(res.Body).Decode(&paging) 7362 res.Body.Close() 7363 if err != nil { 7364 return nil, err 7365 } 7366 err = jsonx.Unmarshal(paging.Value, &value) 7367 if err != nil { 7368 return nil, err 7369 } 7370 values = append(values, value...) 7371 if n >= 0 { 7372 n-- 7373 } 7374 if n == 0 || len(paging.NextLink) == 0 { 7375 return values, nil 7376 } 7377 req, err = http.NewRequest("GET", paging.NextLink, nil) 7378 if ctx != nil { 7379 req = req.WithContext(ctx) 7380 } 7381 res, err = r.client.Do(req) 7382 if err != nil { 7383 return nil, err 7384 } 7385 } 7386 } 7387 7388 // GetN performs GET request for DeviceHealthScript collection, max N pages 7389 func (r *DeviceManagementDeviceHealthScriptsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceHealthScript, error) { 7390 var query string 7391 if r.query != nil { 7392 query = "?" + r.query.Encode() 7393 } 7394 return r.Paging(ctx, "GET", query, nil, n) 7395 } 7396 7397 // Get performs GET request for DeviceHealthScript collection 7398 func (r *DeviceManagementDeviceHealthScriptsCollectionRequest) Get(ctx context.Context) ([]DeviceHealthScript, error) { 7399 return r.GetN(ctx, 0) 7400 } 7401 7402 // Add performs POST request for DeviceHealthScript collection 7403 func (r *DeviceManagementDeviceHealthScriptsCollectionRequest) Add(ctx context.Context, reqObj *DeviceHealthScript) (resObj *DeviceHealthScript, err error) { 7404 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 7405 return 7406 } 7407 7408 // DeviceManagementPartners returns request builder for DeviceManagementPartner collection 7409 func (b *DeviceManagementRequestBuilder) DeviceManagementPartners() *DeviceManagementDeviceManagementPartnersCollectionRequestBuilder { 7410 bb := &DeviceManagementDeviceManagementPartnersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7411 bb.baseURL += "/deviceManagementPartners" 7412 return bb 7413 } 7414 7415 // DeviceManagementDeviceManagementPartnersCollectionRequestBuilder is request builder for DeviceManagementPartner collection 7416 type DeviceManagementDeviceManagementPartnersCollectionRequestBuilder struct{ BaseRequestBuilder } 7417 7418 // Request returns request for DeviceManagementPartner collection 7419 func (b *DeviceManagementDeviceManagementPartnersCollectionRequestBuilder) Request() *DeviceManagementDeviceManagementPartnersCollectionRequest { 7420 return &DeviceManagementDeviceManagementPartnersCollectionRequest{ 7421 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 7422 } 7423 } 7424 7425 // ID returns request builder for DeviceManagementPartner item 7426 func (b *DeviceManagementDeviceManagementPartnersCollectionRequestBuilder) ID(id string) *DeviceManagementPartnerRequestBuilder { 7427 bb := &DeviceManagementPartnerRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7428 bb.baseURL += "/" + id 7429 return bb 7430 } 7431 7432 // DeviceManagementDeviceManagementPartnersCollectionRequest is request for DeviceManagementPartner collection 7433 type DeviceManagementDeviceManagementPartnersCollectionRequest struct{ BaseRequest } 7434 7435 // Paging perfoms paging operation for DeviceManagementPartner collection 7436 func (r *DeviceManagementDeviceManagementPartnersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementPartner, error) { 7437 req, err := r.NewJSONRequest(method, path, obj) 7438 if err != nil { 7439 return nil, err 7440 } 7441 if ctx != nil { 7442 req = req.WithContext(ctx) 7443 } 7444 res, err := r.client.Do(req) 7445 if err != nil { 7446 return nil, err 7447 } 7448 var values []DeviceManagementPartner 7449 for { 7450 if res.StatusCode != http.StatusOK { 7451 b, _ := ioutil.ReadAll(res.Body) 7452 res.Body.Close() 7453 errRes := &ErrorResponse{Response: res} 7454 err := jsonx.Unmarshal(b, errRes) 7455 if err != nil { 7456 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 7457 } 7458 return nil, errRes 7459 } 7460 var ( 7461 paging Paging 7462 value []DeviceManagementPartner 7463 ) 7464 err := jsonx.NewDecoder(res.Body).Decode(&paging) 7465 res.Body.Close() 7466 if err != nil { 7467 return nil, err 7468 } 7469 err = jsonx.Unmarshal(paging.Value, &value) 7470 if err != nil { 7471 return nil, err 7472 } 7473 values = append(values, value...) 7474 if n >= 0 { 7475 n-- 7476 } 7477 if n == 0 || len(paging.NextLink) == 0 { 7478 return values, nil 7479 } 7480 req, err = http.NewRequest("GET", paging.NextLink, nil) 7481 if ctx != nil { 7482 req = req.WithContext(ctx) 7483 } 7484 res, err = r.client.Do(req) 7485 if err != nil { 7486 return nil, err 7487 } 7488 } 7489 } 7490 7491 // GetN performs GET request for DeviceManagementPartner collection, max N pages 7492 func (r *DeviceManagementDeviceManagementPartnersCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementPartner, error) { 7493 var query string 7494 if r.query != nil { 7495 query = "?" + r.query.Encode() 7496 } 7497 return r.Paging(ctx, "GET", query, nil, n) 7498 } 7499 7500 // Get performs GET request for DeviceManagementPartner collection 7501 func (r *DeviceManagementDeviceManagementPartnersCollectionRequest) Get(ctx context.Context) ([]DeviceManagementPartner, error) { 7502 return r.GetN(ctx, 0) 7503 } 7504 7505 // Add performs POST request for DeviceManagementPartner collection 7506 func (r *DeviceManagementDeviceManagementPartnersCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementPartner) (resObj *DeviceManagementPartner, err error) { 7507 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 7508 return 7509 } 7510 7511 // DeviceManagementScripts returns request builder for DeviceManagementScript collection 7512 func (b *DeviceManagementRequestBuilder) DeviceManagementScripts() *DeviceManagementDeviceManagementScriptsCollectionRequestBuilder { 7513 bb := &DeviceManagementDeviceManagementScriptsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7514 bb.baseURL += "/deviceManagementScripts" 7515 return bb 7516 } 7517 7518 // DeviceManagementDeviceManagementScriptsCollectionRequestBuilder is request builder for DeviceManagementScript collection 7519 type DeviceManagementDeviceManagementScriptsCollectionRequestBuilder struct{ BaseRequestBuilder } 7520 7521 // Request returns request for DeviceManagementScript collection 7522 func (b *DeviceManagementDeviceManagementScriptsCollectionRequestBuilder) Request() *DeviceManagementDeviceManagementScriptsCollectionRequest { 7523 return &DeviceManagementDeviceManagementScriptsCollectionRequest{ 7524 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 7525 } 7526 } 7527 7528 // ID returns request builder for DeviceManagementScript item 7529 func (b *DeviceManagementDeviceManagementScriptsCollectionRequestBuilder) ID(id string) *DeviceManagementScriptRequestBuilder { 7530 bb := &DeviceManagementScriptRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7531 bb.baseURL += "/" + id 7532 return bb 7533 } 7534 7535 // DeviceManagementDeviceManagementScriptsCollectionRequest is request for DeviceManagementScript collection 7536 type DeviceManagementDeviceManagementScriptsCollectionRequest struct{ BaseRequest } 7537 7538 // Paging perfoms paging operation for DeviceManagementScript collection 7539 func (r *DeviceManagementDeviceManagementScriptsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementScript, error) { 7540 req, err := r.NewJSONRequest(method, path, obj) 7541 if err != nil { 7542 return nil, err 7543 } 7544 if ctx != nil { 7545 req = req.WithContext(ctx) 7546 } 7547 res, err := r.client.Do(req) 7548 if err != nil { 7549 return nil, err 7550 } 7551 var values []DeviceManagementScript 7552 for { 7553 if res.StatusCode != http.StatusOK { 7554 b, _ := ioutil.ReadAll(res.Body) 7555 res.Body.Close() 7556 errRes := &ErrorResponse{Response: res} 7557 err := jsonx.Unmarshal(b, errRes) 7558 if err != nil { 7559 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 7560 } 7561 return nil, errRes 7562 } 7563 var ( 7564 paging Paging 7565 value []DeviceManagementScript 7566 ) 7567 err := jsonx.NewDecoder(res.Body).Decode(&paging) 7568 res.Body.Close() 7569 if err != nil { 7570 return nil, err 7571 } 7572 err = jsonx.Unmarshal(paging.Value, &value) 7573 if err != nil { 7574 return nil, err 7575 } 7576 values = append(values, value...) 7577 if n >= 0 { 7578 n-- 7579 } 7580 if n == 0 || len(paging.NextLink) == 0 { 7581 return values, nil 7582 } 7583 req, err = http.NewRequest("GET", paging.NextLink, nil) 7584 if ctx != nil { 7585 req = req.WithContext(ctx) 7586 } 7587 res, err = r.client.Do(req) 7588 if err != nil { 7589 return nil, err 7590 } 7591 } 7592 } 7593 7594 // GetN performs GET request for DeviceManagementScript collection, max N pages 7595 func (r *DeviceManagementDeviceManagementScriptsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementScript, error) { 7596 var query string 7597 if r.query != nil { 7598 query = "?" + r.query.Encode() 7599 } 7600 return r.Paging(ctx, "GET", query, nil, n) 7601 } 7602 7603 // Get performs GET request for DeviceManagementScript collection 7604 func (r *DeviceManagementDeviceManagementScriptsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementScript, error) { 7605 return r.GetN(ctx, 0) 7606 } 7607 7608 // Add performs POST request for DeviceManagementScript collection 7609 func (r *DeviceManagementDeviceManagementScriptsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementScript) (resObj *DeviceManagementScript, err error) { 7610 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 7611 return 7612 } 7613 7614 // DomainJoinConnectors returns request builder for DeviceManagementDomainJoinConnector collection 7615 func (b *DeviceManagementRequestBuilder) DomainJoinConnectors() *DeviceManagementDomainJoinConnectorsCollectionRequestBuilder { 7616 bb := &DeviceManagementDomainJoinConnectorsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7617 bb.baseURL += "/domainJoinConnectors" 7618 return bb 7619 } 7620 7621 // DeviceManagementDomainJoinConnectorsCollectionRequestBuilder is request builder for DeviceManagementDomainJoinConnector collection 7622 type DeviceManagementDomainJoinConnectorsCollectionRequestBuilder struct{ BaseRequestBuilder } 7623 7624 // Request returns request for DeviceManagementDomainJoinConnector collection 7625 func (b *DeviceManagementDomainJoinConnectorsCollectionRequestBuilder) Request() *DeviceManagementDomainJoinConnectorsCollectionRequest { 7626 return &DeviceManagementDomainJoinConnectorsCollectionRequest{ 7627 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 7628 } 7629 } 7630 7631 // ID returns request builder for DeviceManagementDomainJoinConnector item 7632 func (b *DeviceManagementDomainJoinConnectorsCollectionRequestBuilder) ID(id string) *DeviceManagementDomainJoinConnectorRequestBuilder { 7633 bb := &DeviceManagementDomainJoinConnectorRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7634 bb.baseURL += "/" + id 7635 return bb 7636 } 7637 7638 // DeviceManagementDomainJoinConnectorsCollectionRequest is request for DeviceManagementDomainJoinConnector collection 7639 type DeviceManagementDomainJoinConnectorsCollectionRequest struct{ BaseRequest } 7640 7641 // Paging perfoms paging operation for DeviceManagementDomainJoinConnector collection 7642 func (r *DeviceManagementDomainJoinConnectorsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementDomainJoinConnector, error) { 7643 req, err := r.NewJSONRequest(method, path, obj) 7644 if err != nil { 7645 return nil, err 7646 } 7647 if ctx != nil { 7648 req = req.WithContext(ctx) 7649 } 7650 res, err := r.client.Do(req) 7651 if err != nil { 7652 return nil, err 7653 } 7654 var values []DeviceManagementDomainJoinConnector 7655 for { 7656 if res.StatusCode != http.StatusOK { 7657 b, _ := ioutil.ReadAll(res.Body) 7658 res.Body.Close() 7659 errRes := &ErrorResponse{Response: res} 7660 err := jsonx.Unmarshal(b, errRes) 7661 if err != nil { 7662 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 7663 } 7664 return nil, errRes 7665 } 7666 var ( 7667 paging Paging 7668 value []DeviceManagementDomainJoinConnector 7669 ) 7670 err := jsonx.NewDecoder(res.Body).Decode(&paging) 7671 res.Body.Close() 7672 if err != nil { 7673 return nil, err 7674 } 7675 err = jsonx.Unmarshal(paging.Value, &value) 7676 if err != nil { 7677 return nil, err 7678 } 7679 values = append(values, value...) 7680 if n >= 0 { 7681 n-- 7682 } 7683 if n == 0 || len(paging.NextLink) == 0 { 7684 return values, nil 7685 } 7686 req, err = http.NewRequest("GET", paging.NextLink, nil) 7687 if ctx != nil { 7688 req = req.WithContext(ctx) 7689 } 7690 res, err = r.client.Do(req) 7691 if err != nil { 7692 return nil, err 7693 } 7694 } 7695 } 7696 7697 // GetN performs GET request for DeviceManagementDomainJoinConnector collection, max N pages 7698 func (r *DeviceManagementDomainJoinConnectorsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementDomainJoinConnector, error) { 7699 var query string 7700 if r.query != nil { 7701 query = "?" + r.query.Encode() 7702 } 7703 return r.Paging(ctx, "GET", query, nil, n) 7704 } 7705 7706 // Get performs GET request for DeviceManagementDomainJoinConnector collection 7707 func (r *DeviceManagementDomainJoinConnectorsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementDomainJoinConnector, error) { 7708 return r.GetN(ctx, 0) 7709 } 7710 7711 // Add performs POST request for DeviceManagementDomainJoinConnector collection 7712 func (r *DeviceManagementDomainJoinConnectorsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementDomainJoinConnector) (resObj *DeviceManagementDomainJoinConnector, err error) { 7713 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 7714 return 7715 } 7716 7717 // EmbeddedSIMActivationCodePools returns request builder for EmbeddedSIMActivationCodePool collection 7718 func (b *DeviceManagementRequestBuilder) EmbeddedSIMActivationCodePools() *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder { 7719 bb := &DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7720 bb.baseURL += "/embeddedSIMActivationCodePools" 7721 return bb 7722 } 7723 7724 // DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder is request builder for EmbeddedSIMActivationCodePool collection 7725 type DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder struct{ BaseRequestBuilder } 7726 7727 // Request returns request for EmbeddedSIMActivationCodePool collection 7728 func (b *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder) Request() *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest { 7729 return &DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest{ 7730 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 7731 } 7732 } 7733 7734 // ID returns request builder for EmbeddedSIMActivationCodePool item 7735 func (b *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder) ID(id string) *EmbeddedSIMActivationCodePoolRequestBuilder { 7736 bb := &EmbeddedSIMActivationCodePoolRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7737 bb.baseURL += "/" + id 7738 return bb 7739 } 7740 7741 // DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest is request for EmbeddedSIMActivationCodePool collection 7742 type DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest struct{ BaseRequest } 7743 7744 // Paging perfoms paging operation for EmbeddedSIMActivationCodePool collection 7745 func (r *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]EmbeddedSIMActivationCodePool, error) { 7746 req, err := r.NewJSONRequest(method, path, obj) 7747 if err != nil { 7748 return nil, err 7749 } 7750 if ctx != nil { 7751 req = req.WithContext(ctx) 7752 } 7753 res, err := r.client.Do(req) 7754 if err != nil { 7755 return nil, err 7756 } 7757 var values []EmbeddedSIMActivationCodePool 7758 for { 7759 if res.StatusCode != http.StatusOK { 7760 b, _ := ioutil.ReadAll(res.Body) 7761 res.Body.Close() 7762 errRes := &ErrorResponse{Response: res} 7763 err := jsonx.Unmarshal(b, errRes) 7764 if err != nil { 7765 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 7766 } 7767 return nil, errRes 7768 } 7769 var ( 7770 paging Paging 7771 value []EmbeddedSIMActivationCodePool 7772 ) 7773 err := jsonx.NewDecoder(res.Body).Decode(&paging) 7774 res.Body.Close() 7775 if err != nil { 7776 return nil, err 7777 } 7778 err = jsonx.Unmarshal(paging.Value, &value) 7779 if err != nil { 7780 return nil, err 7781 } 7782 values = append(values, value...) 7783 if n >= 0 { 7784 n-- 7785 } 7786 if n == 0 || len(paging.NextLink) == 0 { 7787 return values, nil 7788 } 7789 req, err = http.NewRequest("GET", paging.NextLink, nil) 7790 if ctx != nil { 7791 req = req.WithContext(ctx) 7792 } 7793 res, err = r.client.Do(req) 7794 if err != nil { 7795 return nil, err 7796 } 7797 } 7798 } 7799 7800 // GetN performs GET request for EmbeddedSIMActivationCodePool collection, max N pages 7801 func (r *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest) GetN(ctx context.Context, n int) ([]EmbeddedSIMActivationCodePool, error) { 7802 var query string 7803 if r.query != nil { 7804 query = "?" + r.query.Encode() 7805 } 7806 return r.Paging(ctx, "GET", query, nil, n) 7807 } 7808 7809 // Get performs GET request for EmbeddedSIMActivationCodePool collection 7810 func (r *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest) Get(ctx context.Context) ([]EmbeddedSIMActivationCodePool, error) { 7811 return r.GetN(ctx, 0) 7812 } 7813 7814 // Add performs POST request for EmbeddedSIMActivationCodePool collection 7815 func (r *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest) Add(ctx context.Context, reqObj *EmbeddedSIMActivationCodePool) (resObj *EmbeddedSIMActivationCodePool, err error) { 7816 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 7817 return 7818 } 7819 7820 // ExchangeConnectors returns request builder for DeviceManagementExchangeConnector collection 7821 func (b *DeviceManagementRequestBuilder) ExchangeConnectors() *DeviceManagementExchangeConnectorsCollectionRequestBuilder { 7822 bb := &DeviceManagementExchangeConnectorsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7823 bb.baseURL += "/exchangeConnectors" 7824 return bb 7825 } 7826 7827 // DeviceManagementExchangeConnectorsCollectionRequestBuilder is request builder for DeviceManagementExchangeConnector collection 7828 type DeviceManagementExchangeConnectorsCollectionRequestBuilder struct{ BaseRequestBuilder } 7829 7830 // Request returns request for DeviceManagementExchangeConnector collection 7831 func (b *DeviceManagementExchangeConnectorsCollectionRequestBuilder) Request() *DeviceManagementExchangeConnectorsCollectionRequest { 7832 return &DeviceManagementExchangeConnectorsCollectionRequest{ 7833 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 7834 } 7835 } 7836 7837 // ID returns request builder for DeviceManagementExchangeConnector item 7838 func (b *DeviceManagementExchangeConnectorsCollectionRequestBuilder) ID(id string) *DeviceManagementExchangeConnectorRequestBuilder { 7839 bb := &DeviceManagementExchangeConnectorRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7840 bb.baseURL += "/" + id 7841 return bb 7842 } 7843 7844 // DeviceManagementExchangeConnectorsCollectionRequest is request for DeviceManagementExchangeConnector collection 7845 type DeviceManagementExchangeConnectorsCollectionRequest struct{ BaseRequest } 7846 7847 // Paging perfoms paging operation for DeviceManagementExchangeConnector collection 7848 func (r *DeviceManagementExchangeConnectorsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementExchangeConnector, error) { 7849 req, err := r.NewJSONRequest(method, path, obj) 7850 if err != nil { 7851 return nil, err 7852 } 7853 if ctx != nil { 7854 req = req.WithContext(ctx) 7855 } 7856 res, err := r.client.Do(req) 7857 if err != nil { 7858 return nil, err 7859 } 7860 var values []DeviceManagementExchangeConnector 7861 for { 7862 if res.StatusCode != http.StatusOK { 7863 b, _ := ioutil.ReadAll(res.Body) 7864 res.Body.Close() 7865 errRes := &ErrorResponse{Response: res} 7866 err := jsonx.Unmarshal(b, errRes) 7867 if err != nil { 7868 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 7869 } 7870 return nil, errRes 7871 } 7872 var ( 7873 paging Paging 7874 value []DeviceManagementExchangeConnector 7875 ) 7876 err := jsonx.NewDecoder(res.Body).Decode(&paging) 7877 res.Body.Close() 7878 if err != nil { 7879 return nil, err 7880 } 7881 err = jsonx.Unmarshal(paging.Value, &value) 7882 if err != nil { 7883 return nil, err 7884 } 7885 values = append(values, value...) 7886 if n >= 0 { 7887 n-- 7888 } 7889 if n == 0 || len(paging.NextLink) == 0 { 7890 return values, nil 7891 } 7892 req, err = http.NewRequest("GET", paging.NextLink, nil) 7893 if ctx != nil { 7894 req = req.WithContext(ctx) 7895 } 7896 res, err = r.client.Do(req) 7897 if err != nil { 7898 return nil, err 7899 } 7900 } 7901 } 7902 7903 // GetN performs GET request for DeviceManagementExchangeConnector collection, max N pages 7904 func (r *DeviceManagementExchangeConnectorsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementExchangeConnector, error) { 7905 var query string 7906 if r.query != nil { 7907 query = "?" + r.query.Encode() 7908 } 7909 return r.Paging(ctx, "GET", query, nil, n) 7910 } 7911 7912 // Get performs GET request for DeviceManagementExchangeConnector collection 7913 func (r *DeviceManagementExchangeConnectorsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementExchangeConnector, error) { 7914 return r.GetN(ctx, 0) 7915 } 7916 7917 // Add performs POST request for DeviceManagementExchangeConnector collection 7918 func (r *DeviceManagementExchangeConnectorsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementExchangeConnector) (resObj *DeviceManagementExchangeConnector, err error) { 7919 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 7920 return 7921 } 7922 7923 // ExchangeOnPremisesPolicies returns request builder for DeviceManagementExchangeOnPremisesPolicy collection 7924 func (b *DeviceManagementRequestBuilder) ExchangeOnPremisesPolicies() *DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder { 7925 bb := &DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7926 bb.baseURL += "/exchangeOnPremisesPolicies" 7927 return bb 7928 } 7929 7930 // DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder is request builder for DeviceManagementExchangeOnPremisesPolicy collection 7931 type DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder struct{ BaseRequestBuilder } 7932 7933 // Request returns request for DeviceManagementExchangeOnPremisesPolicy collection 7934 func (b *DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder) Request() *DeviceManagementExchangeOnPremisesPoliciesCollectionRequest { 7935 return &DeviceManagementExchangeOnPremisesPoliciesCollectionRequest{ 7936 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 7937 } 7938 } 7939 7940 // ID returns request builder for DeviceManagementExchangeOnPremisesPolicy item 7941 func (b *DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder) ID(id string) *DeviceManagementExchangeOnPremisesPolicyRequestBuilder { 7942 bb := &DeviceManagementExchangeOnPremisesPolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 7943 bb.baseURL += "/" + id 7944 return bb 7945 } 7946 7947 // DeviceManagementExchangeOnPremisesPoliciesCollectionRequest is request for DeviceManagementExchangeOnPremisesPolicy collection 7948 type DeviceManagementExchangeOnPremisesPoliciesCollectionRequest struct{ BaseRequest } 7949 7950 // Paging perfoms paging operation for DeviceManagementExchangeOnPremisesPolicy collection 7951 func (r *DeviceManagementExchangeOnPremisesPoliciesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementExchangeOnPremisesPolicy, error) { 7952 req, err := r.NewJSONRequest(method, path, obj) 7953 if err != nil { 7954 return nil, err 7955 } 7956 if ctx != nil { 7957 req = req.WithContext(ctx) 7958 } 7959 res, err := r.client.Do(req) 7960 if err != nil { 7961 return nil, err 7962 } 7963 var values []DeviceManagementExchangeOnPremisesPolicy 7964 for { 7965 if res.StatusCode != http.StatusOK { 7966 b, _ := ioutil.ReadAll(res.Body) 7967 res.Body.Close() 7968 errRes := &ErrorResponse{Response: res} 7969 err := jsonx.Unmarshal(b, errRes) 7970 if err != nil { 7971 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 7972 } 7973 return nil, errRes 7974 } 7975 var ( 7976 paging Paging 7977 value []DeviceManagementExchangeOnPremisesPolicy 7978 ) 7979 err := jsonx.NewDecoder(res.Body).Decode(&paging) 7980 res.Body.Close() 7981 if err != nil { 7982 return nil, err 7983 } 7984 err = jsonx.Unmarshal(paging.Value, &value) 7985 if err != nil { 7986 return nil, err 7987 } 7988 values = append(values, value...) 7989 if n >= 0 { 7990 n-- 7991 } 7992 if n == 0 || len(paging.NextLink) == 0 { 7993 return values, nil 7994 } 7995 req, err = http.NewRequest("GET", paging.NextLink, nil) 7996 if ctx != nil { 7997 req = req.WithContext(ctx) 7998 } 7999 res, err = r.client.Do(req) 8000 if err != nil { 8001 return nil, err 8002 } 8003 } 8004 } 8005 8006 // GetN performs GET request for DeviceManagementExchangeOnPremisesPolicy collection, max N pages 8007 func (r *DeviceManagementExchangeOnPremisesPoliciesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementExchangeOnPremisesPolicy, error) { 8008 var query string 8009 if r.query != nil { 8010 query = "?" + r.query.Encode() 8011 } 8012 return r.Paging(ctx, "GET", query, nil, n) 8013 } 8014 8015 // Get performs GET request for DeviceManagementExchangeOnPremisesPolicy collection 8016 func (r *DeviceManagementExchangeOnPremisesPoliciesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementExchangeOnPremisesPolicy, error) { 8017 return r.GetN(ctx, 0) 8018 } 8019 8020 // Add performs POST request for DeviceManagementExchangeOnPremisesPolicy collection 8021 func (r *DeviceManagementExchangeOnPremisesPoliciesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementExchangeOnPremisesPolicy) (resObj *DeviceManagementExchangeOnPremisesPolicy, err error) { 8022 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 8023 return 8024 } 8025 8026 // ExchangeOnPremisesPolicy is navigation property 8027 func (b *DeviceManagementRequestBuilder) ExchangeOnPremisesPolicy() *DeviceManagementExchangeOnPremisesPolicyRequestBuilder { 8028 bb := &DeviceManagementExchangeOnPremisesPolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8029 bb.baseURL += "/exchangeOnPremisesPolicy" 8030 return bb 8031 } 8032 8033 // GroupPolicyConfigurations returns request builder for GroupPolicyConfiguration collection 8034 func (b *DeviceManagementRequestBuilder) GroupPolicyConfigurations() *DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder { 8035 bb := &DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8036 bb.baseURL += "/groupPolicyConfigurations" 8037 return bb 8038 } 8039 8040 // DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder is request builder for GroupPolicyConfiguration collection 8041 type DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } 8042 8043 // Request returns request for GroupPolicyConfiguration collection 8044 func (b *DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder) Request() *DeviceManagementGroupPolicyConfigurationsCollectionRequest { 8045 return &DeviceManagementGroupPolicyConfigurationsCollectionRequest{ 8046 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 8047 } 8048 } 8049 8050 // ID returns request builder for GroupPolicyConfiguration item 8051 func (b *DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder) ID(id string) *GroupPolicyConfigurationRequestBuilder { 8052 bb := &GroupPolicyConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8053 bb.baseURL += "/" + id 8054 return bb 8055 } 8056 8057 // DeviceManagementGroupPolicyConfigurationsCollectionRequest is request for GroupPolicyConfiguration collection 8058 type DeviceManagementGroupPolicyConfigurationsCollectionRequest struct{ BaseRequest } 8059 8060 // Paging perfoms paging operation for GroupPolicyConfiguration collection 8061 func (r *DeviceManagementGroupPolicyConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]GroupPolicyConfiguration, error) { 8062 req, err := r.NewJSONRequest(method, path, obj) 8063 if err != nil { 8064 return nil, err 8065 } 8066 if ctx != nil { 8067 req = req.WithContext(ctx) 8068 } 8069 res, err := r.client.Do(req) 8070 if err != nil { 8071 return nil, err 8072 } 8073 var values []GroupPolicyConfiguration 8074 for { 8075 if res.StatusCode != http.StatusOK { 8076 b, _ := ioutil.ReadAll(res.Body) 8077 res.Body.Close() 8078 errRes := &ErrorResponse{Response: res} 8079 err := jsonx.Unmarshal(b, errRes) 8080 if err != nil { 8081 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 8082 } 8083 return nil, errRes 8084 } 8085 var ( 8086 paging Paging 8087 value []GroupPolicyConfiguration 8088 ) 8089 err := jsonx.NewDecoder(res.Body).Decode(&paging) 8090 res.Body.Close() 8091 if err != nil { 8092 return nil, err 8093 } 8094 err = jsonx.Unmarshal(paging.Value, &value) 8095 if err != nil { 8096 return nil, err 8097 } 8098 values = append(values, value...) 8099 if n >= 0 { 8100 n-- 8101 } 8102 if n == 0 || len(paging.NextLink) == 0 { 8103 return values, nil 8104 } 8105 req, err = http.NewRequest("GET", paging.NextLink, nil) 8106 if ctx != nil { 8107 req = req.WithContext(ctx) 8108 } 8109 res, err = r.client.Do(req) 8110 if err != nil { 8111 return nil, err 8112 } 8113 } 8114 } 8115 8116 // GetN performs GET request for GroupPolicyConfiguration collection, max N pages 8117 func (r *DeviceManagementGroupPolicyConfigurationsCollectionRequest) GetN(ctx context.Context, n int) ([]GroupPolicyConfiguration, error) { 8118 var query string 8119 if r.query != nil { 8120 query = "?" + r.query.Encode() 8121 } 8122 return r.Paging(ctx, "GET", query, nil, n) 8123 } 8124 8125 // Get performs GET request for GroupPolicyConfiguration collection 8126 func (r *DeviceManagementGroupPolicyConfigurationsCollectionRequest) Get(ctx context.Context) ([]GroupPolicyConfiguration, error) { 8127 return r.GetN(ctx, 0) 8128 } 8129 8130 // Add performs POST request for GroupPolicyConfiguration collection 8131 func (r *DeviceManagementGroupPolicyConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *GroupPolicyConfiguration) (resObj *GroupPolicyConfiguration, err error) { 8132 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 8133 return 8134 } 8135 8136 // GroupPolicyDefinitionFiles returns request builder for GroupPolicyDefinitionFile collection 8137 func (b *DeviceManagementRequestBuilder) GroupPolicyDefinitionFiles() *DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder { 8138 bb := &DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8139 bb.baseURL += "/groupPolicyDefinitionFiles" 8140 return bb 8141 } 8142 8143 // DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder is request builder for GroupPolicyDefinitionFile collection 8144 type DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder struct{ BaseRequestBuilder } 8145 8146 // Request returns request for GroupPolicyDefinitionFile collection 8147 func (b *DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder) Request() *DeviceManagementGroupPolicyDefinitionFilesCollectionRequest { 8148 return &DeviceManagementGroupPolicyDefinitionFilesCollectionRequest{ 8149 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 8150 } 8151 } 8152 8153 // ID returns request builder for GroupPolicyDefinitionFile item 8154 func (b *DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder) ID(id string) *GroupPolicyDefinitionFileRequestBuilder { 8155 bb := &GroupPolicyDefinitionFileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8156 bb.baseURL += "/" + id 8157 return bb 8158 } 8159 8160 // DeviceManagementGroupPolicyDefinitionFilesCollectionRequest is request for GroupPolicyDefinitionFile collection 8161 type DeviceManagementGroupPolicyDefinitionFilesCollectionRequest struct{ BaseRequest } 8162 8163 // Paging perfoms paging operation for GroupPolicyDefinitionFile collection 8164 func (r *DeviceManagementGroupPolicyDefinitionFilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]GroupPolicyDefinitionFile, error) { 8165 req, err := r.NewJSONRequest(method, path, obj) 8166 if err != nil { 8167 return nil, err 8168 } 8169 if ctx != nil { 8170 req = req.WithContext(ctx) 8171 } 8172 res, err := r.client.Do(req) 8173 if err != nil { 8174 return nil, err 8175 } 8176 var values []GroupPolicyDefinitionFile 8177 for { 8178 if res.StatusCode != http.StatusOK { 8179 b, _ := ioutil.ReadAll(res.Body) 8180 res.Body.Close() 8181 errRes := &ErrorResponse{Response: res} 8182 err := jsonx.Unmarshal(b, errRes) 8183 if err != nil { 8184 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 8185 } 8186 return nil, errRes 8187 } 8188 var ( 8189 paging Paging 8190 value []GroupPolicyDefinitionFile 8191 ) 8192 err := jsonx.NewDecoder(res.Body).Decode(&paging) 8193 res.Body.Close() 8194 if err != nil { 8195 return nil, err 8196 } 8197 err = jsonx.Unmarshal(paging.Value, &value) 8198 if err != nil { 8199 return nil, err 8200 } 8201 values = append(values, value...) 8202 if n >= 0 { 8203 n-- 8204 } 8205 if n == 0 || len(paging.NextLink) == 0 { 8206 return values, nil 8207 } 8208 req, err = http.NewRequest("GET", paging.NextLink, nil) 8209 if ctx != nil { 8210 req = req.WithContext(ctx) 8211 } 8212 res, err = r.client.Do(req) 8213 if err != nil { 8214 return nil, err 8215 } 8216 } 8217 } 8218 8219 // GetN performs GET request for GroupPolicyDefinitionFile collection, max N pages 8220 func (r *DeviceManagementGroupPolicyDefinitionFilesCollectionRequest) GetN(ctx context.Context, n int) ([]GroupPolicyDefinitionFile, error) { 8221 var query string 8222 if r.query != nil { 8223 query = "?" + r.query.Encode() 8224 } 8225 return r.Paging(ctx, "GET", query, nil, n) 8226 } 8227 8228 // Get performs GET request for GroupPolicyDefinitionFile collection 8229 func (r *DeviceManagementGroupPolicyDefinitionFilesCollectionRequest) Get(ctx context.Context) ([]GroupPolicyDefinitionFile, error) { 8230 return r.GetN(ctx, 0) 8231 } 8232 8233 // Add performs POST request for GroupPolicyDefinitionFile collection 8234 func (r *DeviceManagementGroupPolicyDefinitionFilesCollectionRequest) Add(ctx context.Context, reqObj *GroupPolicyDefinitionFile) (resObj *GroupPolicyDefinitionFile, err error) { 8235 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 8236 return 8237 } 8238 8239 // GroupPolicyDefinitions returns request builder for GroupPolicyDefinition collection 8240 func (b *DeviceManagementRequestBuilder) GroupPolicyDefinitions() *DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder { 8241 bb := &DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8242 bb.baseURL += "/groupPolicyDefinitions" 8243 return bb 8244 } 8245 8246 // DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder is request builder for GroupPolicyDefinition collection 8247 type DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder struct{ BaseRequestBuilder } 8248 8249 // Request returns request for GroupPolicyDefinition collection 8250 func (b *DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder) Request() *DeviceManagementGroupPolicyDefinitionsCollectionRequest { 8251 return &DeviceManagementGroupPolicyDefinitionsCollectionRequest{ 8252 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 8253 } 8254 } 8255 8256 // ID returns request builder for GroupPolicyDefinition item 8257 func (b *DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder) ID(id string) *GroupPolicyDefinitionRequestBuilder { 8258 bb := &GroupPolicyDefinitionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8259 bb.baseURL += "/" + id 8260 return bb 8261 } 8262 8263 // DeviceManagementGroupPolicyDefinitionsCollectionRequest is request for GroupPolicyDefinition collection 8264 type DeviceManagementGroupPolicyDefinitionsCollectionRequest struct{ BaseRequest } 8265 8266 // Paging perfoms paging operation for GroupPolicyDefinition collection 8267 func (r *DeviceManagementGroupPolicyDefinitionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]GroupPolicyDefinition, error) { 8268 req, err := r.NewJSONRequest(method, path, obj) 8269 if err != nil { 8270 return nil, err 8271 } 8272 if ctx != nil { 8273 req = req.WithContext(ctx) 8274 } 8275 res, err := r.client.Do(req) 8276 if err != nil { 8277 return nil, err 8278 } 8279 var values []GroupPolicyDefinition 8280 for { 8281 if res.StatusCode != http.StatusOK { 8282 b, _ := ioutil.ReadAll(res.Body) 8283 res.Body.Close() 8284 errRes := &ErrorResponse{Response: res} 8285 err := jsonx.Unmarshal(b, errRes) 8286 if err != nil { 8287 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 8288 } 8289 return nil, errRes 8290 } 8291 var ( 8292 paging Paging 8293 value []GroupPolicyDefinition 8294 ) 8295 err := jsonx.NewDecoder(res.Body).Decode(&paging) 8296 res.Body.Close() 8297 if err != nil { 8298 return nil, err 8299 } 8300 err = jsonx.Unmarshal(paging.Value, &value) 8301 if err != nil { 8302 return nil, err 8303 } 8304 values = append(values, value...) 8305 if n >= 0 { 8306 n-- 8307 } 8308 if n == 0 || len(paging.NextLink) == 0 { 8309 return values, nil 8310 } 8311 req, err = http.NewRequest("GET", paging.NextLink, nil) 8312 if ctx != nil { 8313 req = req.WithContext(ctx) 8314 } 8315 res, err = r.client.Do(req) 8316 if err != nil { 8317 return nil, err 8318 } 8319 } 8320 } 8321 8322 // GetN performs GET request for GroupPolicyDefinition collection, max N pages 8323 func (r *DeviceManagementGroupPolicyDefinitionsCollectionRequest) GetN(ctx context.Context, n int) ([]GroupPolicyDefinition, error) { 8324 var query string 8325 if r.query != nil { 8326 query = "?" + r.query.Encode() 8327 } 8328 return r.Paging(ctx, "GET", query, nil, n) 8329 } 8330 8331 // Get performs GET request for GroupPolicyDefinition collection 8332 func (r *DeviceManagementGroupPolicyDefinitionsCollectionRequest) Get(ctx context.Context) ([]GroupPolicyDefinition, error) { 8333 return r.GetN(ctx, 0) 8334 } 8335 8336 // Add performs POST request for GroupPolicyDefinition collection 8337 func (r *DeviceManagementGroupPolicyDefinitionsCollectionRequest) Add(ctx context.Context, reqObj *GroupPolicyDefinition) (resObj *GroupPolicyDefinition, err error) { 8338 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 8339 return 8340 } 8341 8342 // GroupPolicyMigrationReports returns request builder for GroupPolicyMigrationReport collection 8343 func (b *DeviceManagementRequestBuilder) GroupPolicyMigrationReports() *DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder { 8344 bb := &DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8345 bb.baseURL += "/groupPolicyMigrationReports" 8346 return bb 8347 } 8348 8349 // DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder is request builder for GroupPolicyMigrationReport collection 8350 type DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder struct{ BaseRequestBuilder } 8351 8352 // Request returns request for GroupPolicyMigrationReport collection 8353 func (b *DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder) Request() *DeviceManagementGroupPolicyMigrationReportsCollectionRequest { 8354 return &DeviceManagementGroupPolicyMigrationReportsCollectionRequest{ 8355 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 8356 } 8357 } 8358 8359 // ID returns request builder for GroupPolicyMigrationReport item 8360 func (b *DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder) ID(id string) *GroupPolicyMigrationReportRequestBuilder { 8361 bb := &GroupPolicyMigrationReportRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8362 bb.baseURL += "/" + id 8363 return bb 8364 } 8365 8366 // DeviceManagementGroupPolicyMigrationReportsCollectionRequest is request for GroupPolicyMigrationReport collection 8367 type DeviceManagementGroupPolicyMigrationReportsCollectionRequest struct{ BaseRequest } 8368 8369 // Paging perfoms paging operation for GroupPolicyMigrationReport collection 8370 func (r *DeviceManagementGroupPolicyMigrationReportsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]GroupPolicyMigrationReport, error) { 8371 req, err := r.NewJSONRequest(method, path, obj) 8372 if err != nil { 8373 return nil, err 8374 } 8375 if ctx != nil { 8376 req = req.WithContext(ctx) 8377 } 8378 res, err := r.client.Do(req) 8379 if err != nil { 8380 return nil, err 8381 } 8382 var values []GroupPolicyMigrationReport 8383 for { 8384 if res.StatusCode != http.StatusOK { 8385 b, _ := ioutil.ReadAll(res.Body) 8386 res.Body.Close() 8387 errRes := &ErrorResponse{Response: res} 8388 err := jsonx.Unmarshal(b, errRes) 8389 if err != nil { 8390 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 8391 } 8392 return nil, errRes 8393 } 8394 var ( 8395 paging Paging 8396 value []GroupPolicyMigrationReport 8397 ) 8398 err := jsonx.NewDecoder(res.Body).Decode(&paging) 8399 res.Body.Close() 8400 if err != nil { 8401 return nil, err 8402 } 8403 err = jsonx.Unmarshal(paging.Value, &value) 8404 if err != nil { 8405 return nil, err 8406 } 8407 values = append(values, value...) 8408 if n >= 0 { 8409 n-- 8410 } 8411 if n == 0 || len(paging.NextLink) == 0 { 8412 return values, nil 8413 } 8414 req, err = http.NewRequest("GET", paging.NextLink, nil) 8415 if ctx != nil { 8416 req = req.WithContext(ctx) 8417 } 8418 res, err = r.client.Do(req) 8419 if err != nil { 8420 return nil, err 8421 } 8422 } 8423 } 8424 8425 // GetN performs GET request for GroupPolicyMigrationReport collection, max N pages 8426 func (r *DeviceManagementGroupPolicyMigrationReportsCollectionRequest) GetN(ctx context.Context, n int) ([]GroupPolicyMigrationReport, error) { 8427 var query string 8428 if r.query != nil { 8429 query = "?" + r.query.Encode() 8430 } 8431 return r.Paging(ctx, "GET", query, nil, n) 8432 } 8433 8434 // Get performs GET request for GroupPolicyMigrationReport collection 8435 func (r *DeviceManagementGroupPolicyMigrationReportsCollectionRequest) Get(ctx context.Context) ([]GroupPolicyMigrationReport, error) { 8436 return r.GetN(ctx, 0) 8437 } 8438 8439 // Add performs POST request for GroupPolicyMigrationReport collection 8440 func (r *DeviceManagementGroupPolicyMigrationReportsCollectionRequest) Add(ctx context.Context, reqObj *GroupPolicyMigrationReport) (resObj *GroupPolicyMigrationReport, err error) { 8441 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 8442 return 8443 } 8444 8445 // ImportedDeviceIdentities returns request builder for ImportedDeviceIdentity collection 8446 func (b *DeviceManagementRequestBuilder) ImportedDeviceIdentities() *DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder { 8447 bb := &DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8448 bb.baseURL += "/importedDeviceIdentities" 8449 return bb 8450 } 8451 8452 // DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder is request builder for ImportedDeviceIdentity collection 8453 type DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder struct{ BaseRequestBuilder } 8454 8455 // Request returns request for ImportedDeviceIdentity collection 8456 func (b *DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder) Request() *DeviceManagementImportedDeviceIdentitiesCollectionRequest { 8457 return &DeviceManagementImportedDeviceIdentitiesCollectionRequest{ 8458 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 8459 } 8460 } 8461 8462 // ID returns request builder for ImportedDeviceIdentity item 8463 func (b *DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder) ID(id string) *ImportedDeviceIdentityRequestBuilder { 8464 bb := &ImportedDeviceIdentityRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8465 bb.baseURL += "/" + id 8466 return bb 8467 } 8468 8469 // DeviceManagementImportedDeviceIdentitiesCollectionRequest is request for ImportedDeviceIdentity collection 8470 type DeviceManagementImportedDeviceIdentitiesCollectionRequest struct{ BaseRequest } 8471 8472 // Paging perfoms paging operation for ImportedDeviceIdentity collection 8473 func (r *DeviceManagementImportedDeviceIdentitiesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ImportedDeviceIdentity, error) { 8474 req, err := r.NewJSONRequest(method, path, obj) 8475 if err != nil { 8476 return nil, err 8477 } 8478 if ctx != nil { 8479 req = req.WithContext(ctx) 8480 } 8481 res, err := r.client.Do(req) 8482 if err != nil { 8483 return nil, err 8484 } 8485 var values []ImportedDeviceIdentity 8486 for { 8487 if res.StatusCode != http.StatusOK { 8488 b, _ := ioutil.ReadAll(res.Body) 8489 res.Body.Close() 8490 errRes := &ErrorResponse{Response: res} 8491 err := jsonx.Unmarshal(b, errRes) 8492 if err != nil { 8493 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 8494 } 8495 return nil, errRes 8496 } 8497 var ( 8498 paging Paging 8499 value []ImportedDeviceIdentity 8500 ) 8501 err := jsonx.NewDecoder(res.Body).Decode(&paging) 8502 res.Body.Close() 8503 if err != nil { 8504 return nil, err 8505 } 8506 err = jsonx.Unmarshal(paging.Value, &value) 8507 if err != nil { 8508 return nil, err 8509 } 8510 values = append(values, value...) 8511 if n >= 0 { 8512 n-- 8513 } 8514 if n == 0 || len(paging.NextLink) == 0 { 8515 return values, nil 8516 } 8517 req, err = http.NewRequest("GET", paging.NextLink, nil) 8518 if ctx != nil { 8519 req = req.WithContext(ctx) 8520 } 8521 res, err = r.client.Do(req) 8522 if err != nil { 8523 return nil, err 8524 } 8525 } 8526 } 8527 8528 // GetN performs GET request for ImportedDeviceIdentity collection, max N pages 8529 func (r *DeviceManagementImportedDeviceIdentitiesCollectionRequest) GetN(ctx context.Context, n int) ([]ImportedDeviceIdentity, error) { 8530 var query string 8531 if r.query != nil { 8532 query = "?" + r.query.Encode() 8533 } 8534 return r.Paging(ctx, "GET", query, nil, n) 8535 } 8536 8537 // Get performs GET request for ImportedDeviceIdentity collection 8538 func (r *DeviceManagementImportedDeviceIdentitiesCollectionRequest) Get(ctx context.Context) ([]ImportedDeviceIdentity, error) { 8539 return r.GetN(ctx, 0) 8540 } 8541 8542 // Add performs POST request for ImportedDeviceIdentity collection 8543 func (r *DeviceManagementImportedDeviceIdentitiesCollectionRequest) Add(ctx context.Context, reqObj *ImportedDeviceIdentity) (resObj *ImportedDeviceIdentity, err error) { 8544 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 8545 return 8546 } 8547 8548 // ImportedWindowsAutopilotDeviceIdentities returns request builder for ImportedWindowsAutopilotDeviceIdentity collection 8549 func (b *DeviceManagementRequestBuilder) ImportedWindowsAutopilotDeviceIdentities() *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder { 8550 bb := &DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8551 bb.baseURL += "/importedWindowsAutopilotDeviceIdentities" 8552 return bb 8553 } 8554 8555 // DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder is request builder for ImportedWindowsAutopilotDeviceIdentity collection 8556 type DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder struct{ BaseRequestBuilder } 8557 8558 // Request returns request for ImportedWindowsAutopilotDeviceIdentity collection 8559 func (b *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder) Request() *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest { 8560 return &DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest{ 8561 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 8562 } 8563 } 8564 8565 // ID returns request builder for ImportedWindowsAutopilotDeviceIdentity item 8566 func (b *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder) ID(id string) *ImportedWindowsAutopilotDeviceIdentityRequestBuilder { 8567 bb := &ImportedWindowsAutopilotDeviceIdentityRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8568 bb.baseURL += "/" + id 8569 return bb 8570 } 8571 8572 // DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest is request for ImportedWindowsAutopilotDeviceIdentity collection 8573 type DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest struct{ BaseRequest } 8574 8575 // Paging perfoms paging operation for ImportedWindowsAutopilotDeviceIdentity collection 8576 func (r *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ImportedWindowsAutopilotDeviceIdentity, error) { 8577 req, err := r.NewJSONRequest(method, path, obj) 8578 if err != nil { 8579 return nil, err 8580 } 8581 if ctx != nil { 8582 req = req.WithContext(ctx) 8583 } 8584 res, err := r.client.Do(req) 8585 if err != nil { 8586 return nil, err 8587 } 8588 var values []ImportedWindowsAutopilotDeviceIdentity 8589 for { 8590 if res.StatusCode != http.StatusOK { 8591 b, _ := ioutil.ReadAll(res.Body) 8592 res.Body.Close() 8593 errRes := &ErrorResponse{Response: res} 8594 err := jsonx.Unmarshal(b, errRes) 8595 if err != nil { 8596 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 8597 } 8598 return nil, errRes 8599 } 8600 var ( 8601 paging Paging 8602 value []ImportedWindowsAutopilotDeviceIdentity 8603 ) 8604 err := jsonx.NewDecoder(res.Body).Decode(&paging) 8605 res.Body.Close() 8606 if err != nil { 8607 return nil, err 8608 } 8609 err = jsonx.Unmarshal(paging.Value, &value) 8610 if err != nil { 8611 return nil, err 8612 } 8613 values = append(values, value...) 8614 if n >= 0 { 8615 n-- 8616 } 8617 if n == 0 || len(paging.NextLink) == 0 { 8618 return values, nil 8619 } 8620 req, err = http.NewRequest("GET", paging.NextLink, nil) 8621 if ctx != nil { 8622 req = req.WithContext(ctx) 8623 } 8624 res, err = r.client.Do(req) 8625 if err != nil { 8626 return nil, err 8627 } 8628 } 8629 } 8630 8631 // GetN performs GET request for ImportedWindowsAutopilotDeviceIdentity collection, max N pages 8632 func (r *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest) GetN(ctx context.Context, n int) ([]ImportedWindowsAutopilotDeviceIdentity, error) { 8633 var query string 8634 if r.query != nil { 8635 query = "?" + r.query.Encode() 8636 } 8637 return r.Paging(ctx, "GET", query, nil, n) 8638 } 8639 8640 // Get performs GET request for ImportedWindowsAutopilotDeviceIdentity collection 8641 func (r *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest) Get(ctx context.Context) ([]ImportedWindowsAutopilotDeviceIdentity, error) { 8642 return r.GetN(ctx, 0) 8643 } 8644 8645 // Add performs POST request for ImportedWindowsAutopilotDeviceIdentity collection 8646 func (r *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest) Add(ctx context.Context, reqObj *ImportedWindowsAutopilotDeviceIdentity) (resObj *ImportedWindowsAutopilotDeviceIdentity, err error) { 8647 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 8648 return 8649 } 8650 8651 // Intents returns request builder for DeviceManagementIntent collection 8652 func (b *DeviceManagementRequestBuilder) Intents() *DeviceManagementIntentsCollectionRequestBuilder { 8653 bb := &DeviceManagementIntentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8654 bb.baseURL += "/intents" 8655 return bb 8656 } 8657 8658 // DeviceManagementIntentsCollectionRequestBuilder is request builder for DeviceManagementIntent collection 8659 type DeviceManagementIntentsCollectionRequestBuilder struct{ BaseRequestBuilder } 8660 8661 // Request returns request for DeviceManagementIntent collection 8662 func (b *DeviceManagementIntentsCollectionRequestBuilder) Request() *DeviceManagementIntentsCollectionRequest { 8663 return &DeviceManagementIntentsCollectionRequest{ 8664 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 8665 } 8666 } 8667 8668 // ID returns request builder for DeviceManagementIntent item 8669 func (b *DeviceManagementIntentsCollectionRequestBuilder) ID(id string) *DeviceManagementIntentRequestBuilder { 8670 bb := &DeviceManagementIntentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8671 bb.baseURL += "/" + id 8672 return bb 8673 } 8674 8675 // DeviceManagementIntentsCollectionRequest is request for DeviceManagementIntent collection 8676 type DeviceManagementIntentsCollectionRequest struct{ BaseRequest } 8677 8678 // Paging perfoms paging operation for DeviceManagementIntent collection 8679 func (r *DeviceManagementIntentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementIntent, error) { 8680 req, err := r.NewJSONRequest(method, path, obj) 8681 if err != nil { 8682 return nil, err 8683 } 8684 if ctx != nil { 8685 req = req.WithContext(ctx) 8686 } 8687 res, err := r.client.Do(req) 8688 if err != nil { 8689 return nil, err 8690 } 8691 var values []DeviceManagementIntent 8692 for { 8693 if res.StatusCode != http.StatusOK { 8694 b, _ := ioutil.ReadAll(res.Body) 8695 res.Body.Close() 8696 errRes := &ErrorResponse{Response: res} 8697 err := jsonx.Unmarshal(b, errRes) 8698 if err != nil { 8699 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 8700 } 8701 return nil, errRes 8702 } 8703 var ( 8704 paging Paging 8705 value []DeviceManagementIntent 8706 ) 8707 err := jsonx.NewDecoder(res.Body).Decode(&paging) 8708 res.Body.Close() 8709 if err != nil { 8710 return nil, err 8711 } 8712 err = jsonx.Unmarshal(paging.Value, &value) 8713 if err != nil { 8714 return nil, err 8715 } 8716 values = append(values, value...) 8717 if n >= 0 { 8718 n-- 8719 } 8720 if n == 0 || len(paging.NextLink) == 0 { 8721 return values, nil 8722 } 8723 req, err = http.NewRequest("GET", paging.NextLink, nil) 8724 if ctx != nil { 8725 req = req.WithContext(ctx) 8726 } 8727 res, err = r.client.Do(req) 8728 if err != nil { 8729 return nil, err 8730 } 8731 } 8732 } 8733 8734 // GetN performs GET request for DeviceManagementIntent collection, max N pages 8735 func (r *DeviceManagementIntentsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementIntent, error) { 8736 var query string 8737 if r.query != nil { 8738 query = "?" + r.query.Encode() 8739 } 8740 return r.Paging(ctx, "GET", query, nil, n) 8741 } 8742 8743 // Get performs GET request for DeviceManagementIntent collection 8744 func (r *DeviceManagementIntentsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementIntent, error) { 8745 return r.GetN(ctx, 0) 8746 } 8747 8748 // Add performs POST request for DeviceManagementIntent collection 8749 func (r *DeviceManagementIntentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementIntent) (resObj *DeviceManagementIntent, err error) { 8750 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 8751 return 8752 } 8753 8754 // IntuneBrandingProfiles returns request builder for IntuneBrandingProfile collection 8755 func (b *DeviceManagementRequestBuilder) IntuneBrandingProfiles() *DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder { 8756 bb := &DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8757 bb.baseURL += "/intuneBrandingProfiles" 8758 return bb 8759 } 8760 8761 // DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder is request builder for IntuneBrandingProfile collection 8762 type DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } 8763 8764 // Request returns request for IntuneBrandingProfile collection 8765 func (b *DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder) Request() *DeviceManagementIntuneBrandingProfilesCollectionRequest { 8766 return &DeviceManagementIntuneBrandingProfilesCollectionRequest{ 8767 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 8768 } 8769 } 8770 8771 // ID returns request builder for IntuneBrandingProfile item 8772 func (b *DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder) ID(id string) *IntuneBrandingProfileRequestBuilder { 8773 bb := &IntuneBrandingProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8774 bb.baseURL += "/" + id 8775 return bb 8776 } 8777 8778 // DeviceManagementIntuneBrandingProfilesCollectionRequest is request for IntuneBrandingProfile collection 8779 type DeviceManagementIntuneBrandingProfilesCollectionRequest struct{ BaseRequest } 8780 8781 // Paging perfoms paging operation for IntuneBrandingProfile collection 8782 func (r *DeviceManagementIntuneBrandingProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]IntuneBrandingProfile, error) { 8783 req, err := r.NewJSONRequest(method, path, obj) 8784 if err != nil { 8785 return nil, err 8786 } 8787 if ctx != nil { 8788 req = req.WithContext(ctx) 8789 } 8790 res, err := r.client.Do(req) 8791 if err != nil { 8792 return nil, err 8793 } 8794 var values []IntuneBrandingProfile 8795 for { 8796 if res.StatusCode != http.StatusOK { 8797 b, _ := ioutil.ReadAll(res.Body) 8798 res.Body.Close() 8799 errRes := &ErrorResponse{Response: res} 8800 err := jsonx.Unmarshal(b, errRes) 8801 if err != nil { 8802 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 8803 } 8804 return nil, errRes 8805 } 8806 var ( 8807 paging Paging 8808 value []IntuneBrandingProfile 8809 ) 8810 err := jsonx.NewDecoder(res.Body).Decode(&paging) 8811 res.Body.Close() 8812 if err != nil { 8813 return nil, err 8814 } 8815 err = jsonx.Unmarshal(paging.Value, &value) 8816 if err != nil { 8817 return nil, err 8818 } 8819 values = append(values, value...) 8820 if n >= 0 { 8821 n-- 8822 } 8823 if n == 0 || len(paging.NextLink) == 0 { 8824 return values, nil 8825 } 8826 req, err = http.NewRequest("GET", paging.NextLink, nil) 8827 if ctx != nil { 8828 req = req.WithContext(ctx) 8829 } 8830 res, err = r.client.Do(req) 8831 if err != nil { 8832 return nil, err 8833 } 8834 } 8835 } 8836 8837 // GetN performs GET request for IntuneBrandingProfile collection, max N pages 8838 func (r *DeviceManagementIntuneBrandingProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]IntuneBrandingProfile, error) { 8839 var query string 8840 if r.query != nil { 8841 query = "?" + r.query.Encode() 8842 } 8843 return r.Paging(ctx, "GET", query, nil, n) 8844 } 8845 8846 // Get performs GET request for IntuneBrandingProfile collection 8847 func (r *DeviceManagementIntuneBrandingProfilesCollectionRequest) Get(ctx context.Context) ([]IntuneBrandingProfile, error) { 8848 return r.GetN(ctx, 0) 8849 } 8850 8851 // Add performs POST request for IntuneBrandingProfile collection 8852 func (r *DeviceManagementIntuneBrandingProfilesCollectionRequest) Add(ctx context.Context, reqObj *IntuneBrandingProfile) (resObj *IntuneBrandingProfile, err error) { 8853 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 8854 return 8855 } 8856 8857 // IOSUpdateStatuses returns request builder for IOSUpdateDeviceStatus collection 8858 func (b *DeviceManagementRequestBuilder) IOSUpdateStatuses() *DeviceManagementIOSUpdateStatusesCollectionRequestBuilder { 8859 bb := &DeviceManagementIOSUpdateStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8860 bb.baseURL += "/iosUpdateStatuses" 8861 return bb 8862 } 8863 8864 // DeviceManagementIOSUpdateStatusesCollectionRequestBuilder is request builder for IOSUpdateDeviceStatus collection 8865 type DeviceManagementIOSUpdateStatusesCollectionRequestBuilder struct{ BaseRequestBuilder } 8866 8867 // Request returns request for IOSUpdateDeviceStatus collection 8868 func (b *DeviceManagementIOSUpdateStatusesCollectionRequestBuilder) Request() *DeviceManagementIOSUpdateStatusesCollectionRequest { 8869 return &DeviceManagementIOSUpdateStatusesCollectionRequest{ 8870 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 8871 } 8872 } 8873 8874 // ID returns request builder for IOSUpdateDeviceStatus item 8875 func (b *DeviceManagementIOSUpdateStatusesCollectionRequestBuilder) ID(id string) *IOSUpdateDeviceStatusRequestBuilder { 8876 bb := &IOSUpdateDeviceStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8877 bb.baseURL += "/" + id 8878 return bb 8879 } 8880 8881 // DeviceManagementIOSUpdateStatusesCollectionRequest is request for IOSUpdateDeviceStatus collection 8882 type DeviceManagementIOSUpdateStatusesCollectionRequest struct{ BaseRequest } 8883 8884 // Paging perfoms paging operation for IOSUpdateDeviceStatus collection 8885 func (r *DeviceManagementIOSUpdateStatusesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]IOSUpdateDeviceStatus, error) { 8886 req, err := r.NewJSONRequest(method, path, obj) 8887 if err != nil { 8888 return nil, err 8889 } 8890 if ctx != nil { 8891 req = req.WithContext(ctx) 8892 } 8893 res, err := r.client.Do(req) 8894 if err != nil { 8895 return nil, err 8896 } 8897 var values []IOSUpdateDeviceStatus 8898 for { 8899 if res.StatusCode != http.StatusOK { 8900 b, _ := ioutil.ReadAll(res.Body) 8901 res.Body.Close() 8902 errRes := &ErrorResponse{Response: res} 8903 err := jsonx.Unmarshal(b, errRes) 8904 if err != nil { 8905 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 8906 } 8907 return nil, errRes 8908 } 8909 var ( 8910 paging Paging 8911 value []IOSUpdateDeviceStatus 8912 ) 8913 err := jsonx.NewDecoder(res.Body).Decode(&paging) 8914 res.Body.Close() 8915 if err != nil { 8916 return nil, err 8917 } 8918 err = jsonx.Unmarshal(paging.Value, &value) 8919 if err != nil { 8920 return nil, err 8921 } 8922 values = append(values, value...) 8923 if n >= 0 { 8924 n-- 8925 } 8926 if n == 0 || len(paging.NextLink) == 0 { 8927 return values, nil 8928 } 8929 req, err = http.NewRequest("GET", paging.NextLink, nil) 8930 if ctx != nil { 8931 req = req.WithContext(ctx) 8932 } 8933 res, err = r.client.Do(req) 8934 if err != nil { 8935 return nil, err 8936 } 8937 } 8938 } 8939 8940 // GetN performs GET request for IOSUpdateDeviceStatus collection, max N pages 8941 func (r *DeviceManagementIOSUpdateStatusesCollectionRequest) GetN(ctx context.Context, n int) ([]IOSUpdateDeviceStatus, error) { 8942 var query string 8943 if r.query != nil { 8944 query = "?" + r.query.Encode() 8945 } 8946 return r.Paging(ctx, "GET", query, nil, n) 8947 } 8948 8949 // Get performs GET request for IOSUpdateDeviceStatus collection 8950 func (r *DeviceManagementIOSUpdateStatusesCollectionRequest) Get(ctx context.Context) ([]IOSUpdateDeviceStatus, error) { 8951 return r.GetN(ctx, 0) 8952 } 8953 8954 // Add performs POST request for IOSUpdateDeviceStatus collection 8955 func (r *DeviceManagementIOSUpdateStatusesCollectionRequest) Add(ctx context.Context, reqObj *IOSUpdateDeviceStatus) (resObj *IOSUpdateDeviceStatus, err error) { 8956 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 8957 return 8958 } 8959 8960 // ManagedDeviceEncryptionStates returns request builder for ManagedDeviceEncryptionState collection 8961 func (b *DeviceManagementRequestBuilder) ManagedDeviceEncryptionStates() *DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder { 8962 bb := &DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8963 bb.baseURL += "/managedDeviceEncryptionStates" 8964 return bb 8965 } 8966 8967 // DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder is request builder for ManagedDeviceEncryptionState collection 8968 type DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder struct{ BaseRequestBuilder } 8969 8970 // Request returns request for ManagedDeviceEncryptionState collection 8971 func (b *DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder) Request() *DeviceManagementManagedDeviceEncryptionStatesCollectionRequest { 8972 return &DeviceManagementManagedDeviceEncryptionStatesCollectionRequest{ 8973 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 8974 } 8975 } 8976 8977 // ID returns request builder for ManagedDeviceEncryptionState item 8978 func (b *DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder) ID(id string) *ManagedDeviceEncryptionStateRequestBuilder { 8979 bb := &ManagedDeviceEncryptionStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 8980 bb.baseURL += "/" + id 8981 return bb 8982 } 8983 8984 // DeviceManagementManagedDeviceEncryptionStatesCollectionRequest is request for ManagedDeviceEncryptionState collection 8985 type DeviceManagementManagedDeviceEncryptionStatesCollectionRequest struct{ BaseRequest } 8986 8987 // Paging perfoms paging operation for ManagedDeviceEncryptionState collection 8988 func (r *DeviceManagementManagedDeviceEncryptionStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedDeviceEncryptionState, error) { 8989 req, err := r.NewJSONRequest(method, path, obj) 8990 if err != nil { 8991 return nil, err 8992 } 8993 if ctx != nil { 8994 req = req.WithContext(ctx) 8995 } 8996 res, err := r.client.Do(req) 8997 if err != nil { 8998 return nil, err 8999 } 9000 var values []ManagedDeviceEncryptionState 9001 for { 9002 if res.StatusCode != http.StatusOK { 9003 b, _ := ioutil.ReadAll(res.Body) 9004 res.Body.Close() 9005 errRes := &ErrorResponse{Response: res} 9006 err := jsonx.Unmarshal(b, errRes) 9007 if err != nil { 9008 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 9009 } 9010 return nil, errRes 9011 } 9012 var ( 9013 paging Paging 9014 value []ManagedDeviceEncryptionState 9015 ) 9016 err := jsonx.NewDecoder(res.Body).Decode(&paging) 9017 res.Body.Close() 9018 if err != nil { 9019 return nil, err 9020 } 9021 err = jsonx.Unmarshal(paging.Value, &value) 9022 if err != nil { 9023 return nil, err 9024 } 9025 values = append(values, value...) 9026 if n >= 0 { 9027 n-- 9028 } 9029 if n == 0 || len(paging.NextLink) == 0 { 9030 return values, nil 9031 } 9032 req, err = http.NewRequest("GET", paging.NextLink, nil) 9033 if ctx != nil { 9034 req = req.WithContext(ctx) 9035 } 9036 res, err = r.client.Do(req) 9037 if err != nil { 9038 return nil, err 9039 } 9040 } 9041 } 9042 9043 // GetN performs GET request for ManagedDeviceEncryptionState collection, max N pages 9044 func (r *DeviceManagementManagedDeviceEncryptionStatesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedDeviceEncryptionState, error) { 9045 var query string 9046 if r.query != nil { 9047 query = "?" + r.query.Encode() 9048 } 9049 return r.Paging(ctx, "GET", query, nil, n) 9050 } 9051 9052 // Get performs GET request for ManagedDeviceEncryptionState collection 9053 func (r *DeviceManagementManagedDeviceEncryptionStatesCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceEncryptionState, error) { 9054 return r.GetN(ctx, 0) 9055 } 9056 9057 // Add performs POST request for ManagedDeviceEncryptionState collection 9058 func (r *DeviceManagementManagedDeviceEncryptionStatesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceEncryptionState) (resObj *ManagedDeviceEncryptionState, err error) { 9059 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 9060 return 9061 } 9062 9063 // ManagedDeviceOverview is navigation property 9064 func (b *DeviceManagementRequestBuilder) ManagedDeviceOverview() *ManagedDeviceOverviewRequestBuilder { 9065 bb := &ManagedDeviceOverviewRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9066 bb.baseURL += "/managedDeviceOverview" 9067 return bb 9068 } 9069 9070 // ManagedDevices returns request builder for ManagedDevice collection 9071 func (b *DeviceManagementRequestBuilder) ManagedDevices() *DeviceManagementManagedDevicesCollectionRequestBuilder { 9072 bb := &DeviceManagementManagedDevicesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9073 bb.baseURL += "/managedDevices" 9074 return bb 9075 } 9076 9077 // DeviceManagementManagedDevicesCollectionRequestBuilder is request builder for ManagedDevice collection 9078 type DeviceManagementManagedDevicesCollectionRequestBuilder struct{ BaseRequestBuilder } 9079 9080 // Request returns request for ManagedDevice collection 9081 func (b *DeviceManagementManagedDevicesCollectionRequestBuilder) Request() *DeviceManagementManagedDevicesCollectionRequest { 9082 return &DeviceManagementManagedDevicesCollectionRequest{ 9083 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 9084 } 9085 } 9086 9087 // ID returns request builder for ManagedDevice item 9088 func (b *DeviceManagementManagedDevicesCollectionRequestBuilder) ID(id string) *ManagedDeviceRequestBuilder { 9089 bb := &ManagedDeviceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9090 bb.baseURL += "/" + id 9091 return bb 9092 } 9093 9094 // DeviceManagementManagedDevicesCollectionRequest is request for ManagedDevice collection 9095 type DeviceManagementManagedDevicesCollectionRequest struct{ BaseRequest } 9096 9097 // Paging perfoms paging operation for ManagedDevice collection 9098 func (r *DeviceManagementManagedDevicesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedDevice, error) { 9099 req, err := r.NewJSONRequest(method, path, obj) 9100 if err != nil { 9101 return nil, err 9102 } 9103 if ctx != nil { 9104 req = req.WithContext(ctx) 9105 } 9106 res, err := r.client.Do(req) 9107 if err != nil { 9108 return nil, err 9109 } 9110 var values []ManagedDevice 9111 for { 9112 if res.StatusCode != http.StatusOK { 9113 b, _ := ioutil.ReadAll(res.Body) 9114 res.Body.Close() 9115 errRes := &ErrorResponse{Response: res} 9116 err := jsonx.Unmarshal(b, errRes) 9117 if err != nil { 9118 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 9119 } 9120 return nil, errRes 9121 } 9122 var ( 9123 paging Paging 9124 value []ManagedDevice 9125 ) 9126 err := jsonx.NewDecoder(res.Body).Decode(&paging) 9127 res.Body.Close() 9128 if err != nil { 9129 return nil, err 9130 } 9131 err = jsonx.Unmarshal(paging.Value, &value) 9132 if err != nil { 9133 return nil, err 9134 } 9135 values = append(values, value...) 9136 if n >= 0 { 9137 n-- 9138 } 9139 if n == 0 || len(paging.NextLink) == 0 { 9140 return values, nil 9141 } 9142 req, err = http.NewRequest("GET", paging.NextLink, nil) 9143 if ctx != nil { 9144 req = req.WithContext(ctx) 9145 } 9146 res, err = r.client.Do(req) 9147 if err != nil { 9148 return nil, err 9149 } 9150 } 9151 } 9152 9153 // GetN performs GET request for ManagedDevice collection, max N pages 9154 func (r *DeviceManagementManagedDevicesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedDevice, error) { 9155 var query string 9156 if r.query != nil { 9157 query = "?" + r.query.Encode() 9158 } 9159 return r.Paging(ctx, "GET", query, nil, n) 9160 } 9161 9162 // Get performs GET request for ManagedDevice collection 9163 func (r *DeviceManagementManagedDevicesCollectionRequest) Get(ctx context.Context) ([]ManagedDevice, error) { 9164 return r.GetN(ctx, 0) 9165 } 9166 9167 // Add performs POST request for ManagedDevice collection 9168 func (r *DeviceManagementManagedDevicesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDevice) (resObj *ManagedDevice, err error) { 9169 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 9170 return 9171 } 9172 9173 // ManagementConditionStatements returns request builder for ManagementConditionStatement collection 9174 func (b *DeviceManagementRequestBuilder) ManagementConditionStatements() *DeviceManagementManagementConditionStatementsCollectionRequestBuilder { 9175 bb := &DeviceManagementManagementConditionStatementsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9176 bb.baseURL += "/managementConditionStatements" 9177 return bb 9178 } 9179 9180 // DeviceManagementManagementConditionStatementsCollectionRequestBuilder is request builder for ManagementConditionStatement collection 9181 type DeviceManagementManagementConditionStatementsCollectionRequestBuilder struct{ BaseRequestBuilder } 9182 9183 // Request returns request for ManagementConditionStatement collection 9184 func (b *DeviceManagementManagementConditionStatementsCollectionRequestBuilder) Request() *DeviceManagementManagementConditionStatementsCollectionRequest { 9185 return &DeviceManagementManagementConditionStatementsCollectionRequest{ 9186 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 9187 } 9188 } 9189 9190 // ID returns request builder for ManagementConditionStatement item 9191 func (b *DeviceManagementManagementConditionStatementsCollectionRequestBuilder) ID(id string) *ManagementConditionStatementRequestBuilder { 9192 bb := &ManagementConditionStatementRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9193 bb.baseURL += "/" + id 9194 return bb 9195 } 9196 9197 // DeviceManagementManagementConditionStatementsCollectionRequest is request for ManagementConditionStatement collection 9198 type DeviceManagementManagementConditionStatementsCollectionRequest struct{ BaseRequest } 9199 9200 // Paging perfoms paging operation for ManagementConditionStatement collection 9201 func (r *DeviceManagementManagementConditionStatementsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagementConditionStatement, error) { 9202 req, err := r.NewJSONRequest(method, path, obj) 9203 if err != nil { 9204 return nil, err 9205 } 9206 if ctx != nil { 9207 req = req.WithContext(ctx) 9208 } 9209 res, err := r.client.Do(req) 9210 if err != nil { 9211 return nil, err 9212 } 9213 var values []ManagementConditionStatement 9214 for { 9215 if res.StatusCode != http.StatusOK { 9216 b, _ := ioutil.ReadAll(res.Body) 9217 res.Body.Close() 9218 errRes := &ErrorResponse{Response: res} 9219 err := jsonx.Unmarshal(b, errRes) 9220 if err != nil { 9221 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 9222 } 9223 return nil, errRes 9224 } 9225 var ( 9226 paging Paging 9227 value []ManagementConditionStatement 9228 ) 9229 err := jsonx.NewDecoder(res.Body).Decode(&paging) 9230 res.Body.Close() 9231 if err != nil { 9232 return nil, err 9233 } 9234 err = jsonx.Unmarshal(paging.Value, &value) 9235 if err != nil { 9236 return nil, err 9237 } 9238 values = append(values, value...) 9239 if n >= 0 { 9240 n-- 9241 } 9242 if n == 0 || len(paging.NextLink) == 0 { 9243 return values, nil 9244 } 9245 req, err = http.NewRequest("GET", paging.NextLink, nil) 9246 if ctx != nil { 9247 req = req.WithContext(ctx) 9248 } 9249 res, err = r.client.Do(req) 9250 if err != nil { 9251 return nil, err 9252 } 9253 } 9254 } 9255 9256 // GetN performs GET request for ManagementConditionStatement collection, max N pages 9257 func (r *DeviceManagementManagementConditionStatementsCollectionRequest) GetN(ctx context.Context, n int) ([]ManagementConditionStatement, error) { 9258 var query string 9259 if r.query != nil { 9260 query = "?" + r.query.Encode() 9261 } 9262 return r.Paging(ctx, "GET", query, nil, n) 9263 } 9264 9265 // Get performs GET request for ManagementConditionStatement collection 9266 func (r *DeviceManagementManagementConditionStatementsCollectionRequest) Get(ctx context.Context) ([]ManagementConditionStatement, error) { 9267 return r.GetN(ctx, 0) 9268 } 9269 9270 // Add performs POST request for ManagementConditionStatement collection 9271 func (r *DeviceManagementManagementConditionStatementsCollectionRequest) Add(ctx context.Context, reqObj *ManagementConditionStatement) (resObj *ManagementConditionStatement, err error) { 9272 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 9273 return 9274 } 9275 9276 // ManagementConditions returns request builder for ManagementCondition collection 9277 func (b *DeviceManagementRequestBuilder) ManagementConditions() *DeviceManagementManagementConditionsCollectionRequestBuilder { 9278 bb := &DeviceManagementManagementConditionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9279 bb.baseURL += "/managementConditions" 9280 return bb 9281 } 9282 9283 // DeviceManagementManagementConditionsCollectionRequestBuilder is request builder for ManagementCondition collection 9284 type DeviceManagementManagementConditionsCollectionRequestBuilder struct{ BaseRequestBuilder } 9285 9286 // Request returns request for ManagementCondition collection 9287 func (b *DeviceManagementManagementConditionsCollectionRequestBuilder) Request() *DeviceManagementManagementConditionsCollectionRequest { 9288 return &DeviceManagementManagementConditionsCollectionRequest{ 9289 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 9290 } 9291 } 9292 9293 // ID returns request builder for ManagementCondition item 9294 func (b *DeviceManagementManagementConditionsCollectionRequestBuilder) ID(id string) *ManagementConditionRequestBuilder { 9295 bb := &ManagementConditionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9296 bb.baseURL += "/" + id 9297 return bb 9298 } 9299 9300 // DeviceManagementManagementConditionsCollectionRequest is request for ManagementCondition collection 9301 type DeviceManagementManagementConditionsCollectionRequest struct{ BaseRequest } 9302 9303 // Paging perfoms paging operation for ManagementCondition collection 9304 func (r *DeviceManagementManagementConditionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagementCondition, error) { 9305 req, err := r.NewJSONRequest(method, path, obj) 9306 if err != nil { 9307 return nil, err 9308 } 9309 if ctx != nil { 9310 req = req.WithContext(ctx) 9311 } 9312 res, err := r.client.Do(req) 9313 if err != nil { 9314 return nil, err 9315 } 9316 var values []ManagementCondition 9317 for { 9318 if res.StatusCode != http.StatusOK { 9319 b, _ := ioutil.ReadAll(res.Body) 9320 res.Body.Close() 9321 errRes := &ErrorResponse{Response: res} 9322 err := jsonx.Unmarshal(b, errRes) 9323 if err != nil { 9324 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 9325 } 9326 return nil, errRes 9327 } 9328 var ( 9329 paging Paging 9330 value []ManagementCondition 9331 ) 9332 err := jsonx.NewDecoder(res.Body).Decode(&paging) 9333 res.Body.Close() 9334 if err != nil { 9335 return nil, err 9336 } 9337 err = jsonx.Unmarshal(paging.Value, &value) 9338 if err != nil { 9339 return nil, err 9340 } 9341 values = append(values, value...) 9342 if n >= 0 { 9343 n-- 9344 } 9345 if n == 0 || len(paging.NextLink) == 0 { 9346 return values, nil 9347 } 9348 req, err = http.NewRequest("GET", paging.NextLink, nil) 9349 if ctx != nil { 9350 req = req.WithContext(ctx) 9351 } 9352 res, err = r.client.Do(req) 9353 if err != nil { 9354 return nil, err 9355 } 9356 } 9357 } 9358 9359 // GetN performs GET request for ManagementCondition collection, max N pages 9360 func (r *DeviceManagementManagementConditionsCollectionRequest) GetN(ctx context.Context, n int) ([]ManagementCondition, error) { 9361 var query string 9362 if r.query != nil { 9363 query = "?" + r.query.Encode() 9364 } 9365 return r.Paging(ctx, "GET", query, nil, n) 9366 } 9367 9368 // Get performs GET request for ManagementCondition collection 9369 func (r *DeviceManagementManagementConditionsCollectionRequest) Get(ctx context.Context) ([]ManagementCondition, error) { 9370 return r.GetN(ctx, 0) 9371 } 9372 9373 // Add performs POST request for ManagementCondition collection 9374 func (r *DeviceManagementManagementConditionsCollectionRequest) Add(ctx context.Context, reqObj *ManagementCondition) (resObj *ManagementCondition, err error) { 9375 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 9376 return 9377 } 9378 9379 // MobileAppTroubleshootingEvents returns request builder for MobileAppTroubleshootingEvent collection 9380 func (b *DeviceManagementRequestBuilder) MobileAppTroubleshootingEvents() *DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder { 9381 bb := &DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9382 bb.baseURL += "/mobileAppTroubleshootingEvents" 9383 return bb 9384 } 9385 9386 // DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder is request builder for MobileAppTroubleshootingEvent collection 9387 type DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder struct{ BaseRequestBuilder } 9388 9389 // Request returns request for MobileAppTroubleshootingEvent collection 9390 func (b *DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder) Request() *DeviceManagementMobileAppTroubleshootingEventsCollectionRequest { 9391 return &DeviceManagementMobileAppTroubleshootingEventsCollectionRequest{ 9392 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 9393 } 9394 } 9395 9396 // ID returns request builder for MobileAppTroubleshootingEvent item 9397 func (b *DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder) ID(id string) *MobileAppTroubleshootingEventRequestBuilder { 9398 bb := &MobileAppTroubleshootingEventRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9399 bb.baseURL += "/" + id 9400 return bb 9401 } 9402 9403 // DeviceManagementMobileAppTroubleshootingEventsCollectionRequest is request for MobileAppTroubleshootingEvent collection 9404 type DeviceManagementMobileAppTroubleshootingEventsCollectionRequest struct{ BaseRequest } 9405 9406 // Paging perfoms paging operation for MobileAppTroubleshootingEvent collection 9407 func (r *DeviceManagementMobileAppTroubleshootingEventsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]MobileAppTroubleshootingEvent, error) { 9408 req, err := r.NewJSONRequest(method, path, obj) 9409 if err != nil { 9410 return nil, err 9411 } 9412 if ctx != nil { 9413 req = req.WithContext(ctx) 9414 } 9415 res, err := r.client.Do(req) 9416 if err != nil { 9417 return nil, err 9418 } 9419 var values []MobileAppTroubleshootingEvent 9420 for { 9421 if res.StatusCode != http.StatusOK { 9422 b, _ := ioutil.ReadAll(res.Body) 9423 res.Body.Close() 9424 errRes := &ErrorResponse{Response: res} 9425 err := jsonx.Unmarshal(b, errRes) 9426 if err != nil { 9427 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 9428 } 9429 return nil, errRes 9430 } 9431 var ( 9432 paging Paging 9433 value []MobileAppTroubleshootingEvent 9434 ) 9435 err := jsonx.NewDecoder(res.Body).Decode(&paging) 9436 res.Body.Close() 9437 if err != nil { 9438 return nil, err 9439 } 9440 err = jsonx.Unmarshal(paging.Value, &value) 9441 if err != nil { 9442 return nil, err 9443 } 9444 values = append(values, value...) 9445 if n >= 0 { 9446 n-- 9447 } 9448 if n == 0 || len(paging.NextLink) == 0 { 9449 return values, nil 9450 } 9451 req, err = http.NewRequest("GET", paging.NextLink, nil) 9452 if ctx != nil { 9453 req = req.WithContext(ctx) 9454 } 9455 res, err = r.client.Do(req) 9456 if err != nil { 9457 return nil, err 9458 } 9459 } 9460 } 9461 9462 // GetN performs GET request for MobileAppTroubleshootingEvent collection, max N pages 9463 func (r *DeviceManagementMobileAppTroubleshootingEventsCollectionRequest) GetN(ctx context.Context, n int) ([]MobileAppTroubleshootingEvent, error) { 9464 var query string 9465 if r.query != nil { 9466 query = "?" + r.query.Encode() 9467 } 9468 return r.Paging(ctx, "GET", query, nil, n) 9469 } 9470 9471 // Get performs GET request for MobileAppTroubleshootingEvent collection 9472 func (r *DeviceManagementMobileAppTroubleshootingEventsCollectionRequest) Get(ctx context.Context) ([]MobileAppTroubleshootingEvent, error) { 9473 return r.GetN(ctx, 0) 9474 } 9475 9476 // Add performs POST request for MobileAppTroubleshootingEvent collection 9477 func (r *DeviceManagementMobileAppTroubleshootingEventsCollectionRequest) Add(ctx context.Context, reqObj *MobileAppTroubleshootingEvent) (resObj *MobileAppTroubleshootingEvent, err error) { 9478 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 9479 return 9480 } 9481 9482 // MobileThreatDefenseConnectors returns request builder for MobileThreatDefenseConnector collection 9483 func (b *DeviceManagementRequestBuilder) MobileThreatDefenseConnectors() *DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder { 9484 bb := &DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9485 bb.baseURL += "/mobileThreatDefenseConnectors" 9486 return bb 9487 } 9488 9489 // DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder is request builder for MobileThreatDefenseConnector collection 9490 type DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder struct{ BaseRequestBuilder } 9491 9492 // Request returns request for MobileThreatDefenseConnector collection 9493 func (b *DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder) Request() *DeviceManagementMobileThreatDefenseConnectorsCollectionRequest { 9494 return &DeviceManagementMobileThreatDefenseConnectorsCollectionRequest{ 9495 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 9496 } 9497 } 9498 9499 // ID returns request builder for MobileThreatDefenseConnector item 9500 func (b *DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder) ID(id string) *MobileThreatDefenseConnectorRequestBuilder { 9501 bb := &MobileThreatDefenseConnectorRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9502 bb.baseURL += "/" + id 9503 return bb 9504 } 9505 9506 // DeviceManagementMobileThreatDefenseConnectorsCollectionRequest is request for MobileThreatDefenseConnector collection 9507 type DeviceManagementMobileThreatDefenseConnectorsCollectionRequest struct{ BaseRequest } 9508 9509 // Paging perfoms paging operation for MobileThreatDefenseConnector collection 9510 func (r *DeviceManagementMobileThreatDefenseConnectorsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]MobileThreatDefenseConnector, error) { 9511 req, err := r.NewJSONRequest(method, path, obj) 9512 if err != nil { 9513 return nil, err 9514 } 9515 if ctx != nil { 9516 req = req.WithContext(ctx) 9517 } 9518 res, err := r.client.Do(req) 9519 if err != nil { 9520 return nil, err 9521 } 9522 var values []MobileThreatDefenseConnector 9523 for { 9524 if res.StatusCode != http.StatusOK { 9525 b, _ := ioutil.ReadAll(res.Body) 9526 res.Body.Close() 9527 errRes := &ErrorResponse{Response: res} 9528 err := jsonx.Unmarshal(b, errRes) 9529 if err != nil { 9530 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 9531 } 9532 return nil, errRes 9533 } 9534 var ( 9535 paging Paging 9536 value []MobileThreatDefenseConnector 9537 ) 9538 err := jsonx.NewDecoder(res.Body).Decode(&paging) 9539 res.Body.Close() 9540 if err != nil { 9541 return nil, err 9542 } 9543 err = jsonx.Unmarshal(paging.Value, &value) 9544 if err != nil { 9545 return nil, err 9546 } 9547 values = append(values, value...) 9548 if n >= 0 { 9549 n-- 9550 } 9551 if n == 0 || len(paging.NextLink) == 0 { 9552 return values, nil 9553 } 9554 req, err = http.NewRequest("GET", paging.NextLink, nil) 9555 if ctx != nil { 9556 req = req.WithContext(ctx) 9557 } 9558 res, err = r.client.Do(req) 9559 if err != nil { 9560 return nil, err 9561 } 9562 } 9563 } 9564 9565 // GetN performs GET request for MobileThreatDefenseConnector collection, max N pages 9566 func (r *DeviceManagementMobileThreatDefenseConnectorsCollectionRequest) GetN(ctx context.Context, n int) ([]MobileThreatDefenseConnector, error) { 9567 var query string 9568 if r.query != nil { 9569 query = "?" + r.query.Encode() 9570 } 9571 return r.Paging(ctx, "GET", query, nil, n) 9572 } 9573 9574 // Get performs GET request for MobileThreatDefenseConnector collection 9575 func (r *DeviceManagementMobileThreatDefenseConnectorsCollectionRequest) Get(ctx context.Context) ([]MobileThreatDefenseConnector, error) { 9576 return r.GetN(ctx, 0) 9577 } 9578 9579 // Add performs POST request for MobileThreatDefenseConnector collection 9580 func (r *DeviceManagementMobileThreatDefenseConnectorsCollectionRequest) Add(ctx context.Context, reqObj *MobileThreatDefenseConnector) (resObj *MobileThreatDefenseConnector, err error) { 9581 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 9582 return 9583 } 9584 9585 // NDESConnectors returns request builder for NDESConnector collection 9586 func (b *DeviceManagementRequestBuilder) NDESConnectors() *DeviceManagementNDESConnectorsCollectionRequestBuilder { 9587 bb := &DeviceManagementNDESConnectorsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9588 bb.baseURL += "/ndesConnectors" 9589 return bb 9590 } 9591 9592 // DeviceManagementNDESConnectorsCollectionRequestBuilder is request builder for NDESConnector collection 9593 type DeviceManagementNDESConnectorsCollectionRequestBuilder struct{ BaseRequestBuilder } 9594 9595 // Request returns request for NDESConnector collection 9596 func (b *DeviceManagementNDESConnectorsCollectionRequestBuilder) Request() *DeviceManagementNDESConnectorsCollectionRequest { 9597 return &DeviceManagementNDESConnectorsCollectionRequest{ 9598 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 9599 } 9600 } 9601 9602 // ID returns request builder for NDESConnector item 9603 func (b *DeviceManagementNDESConnectorsCollectionRequestBuilder) ID(id string) *NDESConnectorRequestBuilder { 9604 bb := &NDESConnectorRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9605 bb.baseURL += "/" + id 9606 return bb 9607 } 9608 9609 // DeviceManagementNDESConnectorsCollectionRequest is request for NDESConnector collection 9610 type DeviceManagementNDESConnectorsCollectionRequest struct{ BaseRequest } 9611 9612 // Paging perfoms paging operation for NDESConnector collection 9613 func (r *DeviceManagementNDESConnectorsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]NDESConnector, error) { 9614 req, err := r.NewJSONRequest(method, path, obj) 9615 if err != nil { 9616 return nil, err 9617 } 9618 if ctx != nil { 9619 req = req.WithContext(ctx) 9620 } 9621 res, err := r.client.Do(req) 9622 if err != nil { 9623 return nil, err 9624 } 9625 var values []NDESConnector 9626 for { 9627 if res.StatusCode != http.StatusOK { 9628 b, _ := ioutil.ReadAll(res.Body) 9629 res.Body.Close() 9630 errRes := &ErrorResponse{Response: res} 9631 err := jsonx.Unmarshal(b, errRes) 9632 if err != nil { 9633 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 9634 } 9635 return nil, errRes 9636 } 9637 var ( 9638 paging Paging 9639 value []NDESConnector 9640 ) 9641 err := jsonx.NewDecoder(res.Body).Decode(&paging) 9642 res.Body.Close() 9643 if err != nil { 9644 return nil, err 9645 } 9646 err = jsonx.Unmarshal(paging.Value, &value) 9647 if err != nil { 9648 return nil, err 9649 } 9650 values = append(values, value...) 9651 if n >= 0 { 9652 n-- 9653 } 9654 if n == 0 || len(paging.NextLink) == 0 { 9655 return values, nil 9656 } 9657 req, err = http.NewRequest("GET", paging.NextLink, nil) 9658 if ctx != nil { 9659 req = req.WithContext(ctx) 9660 } 9661 res, err = r.client.Do(req) 9662 if err != nil { 9663 return nil, err 9664 } 9665 } 9666 } 9667 9668 // GetN performs GET request for NDESConnector collection, max N pages 9669 func (r *DeviceManagementNDESConnectorsCollectionRequest) GetN(ctx context.Context, n int) ([]NDESConnector, error) { 9670 var query string 9671 if r.query != nil { 9672 query = "?" + r.query.Encode() 9673 } 9674 return r.Paging(ctx, "GET", query, nil, n) 9675 } 9676 9677 // Get performs GET request for NDESConnector collection 9678 func (r *DeviceManagementNDESConnectorsCollectionRequest) Get(ctx context.Context) ([]NDESConnector, error) { 9679 return r.GetN(ctx, 0) 9680 } 9681 9682 // Add performs POST request for NDESConnector collection 9683 func (r *DeviceManagementNDESConnectorsCollectionRequest) Add(ctx context.Context, reqObj *NDESConnector) (resObj *NDESConnector, err error) { 9684 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 9685 return 9686 } 9687 9688 // NotificationMessageTemplates returns request builder for NotificationMessageTemplate collection 9689 func (b *DeviceManagementRequestBuilder) NotificationMessageTemplates() *DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder { 9690 bb := &DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9691 bb.baseURL += "/notificationMessageTemplates" 9692 return bb 9693 } 9694 9695 // DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder is request builder for NotificationMessageTemplate collection 9696 type DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder struct{ BaseRequestBuilder } 9697 9698 // Request returns request for NotificationMessageTemplate collection 9699 func (b *DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder) Request() *DeviceManagementNotificationMessageTemplatesCollectionRequest { 9700 return &DeviceManagementNotificationMessageTemplatesCollectionRequest{ 9701 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 9702 } 9703 } 9704 9705 // ID returns request builder for NotificationMessageTemplate item 9706 func (b *DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder) ID(id string) *NotificationMessageTemplateRequestBuilder { 9707 bb := &NotificationMessageTemplateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9708 bb.baseURL += "/" + id 9709 return bb 9710 } 9711 9712 // DeviceManagementNotificationMessageTemplatesCollectionRequest is request for NotificationMessageTemplate collection 9713 type DeviceManagementNotificationMessageTemplatesCollectionRequest struct{ BaseRequest } 9714 9715 // Paging perfoms paging operation for NotificationMessageTemplate collection 9716 func (r *DeviceManagementNotificationMessageTemplatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]NotificationMessageTemplate, error) { 9717 req, err := r.NewJSONRequest(method, path, obj) 9718 if err != nil { 9719 return nil, err 9720 } 9721 if ctx != nil { 9722 req = req.WithContext(ctx) 9723 } 9724 res, err := r.client.Do(req) 9725 if err != nil { 9726 return nil, err 9727 } 9728 var values []NotificationMessageTemplate 9729 for { 9730 if res.StatusCode != http.StatusOK { 9731 b, _ := ioutil.ReadAll(res.Body) 9732 res.Body.Close() 9733 errRes := &ErrorResponse{Response: res} 9734 err := jsonx.Unmarshal(b, errRes) 9735 if err != nil { 9736 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 9737 } 9738 return nil, errRes 9739 } 9740 var ( 9741 paging Paging 9742 value []NotificationMessageTemplate 9743 ) 9744 err := jsonx.NewDecoder(res.Body).Decode(&paging) 9745 res.Body.Close() 9746 if err != nil { 9747 return nil, err 9748 } 9749 err = jsonx.Unmarshal(paging.Value, &value) 9750 if err != nil { 9751 return nil, err 9752 } 9753 values = append(values, value...) 9754 if n >= 0 { 9755 n-- 9756 } 9757 if n == 0 || len(paging.NextLink) == 0 { 9758 return values, nil 9759 } 9760 req, err = http.NewRequest("GET", paging.NextLink, nil) 9761 if ctx != nil { 9762 req = req.WithContext(ctx) 9763 } 9764 res, err = r.client.Do(req) 9765 if err != nil { 9766 return nil, err 9767 } 9768 } 9769 } 9770 9771 // GetN performs GET request for NotificationMessageTemplate collection, max N pages 9772 func (r *DeviceManagementNotificationMessageTemplatesCollectionRequest) GetN(ctx context.Context, n int) ([]NotificationMessageTemplate, error) { 9773 var query string 9774 if r.query != nil { 9775 query = "?" + r.query.Encode() 9776 } 9777 return r.Paging(ctx, "GET", query, nil, n) 9778 } 9779 9780 // Get performs GET request for NotificationMessageTemplate collection 9781 func (r *DeviceManagementNotificationMessageTemplatesCollectionRequest) Get(ctx context.Context) ([]NotificationMessageTemplate, error) { 9782 return r.GetN(ctx, 0) 9783 } 9784 9785 // Add performs POST request for NotificationMessageTemplate collection 9786 func (r *DeviceManagementNotificationMessageTemplatesCollectionRequest) Add(ctx context.Context, reqObj *NotificationMessageTemplate) (resObj *NotificationMessageTemplate, err error) { 9787 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 9788 return 9789 } 9790 9791 // RemoteActionAudits returns request builder for RemoteActionAudit collection 9792 func (b *DeviceManagementRequestBuilder) RemoteActionAudits() *DeviceManagementRemoteActionAuditsCollectionRequestBuilder { 9793 bb := &DeviceManagementRemoteActionAuditsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9794 bb.baseURL += "/remoteActionAudits" 9795 return bb 9796 } 9797 9798 // DeviceManagementRemoteActionAuditsCollectionRequestBuilder is request builder for RemoteActionAudit collection 9799 type DeviceManagementRemoteActionAuditsCollectionRequestBuilder struct{ BaseRequestBuilder } 9800 9801 // Request returns request for RemoteActionAudit collection 9802 func (b *DeviceManagementRemoteActionAuditsCollectionRequestBuilder) Request() *DeviceManagementRemoteActionAuditsCollectionRequest { 9803 return &DeviceManagementRemoteActionAuditsCollectionRequest{ 9804 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 9805 } 9806 } 9807 9808 // ID returns request builder for RemoteActionAudit item 9809 func (b *DeviceManagementRemoteActionAuditsCollectionRequestBuilder) ID(id string) *RemoteActionAuditRequestBuilder { 9810 bb := &RemoteActionAuditRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9811 bb.baseURL += "/" + id 9812 return bb 9813 } 9814 9815 // DeviceManagementRemoteActionAuditsCollectionRequest is request for RemoteActionAudit collection 9816 type DeviceManagementRemoteActionAuditsCollectionRequest struct{ BaseRequest } 9817 9818 // Paging perfoms paging operation for RemoteActionAudit collection 9819 func (r *DeviceManagementRemoteActionAuditsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]RemoteActionAudit, error) { 9820 req, err := r.NewJSONRequest(method, path, obj) 9821 if err != nil { 9822 return nil, err 9823 } 9824 if ctx != nil { 9825 req = req.WithContext(ctx) 9826 } 9827 res, err := r.client.Do(req) 9828 if err != nil { 9829 return nil, err 9830 } 9831 var values []RemoteActionAudit 9832 for { 9833 if res.StatusCode != http.StatusOK { 9834 b, _ := ioutil.ReadAll(res.Body) 9835 res.Body.Close() 9836 errRes := &ErrorResponse{Response: res} 9837 err := jsonx.Unmarshal(b, errRes) 9838 if err != nil { 9839 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 9840 } 9841 return nil, errRes 9842 } 9843 var ( 9844 paging Paging 9845 value []RemoteActionAudit 9846 ) 9847 err := jsonx.NewDecoder(res.Body).Decode(&paging) 9848 res.Body.Close() 9849 if err != nil { 9850 return nil, err 9851 } 9852 err = jsonx.Unmarshal(paging.Value, &value) 9853 if err != nil { 9854 return nil, err 9855 } 9856 values = append(values, value...) 9857 if n >= 0 { 9858 n-- 9859 } 9860 if n == 0 || len(paging.NextLink) == 0 { 9861 return values, nil 9862 } 9863 req, err = http.NewRequest("GET", paging.NextLink, nil) 9864 if ctx != nil { 9865 req = req.WithContext(ctx) 9866 } 9867 res, err = r.client.Do(req) 9868 if err != nil { 9869 return nil, err 9870 } 9871 } 9872 } 9873 9874 // GetN performs GET request for RemoteActionAudit collection, max N pages 9875 func (r *DeviceManagementRemoteActionAuditsCollectionRequest) GetN(ctx context.Context, n int) ([]RemoteActionAudit, error) { 9876 var query string 9877 if r.query != nil { 9878 query = "?" + r.query.Encode() 9879 } 9880 return r.Paging(ctx, "GET", query, nil, n) 9881 } 9882 9883 // Get performs GET request for RemoteActionAudit collection 9884 func (r *DeviceManagementRemoteActionAuditsCollectionRequest) Get(ctx context.Context) ([]RemoteActionAudit, error) { 9885 return r.GetN(ctx, 0) 9886 } 9887 9888 // Add performs POST request for RemoteActionAudit collection 9889 func (r *DeviceManagementRemoteActionAuditsCollectionRequest) Add(ctx context.Context, reqObj *RemoteActionAudit) (resObj *RemoteActionAudit, err error) { 9890 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 9891 return 9892 } 9893 9894 // RemoteAssistancePartners returns request builder for RemoteAssistancePartner collection 9895 func (b *DeviceManagementRequestBuilder) RemoteAssistancePartners() *DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder { 9896 bb := &DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9897 bb.baseURL += "/remoteAssistancePartners" 9898 return bb 9899 } 9900 9901 // DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder is request builder for RemoteAssistancePartner collection 9902 type DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder struct{ BaseRequestBuilder } 9903 9904 // Request returns request for RemoteAssistancePartner collection 9905 func (b *DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder) Request() *DeviceManagementRemoteAssistancePartnersCollectionRequest { 9906 return &DeviceManagementRemoteAssistancePartnersCollectionRequest{ 9907 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 9908 } 9909 } 9910 9911 // ID returns request builder for RemoteAssistancePartner item 9912 func (b *DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder) ID(id string) *RemoteAssistancePartnerRequestBuilder { 9913 bb := &RemoteAssistancePartnerRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 9914 bb.baseURL += "/" + id 9915 return bb 9916 } 9917 9918 // DeviceManagementRemoteAssistancePartnersCollectionRequest is request for RemoteAssistancePartner collection 9919 type DeviceManagementRemoteAssistancePartnersCollectionRequest struct{ BaseRequest } 9920 9921 // Paging perfoms paging operation for RemoteAssistancePartner collection 9922 func (r *DeviceManagementRemoteAssistancePartnersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]RemoteAssistancePartner, error) { 9923 req, err := r.NewJSONRequest(method, path, obj) 9924 if err != nil { 9925 return nil, err 9926 } 9927 if ctx != nil { 9928 req = req.WithContext(ctx) 9929 } 9930 res, err := r.client.Do(req) 9931 if err != nil { 9932 return nil, err 9933 } 9934 var values []RemoteAssistancePartner 9935 for { 9936 if res.StatusCode != http.StatusOK { 9937 b, _ := ioutil.ReadAll(res.Body) 9938 res.Body.Close() 9939 errRes := &ErrorResponse{Response: res} 9940 err := jsonx.Unmarshal(b, errRes) 9941 if err != nil { 9942 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 9943 } 9944 return nil, errRes 9945 } 9946 var ( 9947 paging Paging 9948 value []RemoteAssistancePartner 9949 ) 9950 err := jsonx.NewDecoder(res.Body).Decode(&paging) 9951 res.Body.Close() 9952 if err != nil { 9953 return nil, err 9954 } 9955 err = jsonx.Unmarshal(paging.Value, &value) 9956 if err != nil { 9957 return nil, err 9958 } 9959 values = append(values, value...) 9960 if n >= 0 { 9961 n-- 9962 } 9963 if n == 0 || len(paging.NextLink) == 0 { 9964 return values, nil 9965 } 9966 req, err = http.NewRequest("GET", paging.NextLink, nil) 9967 if ctx != nil { 9968 req = req.WithContext(ctx) 9969 } 9970 res, err = r.client.Do(req) 9971 if err != nil { 9972 return nil, err 9973 } 9974 } 9975 } 9976 9977 // GetN performs GET request for RemoteAssistancePartner collection, max N pages 9978 func (r *DeviceManagementRemoteAssistancePartnersCollectionRequest) GetN(ctx context.Context, n int) ([]RemoteAssistancePartner, error) { 9979 var query string 9980 if r.query != nil { 9981 query = "?" + r.query.Encode() 9982 } 9983 return r.Paging(ctx, "GET", query, nil, n) 9984 } 9985 9986 // Get performs GET request for RemoteAssistancePartner collection 9987 func (r *DeviceManagementRemoteAssistancePartnersCollectionRequest) Get(ctx context.Context) ([]RemoteAssistancePartner, error) { 9988 return r.GetN(ctx, 0) 9989 } 9990 9991 // Add performs POST request for RemoteAssistancePartner collection 9992 func (r *DeviceManagementRemoteAssistancePartnersCollectionRequest) Add(ctx context.Context, reqObj *RemoteAssistancePartner) (resObj *RemoteAssistancePartner, err error) { 9993 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 9994 return 9995 } 9996 9997 // Reports is navigation property 9998 func (b *DeviceManagementRequestBuilder) Reports() *DeviceManagementReportsRequestBuilder { 9999 bb := &DeviceManagementReportsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10000 bb.baseURL += "/reports" 10001 return bb 10002 } 10003 10004 // ResourceOperations returns request builder for ResourceOperation collection 10005 func (b *DeviceManagementRequestBuilder) ResourceOperations() *DeviceManagementResourceOperationsCollectionRequestBuilder { 10006 bb := &DeviceManagementResourceOperationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10007 bb.baseURL += "/resourceOperations" 10008 return bb 10009 } 10010 10011 // DeviceManagementResourceOperationsCollectionRequestBuilder is request builder for ResourceOperation collection 10012 type DeviceManagementResourceOperationsCollectionRequestBuilder struct{ BaseRequestBuilder } 10013 10014 // Request returns request for ResourceOperation collection 10015 func (b *DeviceManagementResourceOperationsCollectionRequestBuilder) Request() *DeviceManagementResourceOperationsCollectionRequest { 10016 return &DeviceManagementResourceOperationsCollectionRequest{ 10017 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 10018 } 10019 } 10020 10021 // ID returns request builder for ResourceOperation item 10022 func (b *DeviceManagementResourceOperationsCollectionRequestBuilder) ID(id string) *ResourceOperationRequestBuilder { 10023 bb := &ResourceOperationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10024 bb.baseURL += "/" + id 10025 return bb 10026 } 10027 10028 // DeviceManagementResourceOperationsCollectionRequest is request for ResourceOperation collection 10029 type DeviceManagementResourceOperationsCollectionRequest struct{ BaseRequest } 10030 10031 // Paging perfoms paging operation for ResourceOperation collection 10032 func (r *DeviceManagementResourceOperationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ResourceOperation, error) { 10033 req, err := r.NewJSONRequest(method, path, obj) 10034 if err != nil { 10035 return nil, err 10036 } 10037 if ctx != nil { 10038 req = req.WithContext(ctx) 10039 } 10040 res, err := r.client.Do(req) 10041 if err != nil { 10042 return nil, err 10043 } 10044 var values []ResourceOperation 10045 for { 10046 if res.StatusCode != http.StatusOK { 10047 b, _ := ioutil.ReadAll(res.Body) 10048 res.Body.Close() 10049 errRes := &ErrorResponse{Response: res} 10050 err := jsonx.Unmarshal(b, errRes) 10051 if err != nil { 10052 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 10053 } 10054 return nil, errRes 10055 } 10056 var ( 10057 paging Paging 10058 value []ResourceOperation 10059 ) 10060 err := jsonx.NewDecoder(res.Body).Decode(&paging) 10061 res.Body.Close() 10062 if err != nil { 10063 return nil, err 10064 } 10065 err = jsonx.Unmarshal(paging.Value, &value) 10066 if err != nil { 10067 return nil, err 10068 } 10069 values = append(values, value...) 10070 if n >= 0 { 10071 n-- 10072 } 10073 if n == 0 || len(paging.NextLink) == 0 { 10074 return values, nil 10075 } 10076 req, err = http.NewRequest("GET", paging.NextLink, nil) 10077 if ctx != nil { 10078 req = req.WithContext(ctx) 10079 } 10080 res, err = r.client.Do(req) 10081 if err != nil { 10082 return nil, err 10083 } 10084 } 10085 } 10086 10087 // GetN performs GET request for ResourceOperation collection, max N pages 10088 func (r *DeviceManagementResourceOperationsCollectionRequest) GetN(ctx context.Context, n int) ([]ResourceOperation, error) { 10089 var query string 10090 if r.query != nil { 10091 query = "?" + r.query.Encode() 10092 } 10093 return r.Paging(ctx, "GET", query, nil, n) 10094 } 10095 10096 // Get performs GET request for ResourceOperation collection 10097 func (r *DeviceManagementResourceOperationsCollectionRequest) Get(ctx context.Context) ([]ResourceOperation, error) { 10098 return r.GetN(ctx, 0) 10099 } 10100 10101 // Add performs POST request for ResourceOperation collection 10102 func (r *DeviceManagementResourceOperationsCollectionRequest) Add(ctx context.Context, reqObj *ResourceOperation) (resObj *ResourceOperation, err error) { 10103 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 10104 return 10105 } 10106 10107 // RoleAssignments returns request builder for DeviceAndAppManagementRoleAssignment collection 10108 func (b *DeviceManagementRequestBuilder) RoleAssignments() *DeviceManagementRoleAssignmentsCollectionRequestBuilder { 10109 bb := &DeviceManagementRoleAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10110 bb.baseURL += "/roleAssignments" 10111 return bb 10112 } 10113 10114 // DeviceManagementRoleAssignmentsCollectionRequestBuilder is request builder for DeviceAndAppManagementRoleAssignment collection 10115 type DeviceManagementRoleAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder } 10116 10117 // Request returns request for DeviceAndAppManagementRoleAssignment collection 10118 func (b *DeviceManagementRoleAssignmentsCollectionRequestBuilder) Request() *DeviceManagementRoleAssignmentsCollectionRequest { 10119 return &DeviceManagementRoleAssignmentsCollectionRequest{ 10120 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 10121 } 10122 } 10123 10124 // ID returns request builder for DeviceAndAppManagementRoleAssignment item 10125 func (b *DeviceManagementRoleAssignmentsCollectionRequestBuilder) ID(id string) *DeviceAndAppManagementRoleAssignmentRequestBuilder { 10126 bb := &DeviceAndAppManagementRoleAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10127 bb.baseURL += "/" + id 10128 return bb 10129 } 10130 10131 // DeviceManagementRoleAssignmentsCollectionRequest is request for DeviceAndAppManagementRoleAssignment collection 10132 type DeviceManagementRoleAssignmentsCollectionRequest struct{ BaseRequest } 10133 10134 // Paging perfoms paging operation for DeviceAndAppManagementRoleAssignment collection 10135 func (r *DeviceManagementRoleAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceAndAppManagementRoleAssignment, error) { 10136 req, err := r.NewJSONRequest(method, path, obj) 10137 if err != nil { 10138 return nil, err 10139 } 10140 if ctx != nil { 10141 req = req.WithContext(ctx) 10142 } 10143 res, err := r.client.Do(req) 10144 if err != nil { 10145 return nil, err 10146 } 10147 var values []DeviceAndAppManagementRoleAssignment 10148 for { 10149 if res.StatusCode != http.StatusOK { 10150 b, _ := ioutil.ReadAll(res.Body) 10151 res.Body.Close() 10152 errRes := &ErrorResponse{Response: res} 10153 err := jsonx.Unmarshal(b, errRes) 10154 if err != nil { 10155 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 10156 } 10157 return nil, errRes 10158 } 10159 var ( 10160 paging Paging 10161 value []DeviceAndAppManagementRoleAssignment 10162 ) 10163 err := jsonx.NewDecoder(res.Body).Decode(&paging) 10164 res.Body.Close() 10165 if err != nil { 10166 return nil, err 10167 } 10168 err = jsonx.Unmarshal(paging.Value, &value) 10169 if err != nil { 10170 return nil, err 10171 } 10172 values = append(values, value...) 10173 if n >= 0 { 10174 n-- 10175 } 10176 if n == 0 || len(paging.NextLink) == 0 { 10177 return values, nil 10178 } 10179 req, err = http.NewRequest("GET", paging.NextLink, nil) 10180 if ctx != nil { 10181 req = req.WithContext(ctx) 10182 } 10183 res, err = r.client.Do(req) 10184 if err != nil { 10185 return nil, err 10186 } 10187 } 10188 } 10189 10190 // GetN performs GET request for DeviceAndAppManagementRoleAssignment collection, max N pages 10191 func (r *DeviceManagementRoleAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceAndAppManagementRoleAssignment, error) { 10192 var query string 10193 if r.query != nil { 10194 query = "?" + r.query.Encode() 10195 } 10196 return r.Paging(ctx, "GET", query, nil, n) 10197 } 10198 10199 // Get performs GET request for DeviceAndAppManagementRoleAssignment collection 10200 func (r *DeviceManagementRoleAssignmentsCollectionRequest) Get(ctx context.Context) ([]DeviceAndAppManagementRoleAssignment, error) { 10201 return r.GetN(ctx, 0) 10202 } 10203 10204 // Add performs POST request for DeviceAndAppManagementRoleAssignment collection 10205 func (r *DeviceManagementRoleAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceAndAppManagementRoleAssignment) (resObj *DeviceAndAppManagementRoleAssignment, err error) { 10206 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 10207 return 10208 } 10209 10210 // RoleDefinitions returns request builder for RoleDefinition collection 10211 func (b *DeviceManagementRequestBuilder) RoleDefinitions() *DeviceManagementRoleDefinitionsCollectionRequestBuilder { 10212 bb := &DeviceManagementRoleDefinitionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10213 bb.baseURL += "/roleDefinitions" 10214 return bb 10215 } 10216 10217 // DeviceManagementRoleDefinitionsCollectionRequestBuilder is request builder for RoleDefinition collection 10218 type DeviceManagementRoleDefinitionsCollectionRequestBuilder struct{ BaseRequestBuilder } 10219 10220 // Request returns request for RoleDefinition collection 10221 func (b *DeviceManagementRoleDefinitionsCollectionRequestBuilder) Request() *DeviceManagementRoleDefinitionsCollectionRequest { 10222 return &DeviceManagementRoleDefinitionsCollectionRequest{ 10223 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 10224 } 10225 } 10226 10227 // ID returns request builder for RoleDefinition item 10228 func (b *DeviceManagementRoleDefinitionsCollectionRequestBuilder) ID(id string) *RoleDefinitionRequestBuilder { 10229 bb := &RoleDefinitionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10230 bb.baseURL += "/" + id 10231 return bb 10232 } 10233 10234 // DeviceManagementRoleDefinitionsCollectionRequest is request for RoleDefinition collection 10235 type DeviceManagementRoleDefinitionsCollectionRequest struct{ BaseRequest } 10236 10237 // Paging perfoms paging operation for RoleDefinition collection 10238 func (r *DeviceManagementRoleDefinitionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]RoleDefinition, error) { 10239 req, err := r.NewJSONRequest(method, path, obj) 10240 if err != nil { 10241 return nil, err 10242 } 10243 if ctx != nil { 10244 req = req.WithContext(ctx) 10245 } 10246 res, err := r.client.Do(req) 10247 if err != nil { 10248 return nil, err 10249 } 10250 var values []RoleDefinition 10251 for { 10252 if res.StatusCode != http.StatusOK { 10253 b, _ := ioutil.ReadAll(res.Body) 10254 res.Body.Close() 10255 errRes := &ErrorResponse{Response: res} 10256 err := jsonx.Unmarshal(b, errRes) 10257 if err != nil { 10258 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 10259 } 10260 return nil, errRes 10261 } 10262 var ( 10263 paging Paging 10264 value []RoleDefinition 10265 ) 10266 err := jsonx.NewDecoder(res.Body).Decode(&paging) 10267 res.Body.Close() 10268 if err != nil { 10269 return nil, err 10270 } 10271 err = jsonx.Unmarshal(paging.Value, &value) 10272 if err != nil { 10273 return nil, err 10274 } 10275 values = append(values, value...) 10276 if n >= 0 { 10277 n-- 10278 } 10279 if n == 0 || len(paging.NextLink) == 0 { 10280 return values, nil 10281 } 10282 req, err = http.NewRequest("GET", paging.NextLink, nil) 10283 if ctx != nil { 10284 req = req.WithContext(ctx) 10285 } 10286 res, err = r.client.Do(req) 10287 if err != nil { 10288 return nil, err 10289 } 10290 } 10291 } 10292 10293 // GetN performs GET request for RoleDefinition collection, max N pages 10294 func (r *DeviceManagementRoleDefinitionsCollectionRequest) GetN(ctx context.Context, n int) ([]RoleDefinition, error) { 10295 var query string 10296 if r.query != nil { 10297 query = "?" + r.query.Encode() 10298 } 10299 return r.Paging(ctx, "GET", query, nil, n) 10300 } 10301 10302 // Get performs GET request for RoleDefinition collection 10303 func (r *DeviceManagementRoleDefinitionsCollectionRequest) Get(ctx context.Context) ([]RoleDefinition, error) { 10304 return r.GetN(ctx, 0) 10305 } 10306 10307 // Add performs POST request for RoleDefinition collection 10308 func (r *DeviceManagementRoleDefinitionsCollectionRequest) Add(ctx context.Context, reqObj *RoleDefinition) (resObj *RoleDefinition, err error) { 10309 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 10310 return 10311 } 10312 10313 // RoleScopeTags returns request builder for RoleScopeTag collection 10314 func (b *DeviceManagementRequestBuilder) RoleScopeTags() *DeviceManagementRoleScopeTagsCollectionRequestBuilder { 10315 bb := &DeviceManagementRoleScopeTagsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10316 bb.baseURL += "/roleScopeTags" 10317 return bb 10318 } 10319 10320 // DeviceManagementRoleScopeTagsCollectionRequestBuilder is request builder for RoleScopeTag collection 10321 type DeviceManagementRoleScopeTagsCollectionRequestBuilder struct{ BaseRequestBuilder } 10322 10323 // Request returns request for RoleScopeTag collection 10324 func (b *DeviceManagementRoleScopeTagsCollectionRequestBuilder) Request() *DeviceManagementRoleScopeTagsCollectionRequest { 10325 return &DeviceManagementRoleScopeTagsCollectionRequest{ 10326 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 10327 } 10328 } 10329 10330 // ID returns request builder for RoleScopeTag item 10331 func (b *DeviceManagementRoleScopeTagsCollectionRequestBuilder) ID(id string) *RoleScopeTagRequestBuilder { 10332 bb := &RoleScopeTagRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10333 bb.baseURL += "/" + id 10334 return bb 10335 } 10336 10337 // DeviceManagementRoleScopeTagsCollectionRequest is request for RoleScopeTag collection 10338 type DeviceManagementRoleScopeTagsCollectionRequest struct{ BaseRequest } 10339 10340 // Paging perfoms paging operation for RoleScopeTag collection 10341 func (r *DeviceManagementRoleScopeTagsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]RoleScopeTag, error) { 10342 req, err := r.NewJSONRequest(method, path, obj) 10343 if err != nil { 10344 return nil, err 10345 } 10346 if ctx != nil { 10347 req = req.WithContext(ctx) 10348 } 10349 res, err := r.client.Do(req) 10350 if err != nil { 10351 return nil, err 10352 } 10353 var values []RoleScopeTag 10354 for { 10355 if res.StatusCode != http.StatusOK { 10356 b, _ := ioutil.ReadAll(res.Body) 10357 res.Body.Close() 10358 errRes := &ErrorResponse{Response: res} 10359 err := jsonx.Unmarshal(b, errRes) 10360 if err != nil { 10361 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 10362 } 10363 return nil, errRes 10364 } 10365 var ( 10366 paging Paging 10367 value []RoleScopeTag 10368 ) 10369 err := jsonx.NewDecoder(res.Body).Decode(&paging) 10370 res.Body.Close() 10371 if err != nil { 10372 return nil, err 10373 } 10374 err = jsonx.Unmarshal(paging.Value, &value) 10375 if err != nil { 10376 return nil, err 10377 } 10378 values = append(values, value...) 10379 if n >= 0 { 10380 n-- 10381 } 10382 if n == 0 || len(paging.NextLink) == 0 { 10383 return values, nil 10384 } 10385 req, err = http.NewRequest("GET", paging.NextLink, nil) 10386 if ctx != nil { 10387 req = req.WithContext(ctx) 10388 } 10389 res, err = r.client.Do(req) 10390 if err != nil { 10391 return nil, err 10392 } 10393 } 10394 } 10395 10396 // GetN performs GET request for RoleScopeTag collection, max N pages 10397 func (r *DeviceManagementRoleScopeTagsCollectionRequest) GetN(ctx context.Context, n int) ([]RoleScopeTag, error) { 10398 var query string 10399 if r.query != nil { 10400 query = "?" + r.query.Encode() 10401 } 10402 return r.Paging(ctx, "GET", query, nil, n) 10403 } 10404 10405 // Get performs GET request for RoleScopeTag collection 10406 func (r *DeviceManagementRoleScopeTagsCollectionRequest) Get(ctx context.Context) ([]RoleScopeTag, error) { 10407 return r.GetN(ctx, 0) 10408 } 10409 10410 // Add performs POST request for RoleScopeTag collection 10411 func (r *DeviceManagementRoleScopeTagsCollectionRequest) Add(ctx context.Context, reqObj *RoleScopeTag) (resObj *RoleScopeTag, err error) { 10412 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 10413 return 10414 } 10415 10416 // SettingDefinitions returns request builder for DeviceManagementSettingDefinition collection 10417 func (b *DeviceManagementRequestBuilder) SettingDefinitions() *DeviceManagementSettingDefinitionsCollectionRequestBuilder { 10418 bb := &DeviceManagementSettingDefinitionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10419 bb.baseURL += "/settingDefinitions" 10420 return bb 10421 } 10422 10423 // DeviceManagementSettingDefinitionsCollectionRequestBuilder is request builder for DeviceManagementSettingDefinition collection 10424 type DeviceManagementSettingDefinitionsCollectionRequestBuilder struct{ BaseRequestBuilder } 10425 10426 // Request returns request for DeviceManagementSettingDefinition collection 10427 func (b *DeviceManagementSettingDefinitionsCollectionRequestBuilder) Request() *DeviceManagementSettingDefinitionsCollectionRequest { 10428 return &DeviceManagementSettingDefinitionsCollectionRequest{ 10429 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 10430 } 10431 } 10432 10433 // ID returns request builder for DeviceManagementSettingDefinition item 10434 func (b *DeviceManagementSettingDefinitionsCollectionRequestBuilder) ID(id string) *DeviceManagementSettingDefinitionRequestBuilder { 10435 bb := &DeviceManagementSettingDefinitionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10436 bb.baseURL += "/" + id 10437 return bb 10438 } 10439 10440 // DeviceManagementSettingDefinitionsCollectionRequest is request for DeviceManagementSettingDefinition collection 10441 type DeviceManagementSettingDefinitionsCollectionRequest struct{ BaseRequest } 10442 10443 // Paging perfoms paging operation for DeviceManagementSettingDefinition collection 10444 func (r *DeviceManagementSettingDefinitionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementSettingDefinition, error) { 10445 req, err := r.NewJSONRequest(method, path, obj) 10446 if err != nil { 10447 return nil, err 10448 } 10449 if ctx != nil { 10450 req = req.WithContext(ctx) 10451 } 10452 res, err := r.client.Do(req) 10453 if err != nil { 10454 return nil, err 10455 } 10456 var values []DeviceManagementSettingDefinition 10457 for { 10458 if res.StatusCode != http.StatusOK { 10459 b, _ := ioutil.ReadAll(res.Body) 10460 res.Body.Close() 10461 errRes := &ErrorResponse{Response: res} 10462 err := jsonx.Unmarshal(b, errRes) 10463 if err != nil { 10464 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 10465 } 10466 return nil, errRes 10467 } 10468 var ( 10469 paging Paging 10470 value []DeviceManagementSettingDefinition 10471 ) 10472 err := jsonx.NewDecoder(res.Body).Decode(&paging) 10473 res.Body.Close() 10474 if err != nil { 10475 return nil, err 10476 } 10477 err = jsonx.Unmarshal(paging.Value, &value) 10478 if err != nil { 10479 return nil, err 10480 } 10481 values = append(values, value...) 10482 if n >= 0 { 10483 n-- 10484 } 10485 if n == 0 || len(paging.NextLink) == 0 { 10486 return values, nil 10487 } 10488 req, err = http.NewRequest("GET", paging.NextLink, nil) 10489 if ctx != nil { 10490 req = req.WithContext(ctx) 10491 } 10492 res, err = r.client.Do(req) 10493 if err != nil { 10494 return nil, err 10495 } 10496 } 10497 } 10498 10499 // GetN performs GET request for DeviceManagementSettingDefinition collection, max N pages 10500 func (r *DeviceManagementSettingDefinitionsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementSettingDefinition, error) { 10501 var query string 10502 if r.query != nil { 10503 query = "?" + r.query.Encode() 10504 } 10505 return r.Paging(ctx, "GET", query, nil, n) 10506 } 10507 10508 // Get performs GET request for DeviceManagementSettingDefinition collection 10509 func (r *DeviceManagementSettingDefinitionsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingDefinition, error) { 10510 return r.GetN(ctx, 0) 10511 } 10512 10513 // Add performs POST request for DeviceManagementSettingDefinition collection 10514 func (r *DeviceManagementSettingDefinitionsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingDefinition) (resObj *DeviceManagementSettingDefinition, err error) { 10515 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 10516 return 10517 } 10518 10519 // SoftwareUpdateStatusSummary is navigation property 10520 func (b *DeviceManagementRequestBuilder) SoftwareUpdateStatusSummary() *SoftwareUpdateStatusSummaryRequestBuilder { 10521 bb := &SoftwareUpdateStatusSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10522 bb.baseURL += "/softwareUpdateStatusSummary" 10523 return bb 10524 } 10525 10526 // TelecomExpenseManagementPartners returns request builder for TelecomExpenseManagementPartner collection 10527 func (b *DeviceManagementRequestBuilder) TelecomExpenseManagementPartners() *DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder { 10528 bb := &DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10529 bb.baseURL += "/telecomExpenseManagementPartners" 10530 return bb 10531 } 10532 10533 // DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder is request builder for TelecomExpenseManagementPartner collection 10534 type DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder struct{ BaseRequestBuilder } 10535 10536 // Request returns request for TelecomExpenseManagementPartner collection 10537 func (b *DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder) Request() *DeviceManagementTelecomExpenseManagementPartnersCollectionRequest { 10538 return &DeviceManagementTelecomExpenseManagementPartnersCollectionRequest{ 10539 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 10540 } 10541 } 10542 10543 // ID returns request builder for TelecomExpenseManagementPartner item 10544 func (b *DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder) ID(id string) *TelecomExpenseManagementPartnerRequestBuilder { 10545 bb := &TelecomExpenseManagementPartnerRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10546 bb.baseURL += "/" + id 10547 return bb 10548 } 10549 10550 // DeviceManagementTelecomExpenseManagementPartnersCollectionRequest is request for TelecomExpenseManagementPartner collection 10551 type DeviceManagementTelecomExpenseManagementPartnersCollectionRequest struct{ BaseRequest } 10552 10553 // Paging perfoms paging operation for TelecomExpenseManagementPartner collection 10554 func (r *DeviceManagementTelecomExpenseManagementPartnersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]TelecomExpenseManagementPartner, error) { 10555 req, err := r.NewJSONRequest(method, path, obj) 10556 if err != nil { 10557 return nil, err 10558 } 10559 if ctx != nil { 10560 req = req.WithContext(ctx) 10561 } 10562 res, err := r.client.Do(req) 10563 if err != nil { 10564 return nil, err 10565 } 10566 var values []TelecomExpenseManagementPartner 10567 for { 10568 if res.StatusCode != http.StatusOK { 10569 b, _ := ioutil.ReadAll(res.Body) 10570 res.Body.Close() 10571 errRes := &ErrorResponse{Response: res} 10572 err := jsonx.Unmarshal(b, errRes) 10573 if err != nil { 10574 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 10575 } 10576 return nil, errRes 10577 } 10578 var ( 10579 paging Paging 10580 value []TelecomExpenseManagementPartner 10581 ) 10582 err := jsonx.NewDecoder(res.Body).Decode(&paging) 10583 res.Body.Close() 10584 if err != nil { 10585 return nil, err 10586 } 10587 err = jsonx.Unmarshal(paging.Value, &value) 10588 if err != nil { 10589 return nil, err 10590 } 10591 values = append(values, value...) 10592 if n >= 0 { 10593 n-- 10594 } 10595 if n == 0 || len(paging.NextLink) == 0 { 10596 return values, nil 10597 } 10598 req, err = http.NewRequest("GET", paging.NextLink, nil) 10599 if ctx != nil { 10600 req = req.WithContext(ctx) 10601 } 10602 res, err = r.client.Do(req) 10603 if err != nil { 10604 return nil, err 10605 } 10606 } 10607 } 10608 10609 // GetN performs GET request for TelecomExpenseManagementPartner collection, max N pages 10610 func (r *DeviceManagementTelecomExpenseManagementPartnersCollectionRequest) GetN(ctx context.Context, n int) ([]TelecomExpenseManagementPartner, error) { 10611 var query string 10612 if r.query != nil { 10613 query = "?" + r.query.Encode() 10614 } 10615 return r.Paging(ctx, "GET", query, nil, n) 10616 } 10617 10618 // Get performs GET request for TelecomExpenseManagementPartner collection 10619 func (r *DeviceManagementTelecomExpenseManagementPartnersCollectionRequest) Get(ctx context.Context) ([]TelecomExpenseManagementPartner, error) { 10620 return r.GetN(ctx, 0) 10621 } 10622 10623 // Add performs POST request for TelecomExpenseManagementPartner collection 10624 func (r *DeviceManagementTelecomExpenseManagementPartnersCollectionRequest) Add(ctx context.Context, reqObj *TelecomExpenseManagementPartner) (resObj *TelecomExpenseManagementPartner, err error) { 10625 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 10626 return 10627 } 10628 10629 // Templates returns request builder for DeviceManagementTemplate collection 10630 func (b *DeviceManagementRequestBuilder) Templates() *DeviceManagementTemplatesCollectionRequestBuilder { 10631 bb := &DeviceManagementTemplatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10632 bb.baseURL += "/templates" 10633 return bb 10634 } 10635 10636 // DeviceManagementTemplatesCollectionRequestBuilder is request builder for DeviceManagementTemplate collection 10637 type DeviceManagementTemplatesCollectionRequestBuilder struct{ BaseRequestBuilder } 10638 10639 // Request returns request for DeviceManagementTemplate collection 10640 func (b *DeviceManagementTemplatesCollectionRequestBuilder) Request() *DeviceManagementTemplatesCollectionRequest { 10641 return &DeviceManagementTemplatesCollectionRequest{ 10642 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 10643 } 10644 } 10645 10646 // ID returns request builder for DeviceManagementTemplate item 10647 func (b *DeviceManagementTemplatesCollectionRequestBuilder) ID(id string) *DeviceManagementTemplateRequestBuilder { 10648 bb := &DeviceManagementTemplateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10649 bb.baseURL += "/" + id 10650 return bb 10651 } 10652 10653 // DeviceManagementTemplatesCollectionRequest is request for DeviceManagementTemplate collection 10654 type DeviceManagementTemplatesCollectionRequest struct{ BaseRequest } 10655 10656 // Paging perfoms paging operation for DeviceManagementTemplate collection 10657 func (r *DeviceManagementTemplatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementTemplate, error) { 10658 req, err := r.NewJSONRequest(method, path, obj) 10659 if err != nil { 10660 return nil, err 10661 } 10662 if ctx != nil { 10663 req = req.WithContext(ctx) 10664 } 10665 res, err := r.client.Do(req) 10666 if err != nil { 10667 return nil, err 10668 } 10669 var values []DeviceManagementTemplate 10670 for { 10671 if res.StatusCode != http.StatusOK { 10672 b, _ := ioutil.ReadAll(res.Body) 10673 res.Body.Close() 10674 errRes := &ErrorResponse{Response: res} 10675 err := jsonx.Unmarshal(b, errRes) 10676 if err != nil { 10677 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 10678 } 10679 return nil, errRes 10680 } 10681 var ( 10682 paging Paging 10683 value []DeviceManagementTemplate 10684 ) 10685 err := jsonx.NewDecoder(res.Body).Decode(&paging) 10686 res.Body.Close() 10687 if err != nil { 10688 return nil, err 10689 } 10690 err = jsonx.Unmarshal(paging.Value, &value) 10691 if err != nil { 10692 return nil, err 10693 } 10694 values = append(values, value...) 10695 if n >= 0 { 10696 n-- 10697 } 10698 if n == 0 || len(paging.NextLink) == 0 { 10699 return values, nil 10700 } 10701 req, err = http.NewRequest("GET", paging.NextLink, nil) 10702 if ctx != nil { 10703 req = req.WithContext(ctx) 10704 } 10705 res, err = r.client.Do(req) 10706 if err != nil { 10707 return nil, err 10708 } 10709 } 10710 } 10711 10712 // GetN performs GET request for DeviceManagementTemplate collection, max N pages 10713 func (r *DeviceManagementTemplatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementTemplate, error) { 10714 var query string 10715 if r.query != nil { 10716 query = "?" + r.query.Encode() 10717 } 10718 return r.Paging(ctx, "GET", query, nil, n) 10719 } 10720 10721 // Get performs GET request for DeviceManagementTemplate collection 10722 func (r *DeviceManagementTemplatesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementTemplate, error) { 10723 return r.GetN(ctx, 0) 10724 } 10725 10726 // Add performs POST request for DeviceManagementTemplate collection 10727 func (r *DeviceManagementTemplatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementTemplate) (resObj *DeviceManagementTemplate, err error) { 10728 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 10729 return 10730 } 10731 10732 // TermsAndConditions returns request builder for TermsAndConditions collection 10733 func (b *DeviceManagementRequestBuilder) TermsAndConditions() *DeviceManagementTermsAndConditionsCollectionRequestBuilder { 10734 bb := &DeviceManagementTermsAndConditionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10735 bb.baseURL += "/termsAndConditions" 10736 return bb 10737 } 10738 10739 // DeviceManagementTermsAndConditionsCollectionRequestBuilder is request builder for TermsAndConditions collection 10740 type DeviceManagementTermsAndConditionsCollectionRequestBuilder struct{ BaseRequestBuilder } 10741 10742 // Request returns request for TermsAndConditions collection 10743 func (b *DeviceManagementTermsAndConditionsCollectionRequestBuilder) Request() *DeviceManagementTermsAndConditionsCollectionRequest { 10744 return &DeviceManagementTermsAndConditionsCollectionRequest{ 10745 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 10746 } 10747 } 10748 10749 // ID returns request builder for TermsAndConditions item 10750 func (b *DeviceManagementTermsAndConditionsCollectionRequestBuilder) ID(id string) *TermsAndConditionsRequestBuilder { 10751 bb := &TermsAndConditionsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10752 bb.baseURL += "/" + id 10753 return bb 10754 } 10755 10756 // DeviceManagementTermsAndConditionsCollectionRequest is request for TermsAndConditions collection 10757 type DeviceManagementTermsAndConditionsCollectionRequest struct{ BaseRequest } 10758 10759 // Paging perfoms paging operation for TermsAndConditions collection 10760 func (r *DeviceManagementTermsAndConditionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]TermsAndConditions, error) { 10761 req, err := r.NewJSONRequest(method, path, obj) 10762 if err != nil { 10763 return nil, err 10764 } 10765 if ctx != nil { 10766 req = req.WithContext(ctx) 10767 } 10768 res, err := r.client.Do(req) 10769 if err != nil { 10770 return nil, err 10771 } 10772 var values []TermsAndConditions 10773 for { 10774 if res.StatusCode != http.StatusOK { 10775 b, _ := ioutil.ReadAll(res.Body) 10776 res.Body.Close() 10777 errRes := &ErrorResponse{Response: res} 10778 err := jsonx.Unmarshal(b, errRes) 10779 if err != nil { 10780 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 10781 } 10782 return nil, errRes 10783 } 10784 var ( 10785 paging Paging 10786 value []TermsAndConditions 10787 ) 10788 err := jsonx.NewDecoder(res.Body).Decode(&paging) 10789 res.Body.Close() 10790 if err != nil { 10791 return nil, err 10792 } 10793 err = jsonx.Unmarshal(paging.Value, &value) 10794 if err != nil { 10795 return nil, err 10796 } 10797 values = append(values, value...) 10798 if n >= 0 { 10799 n-- 10800 } 10801 if n == 0 || len(paging.NextLink) == 0 { 10802 return values, nil 10803 } 10804 req, err = http.NewRequest("GET", paging.NextLink, nil) 10805 if ctx != nil { 10806 req = req.WithContext(ctx) 10807 } 10808 res, err = r.client.Do(req) 10809 if err != nil { 10810 return nil, err 10811 } 10812 } 10813 } 10814 10815 // GetN performs GET request for TermsAndConditions collection, max N pages 10816 func (r *DeviceManagementTermsAndConditionsCollectionRequest) GetN(ctx context.Context, n int) ([]TermsAndConditions, error) { 10817 var query string 10818 if r.query != nil { 10819 query = "?" + r.query.Encode() 10820 } 10821 return r.Paging(ctx, "GET", query, nil, n) 10822 } 10823 10824 // Get performs GET request for TermsAndConditions collection 10825 func (r *DeviceManagementTermsAndConditionsCollectionRequest) Get(ctx context.Context) ([]TermsAndConditions, error) { 10826 return r.GetN(ctx, 0) 10827 } 10828 10829 // Add performs POST request for TermsAndConditions collection 10830 func (r *DeviceManagementTermsAndConditionsCollectionRequest) Add(ctx context.Context, reqObj *TermsAndConditions) (resObj *TermsAndConditions, err error) { 10831 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 10832 return 10833 } 10834 10835 // TroubleshootingEvents returns request builder for DeviceManagementTroubleshootingEvent collection 10836 func (b *DeviceManagementRequestBuilder) TroubleshootingEvents() *DeviceManagementTroubleshootingEventsCollectionRequestBuilder { 10837 bb := &DeviceManagementTroubleshootingEventsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10838 bb.baseURL += "/troubleshootingEvents" 10839 return bb 10840 } 10841 10842 // DeviceManagementTroubleshootingEventsCollectionRequestBuilder is request builder for DeviceManagementTroubleshootingEvent collection 10843 type DeviceManagementTroubleshootingEventsCollectionRequestBuilder struct{ BaseRequestBuilder } 10844 10845 // Request returns request for DeviceManagementTroubleshootingEvent collection 10846 func (b *DeviceManagementTroubleshootingEventsCollectionRequestBuilder) Request() *DeviceManagementTroubleshootingEventsCollectionRequest { 10847 return &DeviceManagementTroubleshootingEventsCollectionRequest{ 10848 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 10849 } 10850 } 10851 10852 // ID returns request builder for DeviceManagementTroubleshootingEvent item 10853 func (b *DeviceManagementTroubleshootingEventsCollectionRequestBuilder) ID(id string) *DeviceManagementTroubleshootingEventRequestBuilder { 10854 bb := &DeviceManagementTroubleshootingEventRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10855 bb.baseURL += "/" + id 10856 return bb 10857 } 10858 10859 // DeviceManagementTroubleshootingEventsCollectionRequest is request for DeviceManagementTroubleshootingEvent collection 10860 type DeviceManagementTroubleshootingEventsCollectionRequest struct{ BaseRequest } 10861 10862 // Paging perfoms paging operation for DeviceManagementTroubleshootingEvent collection 10863 func (r *DeviceManagementTroubleshootingEventsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementTroubleshootingEvent, error) { 10864 req, err := r.NewJSONRequest(method, path, obj) 10865 if err != nil { 10866 return nil, err 10867 } 10868 if ctx != nil { 10869 req = req.WithContext(ctx) 10870 } 10871 res, err := r.client.Do(req) 10872 if err != nil { 10873 return nil, err 10874 } 10875 var values []DeviceManagementTroubleshootingEvent 10876 for { 10877 if res.StatusCode != http.StatusOK { 10878 b, _ := ioutil.ReadAll(res.Body) 10879 res.Body.Close() 10880 errRes := &ErrorResponse{Response: res} 10881 err := jsonx.Unmarshal(b, errRes) 10882 if err != nil { 10883 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 10884 } 10885 return nil, errRes 10886 } 10887 var ( 10888 paging Paging 10889 value []DeviceManagementTroubleshootingEvent 10890 ) 10891 err := jsonx.NewDecoder(res.Body).Decode(&paging) 10892 res.Body.Close() 10893 if err != nil { 10894 return nil, err 10895 } 10896 err = jsonx.Unmarshal(paging.Value, &value) 10897 if err != nil { 10898 return nil, err 10899 } 10900 values = append(values, value...) 10901 if n >= 0 { 10902 n-- 10903 } 10904 if n == 0 || len(paging.NextLink) == 0 { 10905 return values, nil 10906 } 10907 req, err = http.NewRequest("GET", paging.NextLink, nil) 10908 if ctx != nil { 10909 req = req.WithContext(ctx) 10910 } 10911 res, err = r.client.Do(req) 10912 if err != nil { 10913 return nil, err 10914 } 10915 } 10916 } 10917 10918 // GetN performs GET request for DeviceManagementTroubleshootingEvent collection, max N pages 10919 func (r *DeviceManagementTroubleshootingEventsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementTroubleshootingEvent, error) { 10920 var query string 10921 if r.query != nil { 10922 query = "?" + r.query.Encode() 10923 } 10924 return r.Paging(ctx, "GET", query, nil, n) 10925 } 10926 10927 // Get performs GET request for DeviceManagementTroubleshootingEvent collection 10928 func (r *DeviceManagementTroubleshootingEventsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementTroubleshootingEvent, error) { 10929 return r.GetN(ctx, 0) 10930 } 10931 10932 // Add performs POST request for DeviceManagementTroubleshootingEvent collection 10933 func (r *DeviceManagementTroubleshootingEventsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementTroubleshootingEvent) (resObj *DeviceManagementTroubleshootingEvent, err error) { 10934 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 10935 return 10936 } 10937 10938 // UserExperienceAnalyticsBaselines returns request builder for UserExperienceAnalyticsBaseline collection 10939 func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsBaselines() *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder { 10940 bb := &DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10941 bb.baseURL += "/userExperienceAnalyticsBaselines" 10942 return bb 10943 } 10944 10945 // DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder is request builder for UserExperienceAnalyticsBaseline collection 10946 type DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder struct{ BaseRequestBuilder } 10947 10948 // Request returns request for UserExperienceAnalyticsBaseline collection 10949 func (b *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder) Request() *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest { 10950 return &DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest{ 10951 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 10952 } 10953 } 10954 10955 // ID returns request builder for UserExperienceAnalyticsBaseline item 10956 func (b *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder) ID(id string) *UserExperienceAnalyticsBaselineRequestBuilder { 10957 bb := &UserExperienceAnalyticsBaselineRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 10958 bb.baseURL += "/" + id 10959 return bb 10960 } 10961 10962 // DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest is request for UserExperienceAnalyticsBaseline collection 10963 type DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest struct{ BaseRequest } 10964 10965 // Paging perfoms paging operation for UserExperienceAnalyticsBaseline collection 10966 func (r *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]UserExperienceAnalyticsBaseline, error) { 10967 req, err := r.NewJSONRequest(method, path, obj) 10968 if err != nil { 10969 return nil, err 10970 } 10971 if ctx != nil { 10972 req = req.WithContext(ctx) 10973 } 10974 res, err := r.client.Do(req) 10975 if err != nil { 10976 return nil, err 10977 } 10978 var values []UserExperienceAnalyticsBaseline 10979 for { 10980 if res.StatusCode != http.StatusOK { 10981 b, _ := ioutil.ReadAll(res.Body) 10982 res.Body.Close() 10983 errRes := &ErrorResponse{Response: res} 10984 err := jsonx.Unmarshal(b, errRes) 10985 if err != nil { 10986 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 10987 } 10988 return nil, errRes 10989 } 10990 var ( 10991 paging Paging 10992 value []UserExperienceAnalyticsBaseline 10993 ) 10994 err := jsonx.NewDecoder(res.Body).Decode(&paging) 10995 res.Body.Close() 10996 if err != nil { 10997 return nil, err 10998 } 10999 err = jsonx.Unmarshal(paging.Value, &value) 11000 if err != nil { 11001 return nil, err 11002 } 11003 values = append(values, value...) 11004 if n >= 0 { 11005 n-- 11006 } 11007 if n == 0 || len(paging.NextLink) == 0 { 11008 return values, nil 11009 } 11010 req, err = http.NewRequest("GET", paging.NextLink, nil) 11011 if ctx != nil { 11012 req = req.WithContext(ctx) 11013 } 11014 res, err = r.client.Do(req) 11015 if err != nil { 11016 return nil, err 11017 } 11018 } 11019 } 11020 11021 // GetN performs GET request for UserExperienceAnalyticsBaseline collection, max N pages 11022 func (r *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest) GetN(ctx context.Context, n int) ([]UserExperienceAnalyticsBaseline, error) { 11023 var query string 11024 if r.query != nil { 11025 query = "?" + r.query.Encode() 11026 } 11027 return r.Paging(ctx, "GET", query, nil, n) 11028 } 11029 11030 // Get performs GET request for UserExperienceAnalyticsBaseline collection 11031 func (r *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest) Get(ctx context.Context) ([]UserExperienceAnalyticsBaseline, error) { 11032 return r.GetN(ctx, 0) 11033 } 11034 11035 // Add performs POST request for UserExperienceAnalyticsBaseline collection 11036 func (r *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest) Add(ctx context.Context, reqObj *UserExperienceAnalyticsBaseline) (resObj *UserExperienceAnalyticsBaseline, err error) { 11037 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 11038 return 11039 } 11040 11041 // UserExperienceAnalyticsCategories returns request builder for UserExperienceAnalyticsCategory collection 11042 func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsCategories() *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder { 11043 bb := &DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11044 bb.baseURL += "/userExperienceAnalyticsCategories" 11045 return bb 11046 } 11047 11048 // DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder is request builder for UserExperienceAnalyticsCategory collection 11049 type DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder } 11050 11051 // Request returns request for UserExperienceAnalyticsCategory collection 11052 func (b *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder) Request() *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest { 11053 return &DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest{ 11054 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 11055 } 11056 } 11057 11058 // ID returns request builder for UserExperienceAnalyticsCategory item 11059 func (b *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder) ID(id string) *UserExperienceAnalyticsCategoryRequestBuilder { 11060 bb := &UserExperienceAnalyticsCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11061 bb.baseURL += "/" + id 11062 return bb 11063 } 11064 11065 // DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest is request for UserExperienceAnalyticsCategory collection 11066 type DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest struct{ BaseRequest } 11067 11068 // Paging perfoms paging operation for UserExperienceAnalyticsCategory collection 11069 func (r *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]UserExperienceAnalyticsCategory, error) { 11070 req, err := r.NewJSONRequest(method, path, obj) 11071 if err != nil { 11072 return nil, err 11073 } 11074 if ctx != nil { 11075 req = req.WithContext(ctx) 11076 } 11077 res, err := r.client.Do(req) 11078 if err != nil { 11079 return nil, err 11080 } 11081 var values []UserExperienceAnalyticsCategory 11082 for { 11083 if res.StatusCode != http.StatusOK { 11084 b, _ := ioutil.ReadAll(res.Body) 11085 res.Body.Close() 11086 errRes := &ErrorResponse{Response: res} 11087 err := jsonx.Unmarshal(b, errRes) 11088 if err != nil { 11089 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 11090 } 11091 return nil, errRes 11092 } 11093 var ( 11094 paging Paging 11095 value []UserExperienceAnalyticsCategory 11096 ) 11097 err := jsonx.NewDecoder(res.Body).Decode(&paging) 11098 res.Body.Close() 11099 if err != nil { 11100 return nil, err 11101 } 11102 err = jsonx.Unmarshal(paging.Value, &value) 11103 if err != nil { 11104 return nil, err 11105 } 11106 values = append(values, value...) 11107 if n >= 0 { 11108 n-- 11109 } 11110 if n == 0 || len(paging.NextLink) == 0 { 11111 return values, nil 11112 } 11113 req, err = http.NewRequest("GET", paging.NextLink, nil) 11114 if ctx != nil { 11115 req = req.WithContext(ctx) 11116 } 11117 res, err = r.client.Do(req) 11118 if err != nil { 11119 return nil, err 11120 } 11121 } 11122 } 11123 11124 // GetN performs GET request for UserExperienceAnalyticsCategory collection, max N pages 11125 func (r *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest) GetN(ctx context.Context, n int) ([]UserExperienceAnalyticsCategory, error) { 11126 var query string 11127 if r.query != nil { 11128 query = "?" + r.query.Encode() 11129 } 11130 return r.Paging(ctx, "GET", query, nil, n) 11131 } 11132 11133 // Get performs GET request for UserExperienceAnalyticsCategory collection 11134 func (r *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest) Get(ctx context.Context) ([]UserExperienceAnalyticsCategory, error) { 11135 return r.GetN(ctx, 0) 11136 } 11137 11138 // Add performs POST request for UserExperienceAnalyticsCategory collection 11139 func (r *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest) Add(ctx context.Context, reqObj *UserExperienceAnalyticsCategory) (resObj *UserExperienceAnalyticsCategory, err error) { 11140 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 11141 return 11142 } 11143 11144 // UserExperienceAnalyticsDevicePerformance returns request builder for UserExperienceAnalyticsDevicePerformance collection 11145 func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsDevicePerformance() *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder { 11146 bb := &DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11147 bb.baseURL += "/userExperienceAnalyticsDevicePerformance" 11148 return bb 11149 } 11150 11151 // DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder is request builder for UserExperienceAnalyticsDevicePerformance collection 11152 type DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder struct{ BaseRequestBuilder } 11153 11154 // Request returns request for UserExperienceAnalyticsDevicePerformance collection 11155 func (b *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder) Request() *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest { 11156 return &DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest{ 11157 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 11158 } 11159 } 11160 11161 // ID returns request builder for UserExperienceAnalyticsDevicePerformance item 11162 func (b *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder) ID(id string) *UserExperienceAnalyticsDevicePerformanceRequestBuilder { 11163 bb := &UserExperienceAnalyticsDevicePerformanceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11164 bb.baseURL += "/" + id 11165 return bb 11166 } 11167 11168 // DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest is request for UserExperienceAnalyticsDevicePerformance collection 11169 type DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest struct{ BaseRequest } 11170 11171 // Paging perfoms paging operation for UserExperienceAnalyticsDevicePerformance collection 11172 func (r *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]UserExperienceAnalyticsDevicePerformance, error) { 11173 req, err := r.NewJSONRequest(method, path, obj) 11174 if err != nil { 11175 return nil, err 11176 } 11177 if ctx != nil { 11178 req = req.WithContext(ctx) 11179 } 11180 res, err := r.client.Do(req) 11181 if err != nil { 11182 return nil, err 11183 } 11184 var values []UserExperienceAnalyticsDevicePerformance 11185 for { 11186 if res.StatusCode != http.StatusOK { 11187 b, _ := ioutil.ReadAll(res.Body) 11188 res.Body.Close() 11189 errRes := &ErrorResponse{Response: res} 11190 err := jsonx.Unmarshal(b, errRes) 11191 if err != nil { 11192 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 11193 } 11194 return nil, errRes 11195 } 11196 var ( 11197 paging Paging 11198 value []UserExperienceAnalyticsDevicePerformance 11199 ) 11200 err := jsonx.NewDecoder(res.Body).Decode(&paging) 11201 res.Body.Close() 11202 if err != nil { 11203 return nil, err 11204 } 11205 err = jsonx.Unmarshal(paging.Value, &value) 11206 if err != nil { 11207 return nil, err 11208 } 11209 values = append(values, value...) 11210 if n >= 0 { 11211 n-- 11212 } 11213 if n == 0 || len(paging.NextLink) == 0 { 11214 return values, nil 11215 } 11216 req, err = http.NewRequest("GET", paging.NextLink, nil) 11217 if ctx != nil { 11218 req = req.WithContext(ctx) 11219 } 11220 res, err = r.client.Do(req) 11221 if err != nil { 11222 return nil, err 11223 } 11224 } 11225 } 11226 11227 // GetN performs GET request for UserExperienceAnalyticsDevicePerformance collection, max N pages 11228 func (r *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest) GetN(ctx context.Context, n int) ([]UserExperienceAnalyticsDevicePerformance, error) { 11229 var query string 11230 if r.query != nil { 11231 query = "?" + r.query.Encode() 11232 } 11233 return r.Paging(ctx, "GET", query, nil, n) 11234 } 11235 11236 // Get performs GET request for UserExperienceAnalyticsDevicePerformance collection 11237 func (r *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest) Get(ctx context.Context) ([]UserExperienceAnalyticsDevicePerformance, error) { 11238 return r.GetN(ctx, 0) 11239 } 11240 11241 // Add performs POST request for UserExperienceAnalyticsDevicePerformance collection 11242 func (r *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest) Add(ctx context.Context, reqObj *UserExperienceAnalyticsDevicePerformance) (resObj *UserExperienceAnalyticsDevicePerformance, err error) { 11243 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 11244 return 11245 } 11246 11247 // UserExperienceAnalyticsDeviceStartupHistory returns request builder for UserExperienceAnalyticsDeviceStartupHistory collection 11248 func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsDeviceStartupHistory() *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder { 11249 bb := &DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11250 bb.baseURL += "/userExperienceAnalyticsDeviceStartupHistory" 11251 return bb 11252 } 11253 11254 // DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder is request builder for UserExperienceAnalyticsDeviceStartupHistory collection 11255 type DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder struct{ BaseRequestBuilder } 11256 11257 // Request returns request for UserExperienceAnalyticsDeviceStartupHistory collection 11258 func (b *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder) Request() *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest { 11259 return &DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest{ 11260 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 11261 } 11262 } 11263 11264 // ID returns request builder for UserExperienceAnalyticsDeviceStartupHistory item 11265 func (b *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder) ID(id string) *UserExperienceAnalyticsDeviceStartupHistoryRequestBuilder { 11266 bb := &UserExperienceAnalyticsDeviceStartupHistoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11267 bb.baseURL += "/" + id 11268 return bb 11269 } 11270 11271 // DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest is request for UserExperienceAnalyticsDeviceStartupHistory collection 11272 type DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest struct{ BaseRequest } 11273 11274 // Paging perfoms paging operation for UserExperienceAnalyticsDeviceStartupHistory collection 11275 func (r *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]UserExperienceAnalyticsDeviceStartupHistory, error) { 11276 req, err := r.NewJSONRequest(method, path, obj) 11277 if err != nil { 11278 return nil, err 11279 } 11280 if ctx != nil { 11281 req = req.WithContext(ctx) 11282 } 11283 res, err := r.client.Do(req) 11284 if err != nil { 11285 return nil, err 11286 } 11287 var values []UserExperienceAnalyticsDeviceStartupHistory 11288 for { 11289 if res.StatusCode != http.StatusOK { 11290 b, _ := ioutil.ReadAll(res.Body) 11291 res.Body.Close() 11292 errRes := &ErrorResponse{Response: res} 11293 err := jsonx.Unmarshal(b, errRes) 11294 if err != nil { 11295 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 11296 } 11297 return nil, errRes 11298 } 11299 var ( 11300 paging Paging 11301 value []UserExperienceAnalyticsDeviceStartupHistory 11302 ) 11303 err := jsonx.NewDecoder(res.Body).Decode(&paging) 11304 res.Body.Close() 11305 if err != nil { 11306 return nil, err 11307 } 11308 err = jsonx.Unmarshal(paging.Value, &value) 11309 if err != nil { 11310 return nil, err 11311 } 11312 values = append(values, value...) 11313 if n >= 0 { 11314 n-- 11315 } 11316 if n == 0 || len(paging.NextLink) == 0 { 11317 return values, nil 11318 } 11319 req, err = http.NewRequest("GET", paging.NextLink, nil) 11320 if ctx != nil { 11321 req = req.WithContext(ctx) 11322 } 11323 res, err = r.client.Do(req) 11324 if err != nil { 11325 return nil, err 11326 } 11327 } 11328 } 11329 11330 // GetN performs GET request for UserExperienceAnalyticsDeviceStartupHistory collection, max N pages 11331 func (r *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest) GetN(ctx context.Context, n int) ([]UserExperienceAnalyticsDeviceStartupHistory, error) { 11332 var query string 11333 if r.query != nil { 11334 query = "?" + r.query.Encode() 11335 } 11336 return r.Paging(ctx, "GET", query, nil, n) 11337 } 11338 11339 // Get performs GET request for UserExperienceAnalyticsDeviceStartupHistory collection 11340 func (r *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest) Get(ctx context.Context) ([]UserExperienceAnalyticsDeviceStartupHistory, error) { 11341 return r.GetN(ctx, 0) 11342 } 11343 11344 // Add performs POST request for UserExperienceAnalyticsDeviceStartupHistory collection 11345 func (r *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest) Add(ctx context.Context, reqObj *UserExperienceAnalyticsDeviceStartupHistory) (resObj *UserExperienceAnalyticsDeviceStartupHistory, err error) { 11346 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 11347 return 11348 } 11349 11350 // UserExperienceAnalyticsOverview is navigation property 11351 func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsOverview() *UserExperienceAnalyticsOverviewRequestBuilder { 11352 bb := &UserExperienceAnalyticsOverviewRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11353 bb.baseURL += "/userExperienceAnalyticsOverview" 11354 return bb 11355 } 11356 11357 // UserExperienceAnalyticsRegressionSummary is navigation property 11358 func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsRegressionSummary() *UserExperienceAnalyticsRegressionSummaryRequestBuilder { 11359 bb := &UserExperienceAnalyticsRegressionSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11360 bb.baseURL += "/userExperienceAnalyticsRegressionSummary" 11361 return bb 11362 } 11363 11364 // UserPfxCertificates returns request builder for UserPFXCertificate collection 11365 func (b *DeviceManagementRequestBuilder) UserPfxCertificates() *DeviceManagementUserPfxCertificatesCollectionRequestBuilder { 11366 bb := &DeviceManagementUserPfxCertificatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11367 bb.baseURL += "/userPfxCertificates" 11368 return bb 11369 } 11370 11371 // DeviceManagementUserPfxCertificatesCollectionRequestBuilder is request builder for UserPFXCertificate collection 11372 type DeviceManagementUserPfxCertificatesCollectionRequestBuilder struct{ BaseRequestBuilder } 11373 11374 // Request returns request for UserPFXCertificate collection 11375 func (b *DeviceManagementUserPfxCertificatesCollectionRequestBuilder) Request() *DeviceManagementUserPfxCertificatesCollectionRequest { 11376 return &DeviceManagementUserPfxCertificatesCollectionRequest{ 11377 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 11378 } 11379 } 11380 11381 // ID returns request builder for UserPFXCertificate item 11382 func (b *DeviceManagementUserPfxCertificatesCollectionRequestBuilder) ID(id string) *UserPFXCertificateRequestBuilder { 11383 bb := &UserPFXCertificateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11384 bb.baseURL += "/" + id 11385 return bb 11386 } 11387 11388 // DeviceManagementUserPfxCertificatesCollectionRequest is request for UserPFXCertificate collection 11389 type DeviceManagementUserPfxCertificatesCollectionRequest struct{ BaseRequest } 11390 11391 // Paging perfoms paging operation for UserPFXCertificate collection 11392 func (r *DeviceManagementUserPfxCertificatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]UserPFXCertificate, error) { 11393 req, err := r.NewJSONRequest(method, path, obj) 11394 if err != nil { 11395 return nil, err 11396 } 11397 if ctx != nil { 11398 req = req.WithContext(ctx) 11399 } 11400 res, err := r.client.Do(req) 11401 if err != nil { 11402 return nil, err 11403 } 11404 var values []UserPFXCertificate 11405 for { 11406 if res.StatusCode != http.StatusOK { 11407 b, _ := ioutil.ReadAll(res.Body) 11408 res.Body.Close() 11409 errRes := &ErrorResponse{Response: res} 11410 err := jsonx.Unmarshal(b, errRes) 11411 if err != nil { 11412 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 11413 } 11414 return nil, errRes 11415 } 11416 var ( 11417 paging Paging 11418 value []UserPFXCertificate 11419 ) 11420 err := jsonx.NewDecoder(res.Body).Decode(&paging) 11421 res.Body.Close() 11422 if err != nil { 11423 return nil, err 11424 } 11425 err = jsonx.Unmarshal(paging.Value, &value) 11426 if err != nil { 11427 return nil, err 11428 } 11429 values = append(values, value...) 11430 if n >= 0 { 11431 n-- 11432 } 11433 if n == 0 || len(paging.NextLink) == 0 { 11434 return values, nil 11435 } 11436 req, err = http.NewRequest("GET", paging.NextLink, nil) 11437 if ctx != nil { 11438 req = req.WithContext(ctx) 11439 } 11440 res, err = r.client.Do(req) 11441 if err != nil { 11442 return nil, err 11443 } 11444 } 11445 } 11446 11447 // GetN performs GET request for UserPFXCertificate collection, max N pages 11448 func (r *DeviceManagementUserPfxCertificatesCollectionRequest) GetN(ctx context.Context, n int) ([]UserPFXCertificate, error) { 11449 var query string 11450 if r.query != nil { 11451 query = "?" + r.query.Encode() 11452 } 11453 return r.Paging(ctx, "GET", query, nil, n) 11454 } 11455 11456 // Get performs GET request for UserPFXCertificate collection 11457 func (r *DeviceManagementUserPfxCertificatesCollectionRequest) Get(ctx context.Context) ([]UserPFXCertificate, error) { 11458 return r.GetN(ctx, 0) 11459 } 11460 11461 // Add performs POST request for UserPFXCertificate collection 11462 func (r *DeviceManagementUserPfxCertificatesCollectionRequest) Add(ctx context.Context, reqObj *UserPFXCertificate) (resObj *UserPFXCertificate, err error) { 11463 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 11464 return 11465 } 11466 11467 // WindowsAutopilotDeploymentProfiles returns request builder for WindowsAutopilotDeploymentProfile collection 11468 func (b *DeviceManagementRequestBuilder) WindowsAutopilotDeploymentProfiles() *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder { 11469 bb := &DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11470 bb.baseURL += "/windowsAutopilotDeploymentProfiles" 11471 return bb 11472 } 11473 11474 // DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder is request builder for WindowsAutopilotDeploymentProfile collection 11475 type DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } 11476 11477 // Request returns request for WindowsAutopilotDeploymentProfile collection 11478 func (b *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder) Request() *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest { 11479 return &DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest{ 11480 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 11481 } 11482 } 11483 11484 // ID returns request builder for WindowsAutopilotDeploymentProfile item 11485 func (b *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder) ID(id string) *WindowsAutopilotDeploymentProfileRequestBuilder { 11486 bb := &WindowsAutopilotDeploymentProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11487 bb.baseURL += "/" + id 11488 return bb 11489 } 11490 11491 // DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest is request for WindowsAutopilotDeploymentProfile collection 11492 type DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest struct{ BaseRequest } 11493 11494 // Paging perfoms paging operation for WindowsAutopilotDeploymentProfile collection 11495 func (r *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]WindowsAutopilotDeploymentProfile, error) { 11496 req, err := r.NewJSONRequest(method, path, obj) 11497 if err != nil { 11498 return nil, err 11499 } 11500 if ctx != nil { 11501 req = req.WithContext(ctx) 11502 } 11503 res, err := r.client.Do(req) 11504 if err != nil { 11505 return nil, err 11506 } 11507 var values []WindowsAutopilotDeploymentProfile 11508 for { 11509 if res.StatusCode != http.StatusOK { 11510 b, _ := ioutil.ReadAll(res.Body) 11511 res.Body.Close() 11512 errRes := &ErrorResponse{Response: res} 11513 err := jsonx.Unmarshal(b, errRes) 11514 if err != nil { 11515 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 11516 } 11517 return nil, errRes 11518 } 11519 var ( 11520 paging Paging 11521 value []WindowsAutopilotDeploymentProfile 11522 ) 11523 err := jsonx.NewDecoder(res.Body).Decode(&paging) 11524 res.Body.Close() 11525 if err != nil { 11526 return nil, err 11527 } 11528 err = jsonx.Unmarshal(paging.Value, &value) 11529 if err != nil { 11530 return nil, err 11531 } 11532 values = append(values, value...) 11533 if n >= 0 { 11534 n-- 11535 } 11536 if n == 0 || len(paging.NextLink) == 0 { 11537 return values, nil 11538 } 11539 req, err = http.NewRequest("GET", paging.NextLink, nil) 11540 if ctx != nil { 11541 req = req.WithContext(ctx) 11542 } 11543 res, err = r.client.Do(req) 11544 if err != nil { 11545 return nil, err 11546 } 11547 } 11548 } 11549 11550 // GetN performs GET request for WindowsAutopilotDeploymentProfile collection, max N pages 11551 func (r *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]WindowsAutopilotDeploymentProfile, error) { 11552 var query string 11553 if r.query != nil { 11554 query = "?" + r.query.Encode() 11555 } 11556 return r.Paging(ctx, "GET", query, nil, n) 11557 } 11558 11559 // Get performs GET request for WindowsAutopilotDeploymentProfile collection 11560 func (r *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest) Get(ctx context.Context) ([]WindowsAutopilotDeploymentProfile, error) { 11561 return r.GetN(ctx, 0) 11562 } 11563 11564 // Add performs POST request for WindowsAutopilotDeploymentProfile collection 11565 func (r *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest) Add(ctx context.Context, reqObj *WindowsAutopilotDeploymentProfile) (resObj *WindowsAutopilotDeploymentProfile, err error) { 11566 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 11567 return 11568 } 11569 11570 // WindowsAutopilotDeviceIdentities returns request builder for WindowsAutopilotDeviceIdentity collection 11571 func (b *DeviceManagementRequestBuilder) WindowsAutopilotDeviceIdentities() *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder { 11572 bb := &DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11573 bb.baseURL += "/windowsAutopilotDeviceIdentities" 11574 return bb 11575 } 11576 11577 // DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder is request builder for WindowsAutopilotDeviceIdentity collection 11578 type DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder struct{ BaseRequestBuilder } 11579 11580 // Request returns request for WindowsAutopilotDeviceIdentity collection 11581 func (b *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder) Request() *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest { 11582 return &DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest{ 11583 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 11584 } 11585 } 11586 11587 // ID returns request builder for WindowsAutopilotDeviceIdentity item 11588 func (b *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder) ID(id string) *WindowsAutopilotDeviceIdentityRequestBuilder { 11589 bb := &WindowsAutopilotDeviceIdentityRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11590 bb.baseURL += "/" + id 11591 return bb 11592 } 11593 11594 // DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest is request for WindowsAutopilotDeviceIdentity collection 11595 type DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest struct{ BaseRequest } 11596 11597 // Paging perfoms paging operation for WindowsAutopilotDeviceIdentity collection 11598 func (r *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]WindowsAutopilotDeviceIdentity, error) { 11599 req, err := r.NewJSONRequest(method, path, obj) 11600 if err != nil { 11601 return nil, err 11602 } 11603 if ctx != nil { 11604 req = req.WithContext(ctx) 11605 } 11606 res, err := r.client.Do(req) 11607 if err != nil { 11608 return nil, err 11609 } 11610 var values []WindowsAutopilotDeviceIdentity 11611 for { 11612 if res.StatusCode != http.StatusOK { 11613 b, _ := ioutil.ReadAll(res.Body) 11614 res.Body.Close() 11615 errRes := &ErrorResponse{Response: res} 11616 err := jsonx.Unmarshal(b, errRes) 11617 if err != nil { 11618 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 11619 } 11620 return nil, errRes 11621 } 11622 var ( 11623 paging Paging 11624 value []WindowsAutopilotDeviceIdentity 11625 ) 11626 err := jsonx.NewDecoder(res.Body).Decode(&paging) 11627 res.Body.Close() 11628 if err != nil { 11629 return nil, err 11630 } 11631 err = jsonx.Unmarshal(paging.Value, &value) 11632 if err != nil { 11633 return nil, err 11634 } 11635 values = append(values, value...) 11636 if n >= 0 { 11637 n-- 11638 } 11639 if n == 0 || len(paging.NextLink) == 0 { 11640 return values, nil 11641 } 11642 req, err = http.NewRequest("GET", paging.NextLink, nil) 11643 if ctx != nil { 11644 req = req.WithContext(ctx) 11645 } 11646 res, err = r.client.Do(req) 11647 if err != nil { 11648 return nil, err 11649 } 11650 } 11651 } 11652 11653 // GetN performs GET request for WindowsAutopilotDeviceIdentity collection, max N pages 11654 func (r *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest) GetN(ctx context.Context, n int) ([]WindowsAutopilotDeviceIdentity, error) { 11655 var query string 11656 if r.query != nil { 11657 query = "?" + r.query.Encode() 11658 } 11659 return r.Paging(ctx, "GET", query, nil, n) 11660 } 11661 11662 // Get performs GET request for WindowsAutopilotDeviceIdentity collection 11663 func (r *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest) Get(ctx context.Context) ([]WindowsAutopilotDeviceIdentity, error) { 11664 return r.GetN(ctx, 0) 11665 } 11666 11667 // Add performs POST request for WindowsAutopilotDeviceIdentity collection 11668 func (r *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest) Add(ctx context.Context, reqObj *WindowsAutopilotDeviceIdentity) (resObj *WindowsAutopilotDeviceIdentity, err error) { 11669 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 11670 return 11671 } 11672 11673 // WindowsAutopilotSettings is navigation property 11674 func (b *DeviceManagementRequestBuilder) WindowsAutopilotSettings() *WindowsAutopilotSettingsRequestBuilder { 11675 bb := &WindowsAutopilotSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11676 bb.baseURL += "/windowsAutopilotSettings" 11677 return bb 11678 } 11679 11680 // WindowsFeatureUpdateProfiles returns request builder for WindowsFeatureUpdateProfile collection 11681 func (b *DeviceManagementRequestBuilder) WindowsFeatureUpdateProfiles() *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder { 11682 bb := &DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11683 bb.baseURL += "/windowsFeatureUpdateProfiles" 11684 return bb 11685 } 11686 11687 // DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder is request builder for WindowsFeatureUpdateProfile collection 11688 type DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } 11689 11690 // Request returns request for WindowsFeatureUpdateProfile collection 11691 func (b *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder) Request() *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest { 11692 return &DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest{ 11693 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 11694 } 11695 } 11696 11697 // ID returns request builder for WindowsFeatureUpdateProfile item 11698 func (b *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder) ID(id string) *WindowsFeatureUpdateProfileRequestBuilder { 11699 bb := &WindowsFeatureUpdateProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11700 bb.baseURL += "/" + id 11701 return bb 11702 } 11703 11704 // DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest is request for WindowsFeatureUpdateProfile collection 11705 type DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest struct{ BaseRequest } 11706 11707 // Paging perfoms paging operation for WindowsFeatureUpdateProfile collection 11708 func (r *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]WindowsFeatureUpdateProfile, error) { 11709 req, err := r.NewJSONRequest(method, path, obj) 11710 if err != nil { 11711 return nil, err 11712 } 11713 if ctx != nil { 11714 req = req.WithContext(ctx) 11715 } 11716 res, err := r.client.Do(req) 11717 if err != nil { 11718 return nil, err 11719 } 11720 var values []WindowsFeatureUpdateProfile 11721 for { 11722 if res.StatusCode != http.StatusOK { 11723 b, _ := ioutil.ReadAll(res.Body) 11724 res.Body.Close() 11725 errRes := &ErrorResponse{Response: res} 11726 err := jsonx.Unmarshal(b, errRes) 11727 if err != nil { 11728 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 11729 } 11730 return nil, errRes 11731 } 11732 var ( 11733 paging Paging 11734 value []WindowsFeatureUpdateProfile 11735 ) 11736 err := jsonx.NewDecoder(res.Body).Decode(&paging) 11737 res.Body.Close() 11738 if err != nil { 11739 return nil, err 11740 } 11741 err = jsonx.Unmarshal(paging.Value, &value) 11742 if err != nil { 11743 return nil, err 11744 } 11745 values = append(values, value...) 11746 if n >= 0 { 11747 n-- 11748 } 11749 if n == 0 || len(paging.NextLink) == 0 { 11750 return values, nil 11751 } 11752 req, err = http.NewRequest("GET", paging.NextLink, nil) 11753 if ctx != nil { 11754 req = req.WithContext(ctx) 11755 } 11756 res, err = r.client.Do(req) 11757 if err != nil { 11758 return nil, err 11759 } 11760 } 11761 } 11762 11763 // GetN performs GET request for WindowsFeatureUpdateProfile collection, max N pages 11764 func (r *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]WindowsFeatureUpdateProfile, error) { 11765 var query string 11766 if r.query != nil { 11767 query = "?" + r.query.Encode() 11768 } 11769 return r.Paging(ctx, "GET", query, nil, n) 11770 } 11771 11772 // Get performs GET request for WindowsFeatureUpdateProfile collection 11773 func (r *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest) Get(ctx context.Context) ([]WindowsFeatureUpdateProfile, error) { 11774 return r.GetN(ctx, 0) 11775 } 11776 11777 // Add performs POST request for WindowsFeatureUpdateProfile collection 11778 func (r *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest) Add(ctx context.Context, reqObj *WindowsFeatureUpdateProfile) (resObj *WindowsFeatureUpdateProfile, err error) { 11779 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 11780 return 11781 } 11782 11783 // WindowsInformationProtectionAppLearningSummaries returns request builder for WindowsInformationProtectionAppLearningSummary collection 11784 func (b *DeviceManagementRequestBuilder) WindowsInformationProtectionAppLearningSummaries() *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder { 11785 bb := &DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11786 bb.baseURL += "/windowsInformationProtectionAppLearningSummaries" 11787 return bb 11788 } 11789 11790 // DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder is request builder for WindowsInformationProtectionAppLearningSummary collection 11791 type DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder struct{ BaseRequestBuilder } 11792 11793 // Request returns request for WindowsInformationProtectionAppLearningSummary collection 11794 func (b *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder) Request() *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest { 11795 return &DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest{ 11796 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 11797 } 11798 } 11799 11800 // ID returns request builder for WindowsInformationProtectionAppLearningSummary item 11801 func (b *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder) ID(id string) *WindowsInformationProtectionAppLearningSummaryRequestBuilder { 11802 bb := &WindowsInformationProtectionAppLearningSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11803 bb.baseURL += "/" + id 11804 return bb 11805 } 11806 11807 // DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest is request for WindowsInformationProtectionAppLearningSummary collection 11808 type DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest struct{ BaseRequest } 11809 11810 // Paging perfoms paging operation for WindowsInformationProtectionAppLearningSummary collection 11811 func (r *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]WindowsInformationProtectionAppLearningSummary, error) { 11812 req, err := r.NewJSONRequest(method, path, obj) 11813 if err != nil { 11814 return nil, err 11815 } 11816 if ctx != nil { 11817 req = req.WithContext(ctx) 11818 } 11819 res, err := r.client.Do(req) 11820 if err != nil { 11821 return nil, err 11822 } 11823 var values []WindowsInformationProtectionAppLearningSummary 11824 for { 11825 if res.StatusCode != http.StatusOK { 11826 b, _ := ioutil.ReadAll(res.Body) 11827 res.Body.Close() 11828 errRes := &ErrorResponse{Response: res} 11829 err := jsonx.Unmarshal(b, errRes) 11830 if err != nil { 11831 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 11832 } 11833 return nil, errRes 11834 } 11835 var ( 11836 paging Paging 11837 value []WindowsInformationProtectionAppLearningSummary 11838 ) 11839 err := jsonx.NewDecoder(res.Body).Decode(&paging) 11840 res.Body.Close() 11841 if err != nil { 11842 return nil, err 11843 } 11844 err = jsonx.Unmarshal(paging.Value, &value) 11845 if err != nil { 11846 return nil, err 11847 } 11848 values = append(values, value...) 11849 if n >= 0 { 11850 n-- 11851 } 11852 if n == 0 || len(paging.NextLink) == 0 { 11853 return values, nil 11854 } 11855 req, err = http.NewRequest("GET", paging.NextLink, nil) 11856 if ctx != nil { 11857 req = req.WithContext(ctx) 11858 } 11859 res, err = r.client.Do(req) 11860 if err != nil { 11861 return nil, err 11862 } 11863 } 11864 } 11865 11866 // GetN performs GET request for WindowsInformationProtectionAppLearningSummary collection, max N pages 11867 func (r *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest) GetN(ctx context.Context, n int) ([]WindowsInformationProtectionAppLearningSummary, error) { 11868 var query string 11869 if r.query != nil { 11870 query = "?" + r.query.Encode() 11871 } 11872 return r.Paging(ctx, "GET", query, nil, n) 11873 } 11874 11875 // Get performs GET request for WindowsInformationProtectionAppLearningSummary collection 11876 func (r *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest) Get(ctx context.Context) ([]WindowsInformationProtectionAppLearningSummary, error) { 11877 return r.GetN(ctx, 0) 11878 } 11879 11880 // Add performs POST request for WindowsInformationProtectionAppLearningSummary collection 11881 func (r *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest) Add(ctx context.Context, reqObj *WindowsInformationProtectionAppLearningSummary) (resObj *WindowsInformationProtectionAppLearningSummary, err error) { 11882 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 11883 return 11884 } 11885 11886 // WindowsInformationProtectionNetworkLearningSummaries returns request builder for WindowsInformationProtectionNetworkLearningSummary collection 11887 func (b *DeviceManagementRequestBuilder) WindowsInformationProtectionNetworkLearningSummaries() *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder { 11888 bb := &DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11889 bb.baseURL += "/windowsInformationProtectionNetworkLearningSummaries" 11890 return bb 11891 } 11892 11893 // DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder is request builder for WindowsInformationProtectionNetworkLearningSummary collection 11894 type DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder struct{ BaseRequestBuilder } 11895 11896 // Request returns request for WindowsInformationProtectionNetworkLearningSummary collection 11897 func (b *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder) Request() *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest { 11898 return &DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest{ 11899 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 11900 } 11901 } 11902 11903 // ID returns request builder for WindowsInformationProtectionNetworkLearningSummary item 11904 func (b *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder) ID(id string) *WindowsInformationProtectionNetworkLearningSummaryRequestBuilder { 11905 bb := &WindowsInformationProtectionNetworkLearningSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11906 bb.baseURL += "/" + id 11907 return bb 11908 } 11909 11910 // DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest is request for WindowsInformationProtectionNetworkLearningSummary collection 11911 type DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest struct{ BaseRequest } 11912 11913 // Paging perfoms paging operation for WindowsInformationProtectionNetworkLearningSummary collection 11914 func (r *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]WindowsInformationProtectionNetworkLearningSummary, error) { 11915 req, err := r.NewJSONRequest(method, path, obj) 11916 if err != nil { 11917 return nil, err 11918 } 11919 if ctx != nil { 11920 req = req.WithContext(ctx) 11921 } 11922 res, err := r.client.Do(req) 11923 if err != nil { 11924 return nil, err 11925 } 11926 var values []WindowsInformationProtectionNetworkLearningSummary 11927 for { 11928 if res.StatusCode != http.StatusOK { 11929 b, _ := ioutil.ReadAll(res.Body) 11930 res.Body.Close() 11931 errRes := &ErrorResponse{Response: res} 11932 err := jsonx.Unmarshal(b, errRes) 11933 if err != nil { 11934 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 11935 } 11936 return nil, errRes 11937 } 11938 var ( 11939 paging Paging 11940 value []WindowsInformationProtectionNetworkLearningSummary 11941 ) 11942 err := jsonx.NewDecoder(res.Body).Decode(&paging) 11943 res.Body.Close() 11944 if err != nil { 11945 return nil, err 11946 } 11947 err = jsonx.Unmarshal(paging.Value, &value) 11948 if err != nil { 11949 return nil, err 11950 } 11951 values = append(values, value...) 11952 if n >= 0 { 11953 n-- 11954 } 11955 if n == 0 || len(paging.NextLink) == 0 { 11956 return values, nil 11957 } 11958 req, err = http.NewRequest("GET", paging.NextLink, nil) 11959 if ctx != nil { 11960 req = req.WithContext(ctx) 11961 } 11962 res, err = r.client.Do(req) 11963 if err != nil { 11964 return nil, err 11965 } 11966 } 11967 } 11968 11969 // GetN performs GET request for WindowsInformationProtectionNetworkLearningSummary collection, max N pages 11970 func (r *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest) GetN(ctx context.Context, n int) ([]WindowsInformationProtectionNetworkLearningSummary, error) { 11971 var query string 11972 if r.query != nil { 11973 query = "?" + r.query.Encode() 11974 } 11975 return r.Paging(ctx, "GET", query, nil, n) 11976 } 11977 11978 // Get performs GET request for WindowsInformationProtectionNetworkLearningSummary collection 11979 func (r *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest) Get(ctx context.Context) ([]WindowsInformationProtectionNetworkLearningSummary, error) { 11980 return r.GetN(ctx, 0) 11981 } 11982 11983 // Add performs POST request for WindowsInformationProtectionNetworkLearningSummary collection 11984 func (r *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest) Add(ctx context.Context, reqObj *WindowsInformationProtectionNetworkLearningSummary) (resObj *WindowsInformationProtectionNetworkLearningSummary, err error) { 11985 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 11986 return 11987 } 11988 11989 // WindowsMalwareInformation returns request builder for WindowsMalwareInformation collection 11990 func (b *DeviceManagementRequestBuilder) WindowsMalwareInformation() *DeviceManagementWindowsMalwareInformationCollectionRequestBuilder { 11991 bb := &DeviceManagementWindowsMalwareInformationCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 11992 bb.baseURL += "/windowsMalwareInformation" 11993 return bb 11994 } 11995 11996 // DeviceManagementWindowsMalwareInformationCollectionRequestBuilder is request builder for WindowsMalwareInformation collection 11997 type DeviceManagementWindowsMalwareInformationCollectionRequestBuilder struct{ BaseRequestBuilder } 11998 11999 // Request returns request for WindowsMalwareInformation collection 12000 func (b *DeviceManagementWindowsMalwareInformationCollectionRequestBuilder) Request() *DeviceManagementWindowsMalwareInformationCollectionRequest { 12001 return &DeviceManagementWindowsMalwareInformationCollectionRequest{ 12002 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 12003 } 12004 } 12005 12006 // ID returns request builder for WindowsMalwareInformation item 12007 func (b *DeviceManagementWindowsMalwareInformationCollectionRequestBuilder) ID(id string) *WindowsMalwareInformationRequestBuilder { 12008 bb := &WindowsMalwareInformationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12009 bb.baseURL += "/" + id 12010 return bb 12011 } 12012 12013 // DeviceManagementWindowsMalwareInformationCollectionRequest is request for WindowsMalwareInformation collection 12014 type DeviceManagementWindowsMalwareInformationCollectionRequest struct{ BaseRequest } 12015 12016 // Paging perfoms paging operation for WindowsMalwareInformation collection 12017 func (r *DeviceManagementWindowsMalwareInformationCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]WindowsMalwareInformation, error) { 12018 req, err := r.NewJSONRequest(method, path, obj) 12019 if err != nil { 12020 return nil, err 12021 } 12022 if ctx != nil { 12023 req = req.WithContext(ctx) 12024 } 12025 res, err := r.client.Do(req) 12026 if err != nil { 12027 return nil, err 12028 } 12029 var values []WindowsMalwareInformation 12030 for { 12031 if res.StatusCode != http.StatusOK { 12032 b, _ := ioutil.ReadAll(res.Body) 12033 res.Body.Close() 12034 errRes := &ErrorResponse{Response: res} 12035 err := jsonx.Unmarshal(b, errRes) 12036 if err != nil { 12037 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 12038 } 12039 return nil, errRes 12040 } 12041 var ( 12042 paging Paging 12043 value []WindowsMalwareInformation 12044 ) 12045 err := jsonx.NewDecoder(res.Body).Decode(&paging) 12046 res.Body.Close() 12047 if err != nil { 12048 return nil, err 12049 } 12050 err = jsonx.Unmarshal(paging.Value, &value) 12051 if err != nil { 12052 return nil, err 12053 } 12054 values = append(values, value...) 12055 if n >= 0 { 12056 n-- 12057 } 12058 if n == 0 || len(paging.NextLink) == 0 { 12059 return values, nil 12060 } 12061 req, err = http.NewRequest("GET", paging.NextLink, nil) 12062 if ctx != nil { 12063 req = req.WithContext(ctx) 12064 } 12065 res, err = r.client.Do(req) 12066 if err != nil { 12067 return nil, err 12068 } 12069 } 12070 } 12071 12072 // GetN performs GET request for WindowsMalwareInformation collection, max N pages 12073 func (r *DeviceManagementWindowsMalwareInformationCollectionRequest) GetN(ctx context.Context, n int) ([]WindowsMalwareInformation, error) { 12074 var query string 12075 if r.query != nil { 12076 query = "?" + r.query.Encode() 12077 } 12078 return r.Paging(ctx, "GET", query, nil, n) 12079 } 12080 12081 // Get performs GET request for WindowsMalwareInformation collection 12082 func (r *DeviceManagementWindowsMalwareInformationCollectionRequest) Get(ctx context.Context) ([]WindowsMalwareInformation, error) { 12083 return r.GetN(ctx, 0) 12084 } 12085 12086 // Add performs POST request for WindowsMalwareInformation collection 12087 func (r *DeviceManagementWindowsMalwareInformationCollectionRequest) Add(ctx context.Context, reqObj *WindowsMalwareInformation) (resObj *WindowsMalwareInformation, err error) { 12088 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 12089 return 12090 } 12091 12092 // Value returns request builder for DeviceManagementSettingInstance collection 12093 func (b *DeviceManagementAbstractComplexSettingInstanceRequestBuilder) Value() *DeviceManagementAbstractComplexSettingInstanceValueCollectionRequestBuilder { 12094 bb := &DeviceManagementAbstractComplexSettingInstanceValueCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12095 bb.baseURL += "/value" 12096 return bb 12097 } 12098 12099 // DeviceManagementAbstractComplexSettingInstanceValueCollectionRequestBuilder is request builder for DeviceManagementSettingInstance collection 12100 type DeviceManagementAbstractComplexSettingInstanceValueCollectionRequestBuilder struct{ BaseRequestBuilder } 12101 12102 // Request returns request for DeviceManagementSettingInstance collection 12103 func (b *DeviceManagementAbstractComplexSettingInstanceValueCollectionRequestBuilder) Request() *DeviceManagementAbstractComplexSettingInstanceValueCollectionRequest { 12104 return &DeviceManagementAbstractComplexSettingInstanceValueCollectionRequest{ 12105 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 12106 } 12107 } 12108 12109 // ID returns request builder for DeviceManagementSettingInstance item 12110 func (b *DeviceManagementAbstractComplexSettingInstanceValueCollectionRequestBuilder) ID(id string) *DeviceManagementSettingInstanceRequestBuilder { 12111 bb := &DeviceManagementSettingInstanceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12112 bb.baseURL += "/" + id 12113 return bb 12114 } 12115 12116 // DeviceManagementAbstractComplexSettingInstanceValueCollectionRequest is request for DeviceManagementSettingInstance collection 12117 type DeviceManagementAbstractComplexSettingInstanceValueCollectionRequest struct{ BaseRequest } 12118 12119 // Paging perfoms paging operation for DeviceManagementSettingInstance collection 12120 func (r *DeviceManagementAbstractComplexSettingInstanceValueCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementSettingInstance, error) { 12121 req, err := r.NewJSONRequest(method, path, obj) 12122 if err != nil { 12123 return nil, err 12124 } 12125 if ctx != nil { 12126 req = req.WithContext(ctx) 12127 } 12128 res, err := r.client.Do(req) 12129 if err != nil { 12130 return nil, err 12131 } 12132 var values []DeviceManagementSettingInstance 12133 for { 12134 if res.StatusCode != http.StatusOK { 12135 b, _ := ioutil.ReadAll(res.Body) 12136 res.Body.Close() 12137 errRes := &ErrorResponse{Response: res} 12138 err := jsonx.Unmarshal(b, errRes) 12139 if err != nil { 12140 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 12141 } 12142 return nil, errRes 12143 } 12144 var ( 12145 paging Paging 12146 value []DeviceManagementSettingInstance 12147 ) 12148 err := jsonx.NewDecoder(res.Body).Decode(&paging) 12149 res.Body.Close() 12150 if err != nil { 12151 return nil, err 12152 } 12153 err = jsonx.Unmarshal(paging.Value, &value) 12154 if err != nil { 12155 return nil, err 12156 } 12157 values = append(values, value...) 12158 if n >= 0 { 12159 n-- 12160 } 12161 if n == 0 || len(paging.NextLink) == 0 { 12162 return values, nil 12163 } 12164 req, err = http.NewRequest("GET", paging.NextLink, nil) 12165 if ctx != nil { 12166 req = req.WithContext(ctx) 12167 } 12168 res, err = r.client.Do(req) 12169 if err != nil { 12170 return nil, err 12171 } 12172 } 12173 } 12174 12175 // GetN performs GET request for DeviceManagementSettingInstance collection, max N pages 12176 func (r *DeviceManagementAbstractComplexSettingInstanceValueCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementSettingInstance, error) { 12177 var query string 12178 if r.query != nil { 12179 query = "?" + r.query.Encode() 12180 } 12181 return r.Paging(ctx, "GET", query, nil, n) 12182 } 12183 12184 // Get performs GET request for DeviceManagementSettingInstance collection 12185 func (r *DeviceManagementAbstractComplexSettingInstanceValueCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingInstance, error) { 12186 return r.GetN(ctx, 0) 12187 } 12188 12189 // Add performs POST request for DeviceManagementSettingInstance collection 12190 func (r *DeviceManagementAbstractComplexSettingInstanceValueCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingInstance) (resObj *DeviceManagementSettingInstance, err error) { 12191 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 12192 return 12193 } 12194 12195 // Value returns request builder for DeviceManagementSettingInstance collection 12196 func (b *DeviceManagementCollectionSettingInstanceRequestBuilder) Value() *DeviceManagementCollectionSettingInstanceValueCollectionRequestBuilder { 12197 bb := &DeviceManagementCollectionSettingInstanceValueCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12198 bb.baseURL += "/value" 12199 return bb 12200 } 12201 12202 // DeviceManagementCollectionSettingInstanceValueCollectionRequestBuilder is request builder for DeviceManagementSettingInstance collection 12203 type DeviceManagementCollectionSettingInstanceValueCollectionRequestBuilder struct{ BaseRequestBuilder } 12204 12205 // Request returns request for DeviceManagementSettingInstance collection 12206 func (b *DeviceManagementCollectionSettingInstanceValueCollectionRequestBuilder) Request() *DeviceManagementCollectionSettingInstanceValueCollectionRequest { 12207 return &DeviceManagementCollectionSettingInstanceValueCollectionRequest{ 12208 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 12209 } 12210 } 12211 12212 // ID returns request builder for DeviceManagementSettingInstance item 12213 func (b *DeviceManagementCollectionSettingInstanceValueCollectionRequestBuilder) ID(id string) *DeviceManagementSettingInstanceRequestBuilder { 12214 bb := &DeviceManagementSettingInstanceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12215 bb.baseURL += "/" + id 12216 return bb 12217 } 12218 12219 // DeviceManagementCollectionSettingInstanceValueCollectionRequest is request for DeviceManagementSettingInstance collection 12220 type DeviceManagementCollectionSettingInstanceValueCollectionRequest struct{ BaseRequest } 12221 12222 // Paging perfoms paging operation for DeviceManagementSettingInstance collection 12223 func (r *DeviceManagementCollectionSettingInstanceValueCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementSettingInstance, error) { 12224 req, err := r.NewJSONRequest(method, path, obj) 12225 if err != nil { 12226 return nil, err 12227 } 12228 if ctx != nil { 12229 req = req.WithContext(ctx) 12230 } 12231 res, err := r.client.Do(req) 12232 if err != nil { 12233 return nil, err 12234 } 12235 var values []DeviceManagementSettingInstance 12236 for { 12237 if res.StatusCode != http.StatusOK { 12238 b, _ := ioutil.ReadAll(res.Body) 12239 res.Body.Close() 12240 errRes := &ErrorResponse{Response: res} 12241 err := jsonx.Unmarshal(b, errRes) 12242 if err != nil { 12243 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 12244 } 12245 return nil, errRes 12246 } 12247 var ( 12248 paging Paging 12249 value []DeviceManagementSettingInstance 12250 ) 12251 err := jsonx.NewDecoder(res.Body).Decode(&paging) 12252 res.Body.Close() 12253 if err != nil { 12254 return nil, err 12255 } 12256 err = jsonx.Unmarshal(paging.Value, &value) 12257 if err != nil { 12258 return nil, err 12259 } 12260 values = append(values, value...) 12261 if n >= 0 { 12262 n-- 12263 } 12264 if n == 0 || len(paging.NextLink) == 0 { 12265 return values, nil 12266 } 12267 req, err = http.NewRequest("GET", paging.NextLink, nil) 12268 if ctx != nil { 12269 req = req.WithContext(ctx) 12270 } 12271 res, err = r.client.Do(req) 12272 if err != nil { 12273 return nil, err 12274 } 12275 } 12276 } 12277 12278 // GetN performs GET request for DeviceManagementSettingInstance collection, max N pages 12279 func (r *DeviceManagementCollectionSettingInstanceValueCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementSettingInstance, error) { 12280 var query string 12281 if r.query != nil { 12282 query = "?" + r.query.Encode() 12283 } 12284 return r.Paging(ctx, "GET", query, nil, n) 12285 } 12286 12287 // Get performs GET request for DeviceManagementSettingInstance collection 12288 func (r *DeviceManagementCollectionSettingInstanceValueCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingInstance, error) { 12289 return r.GetN(ctx, 0) 12290 } 12291 12292 // Add performs POST request for DeviceManagementSettingInstance collection 12293 func (r *DeviceManagementCollectionSettingInstanceValueCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingInstance) (resObj *DeviceManagementSettingInstance, err error) { 12294 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 12295 return 12296 } 12297 12298 // Value returns request builder for DeviceManagementSettingInstance collection 12299 func (b *DeviceManagementComplexSettingInstanceRequestBuilder) Value() *DeviceManagementComplexSettingInstanceValueCollectionRequestBuilder { 12300 bb := &DeviceManagementComplexSettingInstanceValueCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12301 bb.baseURL += "/value" 12302 return bb 12303 } 12304 12305 // DeviceManagementComplexSettingInstanceValueCollectionRequestBuilder is request builder for DeviceManagementSettingInstance collection 12306 type DeviceManagementComplexSettingInstanceValueCollectionRequestBuilder struct{ BaseRequestBuilder } 12307 12308 // Request returns request for DeviceManagementSettingInstance collection 12309 func (b *DeviceManagementComplexSettingInstanceValueCollectionRequestBuilder) Request() *DeviceManagementComplexSettingInstanceValueCollectionRequest { 12310 return &DeviceManagementComplexSettingInstanceValueCollectionRequest{ 12311 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 12312 } 12313 } 12314 12315 // ID returns request builder for DeviceManagementSettingInstance item 12316 func (b *DeviceManagementComplexSettingInstanceValueCollectionRequestBuilder) ID(id string) *DeviceManagementSettingInstanceRequestBuilder { 12317 bb := &DeviceManagementSettingInstanceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12318 bb.baseURL += "/" + id 12319 return bb 12320 } 12321 12322 // DeviceManagementComplexSettingInstanceValueCollectionRequest is request for DeviceManagementSettingInstance collection 12323 type DeviceManagementComplexSettingInstanceValueCollectionRequest struct{ BaseRequest } 12324 12325 // Paging perfoms paging operation for DeviceManagementSettingInstance collection 12326 func (r *DeviceManagementComplexSettingInstanceValueCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementSettingInstance, error) { 12327 req, err := r.NewJSONRequest(method, path, obj) 12328 if err != nil { 12329 return nil, err 12330 } 12331 if ctx != nil { 12332 req = req.WithContext(ctx) 12333 } 12334 res, err := r.client.Do(req) 12335 if err != nil { 12336 return nil, err 12337 } 12338 var values []DeviceManagementSettingInstance 12339 for { 12340 if res.StatusCode != http.StatusOK { 12341 b, _ := ioutil.ReadAll(res.Body) 12342 res.Body.Close() 12343 errRes := &ErrorResponse{Response: res} 12344 err := jsonx.Unmarshal(b, errRes) 12345 if err != nil { 12346 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 12347 } 12348 return nil, errRes 12349 } 12350 var ( 12351 paging Paging 12352 value []DeviceManagementSettingInstance 12353 ) 12354 err := jsonx.NewDecoder(res.Body).Decode(&paging) 12355 res.Body.Close() 12356 if err != nil { 12357 return nil, err 12358 } 12359 err = jsonx.Unmarshal(paging.Value, &value) 12360 if err != nil { 12361 return nil, err 12362 } 12363 values = append(values, value...) 12364 if n >= 0 { 12365 n-- 12366 } 12367 if n == 0 || len(paging.NextLink) == 0 { 12368 return values, nil 12369 } 12370 req, err = http.NewRequest("GET", paging.NextLink, nil) 12371 if ctx != nil { 12372 req = req.WithContext(ctx) 12373 } 12374 res, err = r.client.Do(req) 12375 if err != nil { 12376 return nil, err 12377 } 12378 } 12379 } 12380 12381 // GetN performs GET request for DeviceManagementSettingInstance collection, max N pages 12382 func (r *DeviceManagementComplexSettingInstanceValueCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementSettingInstance, error) { 12383 var query string 12384 if r.query != nil { 12385 query = "?" + r.query.Encode() 12386 } 12387 return r.Paging(ctx, "GET", query, nil, n) 12388 } 12389 12390 // Get performs GET request for DeviceManagementSettingInstance collection 12391 func (r *DeviceManagementComplexSettingInstanceValueCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingInstance, error) { 12392 return r.GetN(ctx, 0) 12393 } 12394 12395 // Add performs POST request for DeviceManagementSettingInstance collection 12396 func (r *DeviceManagementComplexSettingInstanceValueCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingInstance) (resObj *DeviceManagementSettingInstance, err error) { 12397 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 12398 return 12399 } 12400 12401 // ConditionalAccessSettings is navigation property 12402 func (b *DeviceManagementExchangeOnPremisesPolicyRequestBuilder) ConditionalAccessSettings() *OnPremisesConditionalAccessSettingsRequestBuilder { 12403 bb := &OnPremisesConditionalAccessSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12404 bb.baseURL += "/conditionalAccessSettings" 12405 return bb 12406 } 12407 12408 // Assignments returns request builder for DeviceManagementIntentAssignment collection 12409 func (b *DeviceManagementIntentRequestBuilder) Assignments() *DeviceManagementIntentAssignmentsCollectionRequestBuilder { 12410 bb := &DeviceManagementIntentAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12411 bb.baseURL += "/assignments" 12412 return bb 12413 } 12414 12415 // DeviceManagementIntentAssignmentsCollectionRequestBuilder is request builder for DeviceManagementIntentAssignment collection 12416 type DeviceManagementIntentAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder } 12417 12418 // Request returns request for DeviceManagementIntentAssignment collection 12419 func (b *DeviceManagementIntentAssignmentsCollectionRequestBuilder) Request() *DeviceManagementIntentAssignmentsCollectionRequest { 12420 return &DeviceManagementIntentAssignmentsCollectionRequest{ 12421 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 12422 } 12423 } 12424 12425 // ID returns request builder for DeviceManagementIntentAssignment item 12426 func (b *DeviceManagementIntentAssignmentsCollectionRequestBuilder) ID(id string) *DeviceManagementIntentAssignmentRequestBuilder { 12427 bb := &DeviceManagementIntentAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12428 bb.baseURL += "/" + id 12429 return bb 12430 } 12431 12432 // DeviceManagementIntentAssignmentsCollectionRequest is request for DeviceManagementIntentAssignment collection 12433 type DeviceManagementIntentAssignmentsCollectionRequest struct{ BaseRequest } 12434 12435 // Paging perfoms paging operation for DeviceManagementIntentAssignment collection 12436 func (r *DeviceManagementIntentAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementIntentAssignment, error) { 12437 req, err := r.NewJSONRequest(method, path, obj) 12438 if err != nil { 12439 return nil, err 12440 } 12441 if ctx != nil { 12442 req = req.WithContext(ctx) 12443 } 12444 res, err := r.client.Do(req) 12445 if err != nil { 12446 return nil, err 12447 } 12448 var values []DeviceManagementIntentAssignment 12449 for { 12450 if res.StatusCode != http.StatusOK { 12451 b, _ := ioutil.ReadAll(res.Body) 12452 res.Body.Close() 12453 errRes := &ErrorResponse{Response: res} 12454 err := jsonx.Unmarshal(b, errRes) 12455 if err != nil { 12456 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 12457 } 12458 return nil, errRes 12459 } 12460 var ( 12461 paging Paging 12462 value []DeviceManagementIntentAssignment 12463 ) 12464 err := jsonx.NewDecoder(res.Body).Decode(&paging) 12465 res.Body.Close() 12466 if err != nil { 12467 return nil, err 12468 } 12469 err = jsonx.Unmarshal(paging.Value, &value) 12470 if err != nil { 12471 return nil, err 12472 } 12473 values = append(values, value...) 12474 if n >= 0 { 12475 n-- 12476 } 12477 if n == 0 || len(paging.NextLink) == 0 { 12478 return values, nil 12479 } 12480 req, err = http.NewRequest("GET", paging.NextLink, nil) 12481 if ctx != nil { 12482 req = req.WithContext(ctx) 12483 } 12484 res, err = r.client.Do(req) 12485 if err != nil { 12486 return nil, err 12487 } 12488 } 12489 } 12490 12491 // GetN performs GET request for DeviceManagementIntentAssignment collection, max N pages 12492 func (r *DeviceManagementIntentAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementIntentAssignment, error) { 12493 var query string 12494 if r.query != nil { 12495 query = "?" + r.query.Encode() 12496 } 12497 return r.Paging(ctx, "GET", query, nil, n) 12498 } 12499 12500 // Get performs GET request for DeviceManagementIntentAssignment collection 12501 func (r *DeviceManagementIntentAssignmentsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementIntentAssignment, error) { 12502 return r.GetN(ctx, 0) 12503 } 12504 12505 // Add performs POST request for DeviceManagementIntentAssignment collection 12506 func (r *DeviceManagementIntentAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementIntentAssignment) (resObj *DeviceManagementIntentAssignment, err error) { 12507 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 12508 return 12509 } 12510 12511 // Categories returns request builder for DeviceManagementIntentSettingCategory collection 12512 func (b *DeviceManagementIntentRequestBuilder) Categories() *DeviceManagementIntentCategoriesCollectionRequestBuilder { 12513 bb := &DeviceManagementIntentCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12514 bb.baseURL += "/categories" 12515 return bb 12516 } 12517 12518 // DeviceManagementIntentCategoriesCollectionRequestBuilder is request builder for DeviceManagementIntentSettingCategory collection 12519 type DeviceManagementIntentCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder } 12520 12521 // Request returns request for DeviceManagementIntentSettingCategory collection 12522 func (b *DeviceManagementIntentCategoriesCollectionRequestBuilder) Request() *DeviceManagementIntentCategoriesCollectionRequest { 12523 return &DeviceManagementIntentCategoriesCollectionRequest{ 12524 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 12525 } 12526 } 12527 12528 // ID returns request builder for DeviceManagementIntentSettingCategory item 12529 func (b *DeviceManagementIntentCategoriesCollectionRequestBuilder) ID(id string) *DeviceManagementIntentSettingCategoryRequestBuilder { 12530 bb := &DeviceManagementIntentSettingCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12531 bb.baseURL += "/" + id 12532 return bb 12533 } 12534 12535 // DeviceManagementIntentCategoriesCollectionRequest is request for DeviceManagementIntentSettingCategory collection 12536 type DeviceManagementIntentCategoriesCollectionRequest struct{ BaseRequest } 12537 12538 // Paging perfoms paging operation for DeviceManagementIntentSettingCategory collection 12539 func (r *DeviceManagementIntentCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementIntentSettingCategory, error) { 12540 req, err := r.NewJSONRequest(method, path, obj) 12541 if err != nil { 12542 return nil, err 12543 } 12544 if ctx != nil { 12545 req = req.WithContext(ctx) 12546 } 12547 res, err := r.client.Do(req) 12548 if err != nil { 12549 return nil, err 12550 } 12551 var values []DeviceManagementIntentSettingCategory 12552 for { 12553 if res.StatusCode != http.StatusOK { 12554 b, _ := ioutil.ReadAll(res.Body) 12555 res.Body.Close() 12556 errRes := &ErrorResponse{Response: res} 12557 err := jsonx.Unmarshal(b, errRes) 12558 if err != nil { 12559 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 12560 } 12561 return nil, errRes 12562 } 12563 var ( 12564 paging Paging 12565 value []DeviceManagementIntentSettingCategory 12566 ) 12567 err := jsonx.NewDecoder(res.Body).Decode(&paging) 12568 res.Body.Close() 12569 if err != nil { 12570 return nil, err 12571 } 12572 err = jsonx.Unmarshal(paging.Value, &value) 12573 if err != nil { 12574 return nil, err 12575 } 12576 values = append(values, value...) 12577 if n >= 0 { 12578 n-- 12579 } 12580 if n == 0 || len(paging.NextLink) == 0 { 12581 return values, nil 12582 } 12583 req, err = http.NewRequest("GET", paging.NextLink, nil) 12584 if ctx != nil { 12585 req = req.WithContext(ctx) 12586 } 12587 res, err = r.client.Do(req) 12588 if err != nil { 12589 return nil, err 12590 } 12591 } 12592 } 12593 12594 // GetN performs GET request for DeviceManagementIntentSettingCategory collection, max N pages 12595 func (r *DeviceManagementIntentCategoriesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementIntentSettingCategory, error) { 12596 var query string 12597 if r.query != nil { 12598 query = "?" + r.query.Encode() 12599 } 12600 return r.Paging(ctx, "GET", query, nil, n) 12601 } 12602 12603 // Get performs GET request for DeviceManagementIntentSettingCategory collection 12604 func (r *DeviceManagementIntentCategoriesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementIntentSettingCategory, error) { 12605 return r.GetN(ctx, 0) 12606 } 12607 12608 // Add performs POST request for DeviceManagementIntentSettingCategory collection 12609 func (r *DeviceManagementIntentCategoriesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementIntentSettingCategory) (resObj *DeviceManagementIntentSettingCategory, err error) { 12610 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 12611 return 12612 } 12613 12614 // DeviceSettingStateSummaries returns request builder for DeviceManagementIntentDeviceSettingStateSummary collection 12615 func (b *DeviceManagementIntentRequestBuilder) DeviceSettingStateSummaries() *DeviceManagementIntentDeviceSettingStateSummariesCollectionRequestBuilder { 12616 bb := &DeviceManagementIntentDeviceSettingStateSummariesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12617 bb.baseURL += "/deviceSettingStateSummaries" 12618 return bb 12619 } 12620 12621 // DeviceManagementIntentDeviceSettingStateSummariesCollectionRequestBuilder is request builder for DeviceManagementIntentDeviceSettingStateSummary collection 12622 type DeviceManagementIntentDeviceSettingStateSummariesCollectionRequestBuilder struct{ BaseRequestBuilder } 12623 12624 // Request returns request for DeviceManagementIntentDeviceSettingStateSummary collection 12625 func (b *DeviceManagementIntentDeviceSettingStateSummariesCollectionRequestBuilder) Request() *DeviceManagementIntentDeviceSettingStateSummariesCollectionRequest { 12626 return &DeviceManagementIntentDeviceSettingStateSummariesCollectionRequest{ 12627 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 12628 } 12629 } 12630 12631 // ID returns request builder for DeviceManagementIntentDeviceSettingStateSummary item 12632 func (b *DeviceManagementIntentDeviceSettingStateSummariesCollectionRequestBuilder) ID(id string) *DeviceManagementIntentDeviceSettingStateSummaryRequestBuilder { 12633 bb := &DeviceManagementIntentDeviceSettingStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12634 bb.baseURL += "/" + id 12635 return bb 12636 } 12637 12638 // DeviceManagementIntentDeviceSettingStateSummariesCollectionRequest is request for DeviceManagementIntentDeviceSettingStateSummary collection 12639 type DeviceManagementIntentDeviceSettingStateSummariesCollectionRequest struct{ BaseRequest } 12640 12641 // Paging perfoms paging operation for DeviceManagementIntentDeviceSettingStateSummary collection 12642 func (r *DeviceManagementIntentDeviceSettingStateSummariesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementIntentDeviceSettingStateSummary, error) { 12643 req, err := r.NewJSONRequest(method, path, obj) 12644 if err != nil { 12645 return nil, err 12646 } 12647 if ctx != nil { 12648 req = req.WithContext(ctx) 12649 } 12650 res, err := r.client.Do(req) 12651 if err != nil { 12652 return nil, err 12653 } 12654 var values []DeviceManagementIntentDeviceSettingStateSummary 12655 for { 12656 if res.StatusCode != http.StatusOK { 12657 b, _ := ioutil.ReadAll(res.Body) 12658 res.Body.Close() 12659 errRes := &ErrorResponse{Response: res} 12660 err := jsonx.Unmarshal(b, errRes) 12661 if err != nil { 12662 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 12663 } 12664 return nil, errRes 12665 } 12666 var ( 12667 paging Paging 12668 value []DeviceManagementIntentDeviceSettingStateSummary 12669 ) 12670 err := jsonx.NewDecoder(res.Body).Decode(&paging) 12671 res.Body.Close() 12672 if err != nil { 12673 return nil, err 12674 } 12675 err = jsonx.Unmarshal(paging.Value, &value) 12676 if err != nil { 12677 return nil, err 12678 } 12679 values = append(values, value...) 12680 if n >= 0 { 12681 n-- 12682 } 12683 if n == 0 || len(paging.NextLink) == 0 { 12684 return values, nil 12685 } 12686 req, err = http.NewRequest("GET", paging.NextLink, nil) 12687 if ctx != nil { 12688 req = req.WithContext(ctx) 12689 } 12690 res, err = r.client.Do(req) 12691 if err != nil { 12692 return nil, err 12693 } 12694 } 12695 } 12696 12697 // GetN performs GET request for DeviceManagementIntentDeviceSettingStateSummary collection, max N pages 12698 func (r *DeviceManagementIntentDeviceSettingStateSummariesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementIntentDeviceSettingStateSummary, error) { 12699 var query string 12700 if r.query != nil { 12701 query = "?" + r.query.Encode() 12702 } 12703 return r.Paging(ctx, "GET", query, nil, n) 12704 } 12705 12706 // Get performs GET request for DeviceManagementIntentDeviceSettingStateSummary collection 12707 func (r *DeviceManagementIntentDeviceSettingStateSummariesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementIntentDeviceSettingStateSummary, error) { 12708 return r.GetN(ctx, 0) 12709 } 12710 12711 // Add performs POST request for DeviceManagementIntentDeviceSettingStateSummary collection 12712 func (r *DeviceManagementIntentDeviceSettingStateSummariesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementIntentDeviceSettingStateSummary) (resObj *DeviceManagementIntentDeviceSettingStateSummary, err error) { 12713 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 12714 return 12715 } 12716 12717 // DeviceStateSummary is navigation property 12718 func (b *DeviceManagementIntentRequestBuilder) DeviceStateSummary() *DeviceManagementIntentDeviceStateSummaryRequestBuilder { 12719 bb := &DeviceManagementIntentDeviceStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12720 bb.baseURL += "/deviceStateSummary" 12721 return bb 12722 } 12723 12724 // DeviceStates returns request builder for DeviceManagementIntentDeviceState collection 12725 func (b *DeviceManagementIntentRequestBuilder) DeviceStates() *DeviceManagementIntentDeviceStatesCollectionRequestBuilder { 12726 bb := &DeviceManagementIntentDeviceStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12727 bb.baseURL += "/deviceStates" 12728 return bb 12729 } 12730 12731 // DeviceManagementIntentDeviceStatesCollectionRequestBuilder is request builder for DeviceManagementIntentDeviceState collection 12732 type DeviceManagementIntentDeviceStatesCollectionRequestBuilder struct{ BaseRequestBuilder } 12733 12734 // Request returns request for DeviceManagementIntentDeviceState collection 12735 func (b *DeviceManagementIntentDeviceStatesCollectionRequestBuilder) Request() *DeviceManagementIntentDeviceStatesCollectionRequest { 12736 return &DeviceManagementIntentDeviceStatesCollectionRequest{ 12737 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 12738 } 12739 } 12740 12741 // ID returns request builder for DeviceManagementIntentDeviceState item 12742 func (b *DeviceManagementIntentDeviceStatesCollectionRequestBuilder) ID(id string) *DeviceManagementIntentDeviceStateRequestBuilder { 12743 bb := &DeviceManagementIntentDeviceStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12744 bb.baseURL += "/" + id 12745 return bb 12746 } 12747 12748 // DeviceManagementIntentDeviceStatesCollectionRequest is request for DeviceManagementIntentDeviceState collection 12749 type DeviceManagementIntentDeviceStatesCollectionRequest struct{ BaseRequest } 12750 12751 // Paging perfoms paging operation for DeviceManagementIntentDeviceState collection 12752 func (r *DeviceManagementIntentDeviceStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementIntentDeviceState, error) { 12753 req, err := r.NewJSONRequest(method, path, obj) 12754 if err != nil { 12755 return nil, err 12756 } 12757 if ctx != nil { 12758 req = req.WithContext(ctx) 12759 } 12760 res, err := r.client.Do(req) 12761 if err != nil { 12762 return nil, err 12763 } 12764 var values []DeviceManagementIntentDeviceState 12765 for { 12766 if res.StatusCode != http.StatusOK { 12767 b, _ := ioutil.ReadAll(res.Body) 12768 res.Body.Close() 12769 errRes := &ErrorResponse{Response: res} 12770 err := jsonx.Unmarshal(b, errRes) 12771 if err != nil { 12772 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 12773 } 12774 return nil, errRes 12775 } 12776 var ( 12777 paging Paging 12778 value []DeviceManagementIntentDeviceState 12779 ) 12780 err := jsonx.NewDecoder(res.Body).Decode(&paging) 12781 res.Body.Close() 12782 if err != nil { 12783 return nil, err 12784 } 12785 err = jsonx.Unmarshal(paging.Value, &value) 12786 if err != nil { 12787 return nil, err 12788 } 12789 values = append(values, value...) 12790 if n >= 0 { 12791 n-- 12792 } 12793 if n == 0 || len(paging.NextLink) == 0 { 12794 return values, nil 12795 } 12796 req, err = http.NewRequest("GET", paging.NextLink, nil) 12797 if ctx != nil { 12798 req = req.WithContext(ctx) 12799 } 12800 res, err = r.client.Do(req) 12801 if err != nil { 12802 return nil, err 12803 } 12804 } 12805 } 12806 12807 // GetN performs GET request for DeviceManagementIntentDeviceState collection, max N pages 12808 func (r *DeviceManagementIntentDeviceStatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementIntentDeviceState, error) { 12809 var query string 12810 if r.query != nil { 12811 query = "?" + r.query.Encode() 12812 } 12813 return r.Paging(ctx, "GET", query, nil, n) 12814 } 12815 12816 // Get performs GET request for DeviceManagementIntentDeviceState collection 12817 func (r *DeviceManagementIntentDeviceStatesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementIntentDeviceState, error) { 12818 return r.GetN(ctx, 0) 12819 } 12820 12821 // Add performs POST request for DeviceManagementIntentDeviceState collection 12822 func (r *DeviceManagementIntentDeviceStatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementIntentDeviceState) (resObj *DeviceManagementIntentDeviceState, err error) { 12823 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 12824 return 12825 } 12826 12827 // Settings returns request builder for DeviceManagementSettingInstance collection 12828 func (b *DeviceManagementIntentRequestBuilder) Settings() *DeviceManagementIntentSettingsCollectionRequestBuilder { 12829 bb := &DeviceManagementIntentSettingsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12830 bb.baseURL += "/settings" 12831 return bb 12832 } 12833 12834 // DeviceManagementIntentSettingsCollectionRequestBuilder is request builder for DeviceManagementSettingInstance collection 12835 type DeviceManagementIntentSettingsCollectionRequestBuilder struct{ BaseRequestBuilder } 12836 12837 // Request returns request for DeviceManagementSettingInstance collection 12838 func (b *DeviceManagementIntentSettingsCollectionRequestBuilder) Request() *DeviceManagementIntentSettingsCollectionRequest { 12839 return &DeviceManagementIntentSettingsCollectionRequest{ 12840 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 12841 } 12842 } 12843 12844 // ID returns request builder for DeviceManagementSettingInstance item 12845 func (b *DeviceManagementIntentSettingsCollectionRequestBuilder) ID(id string) *DeviceManagementSettingInstanceRequestBuilder { 12846 bb := &DeviceManagementSettingInstanceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12847 bb.baseURL += "/" + id 12848 return bb 12849 } 12850 12851 // DeviceManagementIntentSettingsCollectionRequest is request for DeviceManagementSettingInstance collection 12852 type DeviceManagementIntentSettingsCollectionRequest struct{ BaseRequest } 12853 12854 // Paging perfoms paging operation for DeviceManagementSettingInstance collection 12855 func (r *DeviceManagementIntentSettingsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementSettingInstance, error) { 12856 req, err := r.NewJSONRequest(method, path, obj) 12857 if err != nil { 12858 return nil, err 12859 } 12860 if ctx != nil { 12861 req = req.WithContext(ctx) 12862 } 12863 res, err := r.client.Do(req) 12864 if err != nil { 12865 return nil, err 12866 } 12867 var values []DeviceManagementSettingInstance 12868 for { 12869 if res.StatusCode != http.StatusOK { 12870 b, _ := ioutil.ReadAll(res.Body) 12871 res.Body.Close() 12872 errRes := &ErrorResponse{Response: res} 12873 err := jsonx.Unmarshal(b, errRes) 12874 if err != nil { 12875 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 12876 } 12877 return nil, errRes 12878 } 12879 var ( 12880 paging Paging 12881 value []DeviceManagementSettingInstance 12882 ) 12883 err := jsonx.NewDecoder(res.Body).Decode(&paging) 12884 res.Body.Close() 12885 if err != nil { 12886 return nil, err 12887 } 12888 err = jsonx.Unmarshal(paging.Value, &value) 12889 if err != nil { 12890 return nil, err 12891 } 12892 values = append(values, value...) 12893 if n >= 0 { 12894 n-- 12895 } 12896 if n == 0 || len(paging.NextLink) == 0 { 12897 return values, nil 12898 } 12899 req, err = http.NewRequest("GET", paging.NextLink, nil) 12900 if ctx != nil { 12901 req = req.WithContext(ctx) 12902 } 12903 res, err = r.client.Do(req) 12904 if err != nil { 12905 return nil, err 12906 } 12907 } 12908 } 12909 12910 // GetN performs GET request for DeviceManagementSettingInstance collection, max N pages 12911 func (r *DeviceManagementIntentSettingsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementSettingInstance, error) { 12912 var query string 12913 if r.query != nil { 12914 query = "?" + r.query.Encode() 12915 } 12916 return r.Paging(ctx, "GET", query, nil, n) 12917 } 12918 12919 // Get performs GET request for DeviceManagementSettingInstance collection 12920 func (r *DeviceManagementIntentSettingsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingInstance, error) { 12921 return r.GetN(ctx, 0) 12922 } 12923 12924 // Add performs POST request for DeviceManagementSettingInstance collection 12925 func (r *DeviceManagementIntentSettingsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingInstance) (resObj *DeviceManagementSettingInstance, err error) { 12926 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 12927 return 12928 } 12929 12930 // UserStateSummary is navigation property 12931 func (b *DeviceManagementIntentRequestBuilder) UserStateSummary() *DeviceManagementIntentUserStateSummaryRequestBuilder { 12932 bb := &DeviceManagementIntentUserStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12933 bb.baseURL += "/userStateSummary" 12934 return bb 12935 } 12936 12937 // UserStates returns request builder for DeviceManagementIntentUserState collection 12938 func (b *DeviceManagementIntentRequestBuilder) UserStates() *DeviceManagementIntentUserStatesCollectionRequestBuilder { 12939 bb := &DeviceManagementIntentUserStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12940 bb.baseURL += "/userStates" 12941 return bb 12942 } 12943 12944 // DeviceManagementIntentUserStatesCollectionRequestBuilder is request builder for DeviceManagementIntentUserState collection 12945 type DeviceManagementIntentUserStatesCollectionRequestBuilder struct{ BaseRequestBuilder } 12946 12947 // Request returns request for DeviceManagementIntentUserState collection 12948 func (b *DeviceManagementIntentUserStatesCollectionRequestBuilder) Request() *DeviceManagementIntentUserStatesCollectionRequest { 12949 return &DeviceManagementIntentUserStatesCollectionRequest{ 12950 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 12951 } 12952 } 12953 12954 // ID returns request builder for DeviceManagementIntentUserState item 12955 func (b *DeviceManagementIntentUserStatesCollectionRequestBuilder) ID(id string) *DeviceManagementIntentUserStateRequestBuilder { 12956 bb := &DeviceManagementIntentUserStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 12957 bb.baseURL += "/" + id 12958 return bb 12959 } 12960 12961 // DeviceManagementIntentUserStatesCollectionRequest is request for DeviceManagementIntentUserState collection 12962 type DeviceManagementIntentUserStatesCollectionRequest struct{ BaseRequest } 12963 12964 // Paging perfoms paging operation for DeviceManagementIntentUserState collection 12965 func (r *DeviceManagementIntentUserStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementIntentUserState, error) { 12966 req, err := r.NewJSONRequest(method, path, obj) 12967 if err != nil { 12968 return nil, err 12969 } 12970 if ctx != nil { 12971 req = req.WithContext(ctx) 12972 } 12973 res, err := r.client.Do(req) 12974 if err != nil { 12975 return nil, err 12976 } 12977 var values []DeviceManagementIntentUserState 12978 for { 12979 if res.StatusCode != http.StatusOK { 12980 b, _ := ioutil.ReadAll(res.Body) 12981 res.Body.Close() 12982 errRes := &ErrorResponse{Response: res} 12983 err := jsonx.Unmarshal(b, errRes) 12984 if err != nil { 12985 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 12986 } 12987 return nil, errRes 12988 } 12989 var ( 12990 paging Paging 12991 value []DeviceManagementIntentUserState 12992 ) 12993 err := jsonx.NewDecoder(res.Body).Decode(&paging) 12994 res.Body.Close() 12995 if err != nil { 12996 return nil, err 12997 } 12998 err = jsonx.Unmarshal(paging.Value, &value) 12999 if err != nil { 13000 return nil, err 13001 } 13002 values = append(values, value...) 13003 if n >= 0 { 13004 n-- 13005 } 13006 if n == 0 || len(paging.NextLink) == 0 { 13007 return values, nil 13008 } 13009 req, err = http.NewRequest("GET", paging.NextLink, nil) 13010 if ctx != nil { 13011 req = req.WithContext(ctx) 13012 } 13013 res, err = r.client.Do(req) 13014 if err != nil { 13015 return nil, err 13016 } 13017 } 13018 } 13019 13020 // GetN performs GET request for DeviceManagementIntentUserState collection, max N pages 13021 func (r *DeviceManagementIntentUserStatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementIntentUserState, error) { 13022 var query string 13023 if r.query != nil { 13024 query = "?" + r.query.Encode() 13025 } 13026 return r.Paging(ctx, "GET", query, nil, n) 13027 } 13028 13029 // Get performs GET request for DeviceManagementIntentUserState collection 13030 func (r *DeviceManagementIntentUserStatesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementIntentUserState, error) { 13031 return r.GetN(ctx, 0) 13032 } 13033 13034 // Add performs POST request for DeviceManagementIntentUserState collection 13035 func (r *DeviceManagementIntentUserStatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementIntentUserState) (resObj *DeviceManagementIntentUserState, err error) { 13036 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 13037 return 13038 } 13039 13040 // Settings returns request builder for DeviceManagementSettingInstance collection 13041 func (b *DeviceManagementIntentSettingCategoryRequestBuilder) Settings() *DeviceManagementIntentSettingCategorySettingsCollectionRequestBuilder { 13042 bb := &DeviceManagementIntentSettingCategorySettingsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13043 bb.baseURL += "/settings" 13044 return bb 13045 } 13046 13047 // DeviceManagementIntentSettingCategorySettingsCollectionRequestBuilder is request builder for DeviceManagementSettingInstance collection 13048 type DeviceManagementIntentSettingCategorySettingsCollectionRequestBuilder struct{ BaseRequestBuilder } 13049 13050 // Request returns request for DeviceManagementSettingInstance collection 13051 func (b *DeviceManagementIntentSettingCategorySettingsCollectionRequestBuilder) Request() *DeviceManagementIntentSettingCategorySettingsCollectionRequest { 13052 return &DeviceManagementIntentSettingCategorySettingsCollectionRequest{ 13053 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 13054 } 13055 } 13056 13057 // ID returns request builder for DeviceManagementSettingInstance item 13058 func (b *DeviceManagementIntentSettingCategorySettingsCollectionRequestBuilder) ID(id string) *DeviceManagementSettingInstanceRequestBuilder { 13059 bb := &DeviceManagementSettingInstanceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13060 bb.baseURL += "/" + id 13061 return bb 13062 } 13063 13064 // DeviceManagementIntentSettingCategorySettingsCollectionRequest is request for DeviceManagementSettingInstance collection 13065 type DeviceManagementIntentSettingCategorySettingsCollectionRequest struct{ BaseRequest } 13066 13067 // Paging perfoms paging operation for DeviceManagementSettingInstance collection 13068 func (r *DeviceManagementIntentSettingCategorySettingsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementSettingInstance, error) { 13069 req, err := r.NewJSONRequest(method, path, obj) 13070 if err != nil { 13071 return nil, err 13072 } 13073 if ctx != nil { 13074 req = req.WithContext(ctx) 13075 } 13076 res, err := r.client.Do(req) 13077 if err != nil { 13078 return nil, err 13079 } 13080 var values []DeviceManagementSettingInstance 13081 for { 13082 if res.StatusCode != http.StatusOK { 13083 b, _ := ioutil.ReadAll(res.Body) 13084 res.Body.Close() 13085 errRes := &ErrorResponse{Response: res} 13086 err := jsonx.Unmarshal(b, errRes) 13087 if err != nil { 13088 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 13089 } 13090 return nil, errRes 13091 } 13092 var ( 13093 paging Paging 13094 value []DeviceManagementSettingInstance 13095 ) 13096 err := jsonx.NewDecoder(res.Body).Decode(&paging) 13097 res.Body.Close() 13098 if err != nil { 13099 return nil, err 13100 } 13101 err = jsonx.Unmarshal(paging.Value, &value) 13102 if err != nil { 13103 return nil, err 13104 } 13105 values = append(values, value...) 13106 if n >= 0 { 13107 n-- 13108 } 13109 if n == 0 || len(paging.NextLink) == 0 { 13110 return values, nil 13111 } 13112 req, err = http.NewRequest("GET", paging.NextLink, nil) 13113 if ctx != nil { 13114 req = req.WithContext(ctx) 13115 } 13116 res, err = r.client.Do(req) 13117 if err != nil { 13118 return nil, err 13119 } 13120 } 13121 } 13122 13123 // GetN performs GET request for DeviceManagementSettingInstance collection, max N pages 13124 func (r *DeviceManagementIntentSettingCategorySettingsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementSettingInstance, error) { 13125 var query string 13126 if r.query != nil { 13127 query = "?" + r.query.Encode() 13128 } 13129 return r.Paging(ctx, "GET", query, nil, n) 13130 } 13131 13132 // Get performs GET request for DeviceManagementSettingInstance collection 13133 func (r *DeviceManagementIntentSettingCategorySettingsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingInstance, error) { 13134 return r.GetN(ctx, 0) 13135 } 13136 13137 // Add performs POST request for DeviceManagementSettingInstance collection 13138 func (r *DeviceManagementIntentSettingCategorySettingsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingInstance) (resObj *DeviceManagementSettingInstance, err error) { 13139 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 13140 return 13141 } 13142 13143 // CachedReportConfigurations returns request builder for DeviceManagementCachedReportConfiguration collection 13144 func (b *DeviceManagementReportsRequestBuilder) CachedReportConfigurations() *DeviceManagementReportsCachedReportConfigurationsCollectionRequestBuilder { 13145 bb := &DeviceManagementReportsCachedReportConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13146 bb.baseURL += "/cachedReportConfigurations" 13147 return bb 13148 } 13149 13150 // DeviceManagementReportsCachedReportConfigurationsCollectionRequestBuilder is request builder for DeviceManagementCachedReportConfiguration collection 13151 type DeviceManagementReportsCachedReportConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } 13152 13153 // Request returns request for DeviceManagementCachedReportConfiguration collection 13154 func (b *DeviceManagementReportsCachedReportConfigurationsCollectionRequestBuilder) Request() *DeviceManagementReportsCachedReportConfigurationsCollectionRequest { 13155 return &DeviceManagementReportsCachedReportConfigurationsCollectionRequest{ 13156 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 13157 } 13158 } 13159 13160 // ID returns request builder for DeviceManagementCachedReportConfiguration item 13161 func (b *DeviceManagementReportsCachedReportConfigurationsCollectionRequestBuilder) ID(id string) *DeviceManagementCachedReportConfigurationRequestBuilder { 13162 bb := &DeviceManagementCachedReportConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13163 bb.baseURL += "/" + id 13164 return bb 13165 } 13166 13167 // DeviceManagementReportsCachedReportConfigurationsCollectionRequest is request for DeviceManagementCachedReportConfiguration collection 13168 type DeviceManagementReportsCachedReportConfigurationsCollectionRequest struct{ BaseRequest } 13169 13170 // Paging perfoms paging operation for DeviceManagementCachedReportConfiguration collection 13171 func (r *DeviceManagementReportsCachedReportConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementCachedReportConfiguration, error) { 13172 req, err := r.NewJSONRequest(method, path, obj) 13173 if err != nil { 13174 return nil, err 13175 } 13176 if ctx != nil { 13177 req = req.WithContext(ctx) 13178 } 13179 res, err := r.client.Do(req) 13180 if err != nil { 13181 return nil, err 13182 } 13183 var values []DeviceManagementCachedReportConfiguration 13184 for { 13185 if res.StatusCode != http.StatusOK { 13186 b, _ := ioutil.ReadAll(res.Body) 13187 res.Body.Close() 13188 errRes := &ErrorResponse{Response: res} 13189 err := jsonx.Unmarshal(b, errRes) 13190 if err != nil { 13191 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 13192 } 13193 return nil, errRes 13194 } 13195 var ( 13196 paging Paging 13197 value []DeviceManagementCachedReportConfiguration 13198 ) 13199 err := jsonx.NewDecoder(res.Body).Decode(&paging) 13200 res.Body.Close() 13201 if err != nil { 13202 return nil, err 13203 } 13204 err = jsonx.Unmarshal(paging.Value, &value) 13205 if err != nil { 13206 return nil, err 13207 } 13208 values = append(values, value...) 13209 if n >= 0 { 13210 n-- 13211 } 13212 if n == 0 || len(paging.NextLink) == 0 { 13213 return values, nil 13214 } 13215 req, err = http.NewRequest("GET", paging.NextLink, nil) 13216 if ctx != nil { 13217 req = req.WithContext(ctx) 13218 } 13219 res, err = r.client.Do(req) 13220 if err != nil { 13221 return nil, err 13222 } 13223 } 13224 } 13225 13226 // GetN performs GET request for DeviceManagementCachedReportConfiguration collection, max N pages 13227 func (r *DeviceManagementReportsCachedReportConfigurationsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementCachedReportConfiguration, error) { 13228 var query string 13229 if r.query != nil { 13230 query = "?" + r.query.Encode() 13231 } 13232 return r.Paging(ctx, "GET", query, nil, n) 13233 } 13234 13235 // Get performs GET request for DeviceManagementCachedReportConfiguration collection 13236 func (r *DeviceManagementReportsCachedReportConfigurationsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementCachedReportConfiguration, error) { 13237 return r.GetN(ctx, 0) 13238 } 13239 13240 // Add performs POST request for DeviceManagementCachedReportConfiguration collection 13241 func (r *DeviceManagementReportsCachedReportConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementCachedReportConfiguration) (resObj *DeviceManagementCachedReportConfiguration, err error) { 13242 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 13243 return 13244 } 13245 13246 // ExportJobs returns request builder for DeviceManagementExportJob collection 13247 func (b *DeviceManagementReportsRequestBuilder) ExportJobs() *DeviceManagementReportsExportJobsCollectionRequestBuilder { 13248 bb := &DeviceManagementReportsExportJobsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13249 bb.baseURL += "/exportJobs" 13250 return bb 13251 } 13252 13253 // DeviceManagementReportsExportJobsCollectionRequestBuilder is request builder for DeviceManagementExportJob collection 13254 type DeviceManagementReportsExportJobsCollectionRequestBuilder struct{ BaseRequestBuilder } 13255 13256 // Request returns request for DeviceManagementExportJob collection 13257 func (b *DeviceManagementReportsExportJobsCollectionRequestBuilder) Request() *DeviceManagementReportsExportJobsCollectionRequest { 13258 return &DeviceManagementReportsExportJobsCollectionRequest{ 13259 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 13260 } 13261 } 13262 13263 // ID returns request builder for DeviceManagementExportJob item 13264 func (b *DeviceManagementReportsExportJobsCollectionRequestBuilder) ID(id string) *DeviceManagementExportJobRequestBuilder { 13265 bb := &DeviceManagementExportJobRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13266 bb.baseURL += "/" + id 13267 return bb 13268 } 13269 13270 // DeviceManagementReportsExportJobsCollectionRequest is request for DeviceManagementExportJob collection 13271 type DeviceManagementReportsExportJobsCollectionRequest struct{ BaseRequest } 13272 13273 // Paging perfoms paging operation for DeviceManagementExportJob collection 13274 func (r *DeviceManagementReportsExportJobsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementExportJob, error) { 13275 req, err := r.NewJSONRequest(method, path, obj) 13276 if err != nil { 13277 return nil, err 13278 } 13279 if ctx != nil { 13280 req = req.WithContext(ctx) 13281 } 13282 res, err := r.client.Do(req) 13283 if err != nil { 13284 return nil, err 13285 } 13286 var values []DeviceManagementExportJob 13287 for { 13288 if res.StatusCode != http.StatusOK { 13289 b, _ := ioutil.ReadAll(res.Body) 13290 res.Body.Close() 13291 errRes := &ErrorResponse{Response: res} 13292 err := jsonx.Unmarshal(b, errRes) 13293 if err != nil { 13294 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 13295 } 13296 return nil, errRes 13297 } 13298 var ( 13299 paging Paging 13300 value []DeviceManagementExportJob 13301 ) 13302 err := jsonx.NewDecoder(res.Body).Decode(&paging) 13303 res.Body.Close() 13304 if err != nil { 13305 return nil, err 13306 } 13307 err = jsonx.Unmarshal(paging.Value, &value) 13308 if err != nil { 13309 return nil, err 13310 } 13311 values = append(values, value...) 13312 if n >= 0 { 13313 n-- 13314 } 13315 if n == 0 || len(paging.NextLink) == 0 { 13316 return values, nil 13317 } 13318 req, err = http.NewRequest("GET", paging.NextLink, nil) 13319 if ctx != nil { 13320 req = req.WithContext(ctx) 13321 } 13322 res, err = r.client.Do(req) 13323 if err != nil { 13324 return nil, err 13325 } 13326 } 13327 } 13328 13329 // GetN performs GET request for DeviceManagementExportJob collection, max N pages 13330 func (r *DeviceManagementReportsExportJobsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementExportJob, error) { 13331 var query string 13332 if r.query != nil { 13333 query = "?" + r.query.Encode() 13334 } 13335 return r.Paging(ctx, "GET", query, nil, n) 13336 } 13337 13338 // Get performs GET request for DeviceManagementExportJob collection 13339 func (r *DeviceManagementReportsExportJobsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementExportJob, error) { 13340 return r.GetN(ctx, 0) 13341 } 13342 13343 // Add performs POST request for DeviceManagementExportJob collection 13344 func (r *DeviceManagementReportsExportJobsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementExportJob) (resObj *DeviceManagementExportJob, err error) { 13345 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 13346 return 13347 } 13348 13349 // ReportSchedules returns request builder for DeviceManagementReportSchedule collection 13350 func (b *DeviceManagementReportsRequestBuilder) ReportSchedules() *DeviceManagementReportsReportSchedulesCollectionRequestBuilder { 13351 bb := &DeviceManagementReportsReportSchedulesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13352 bb.baseURL += "/reportSchedules" 13353 return bb 13354 } 13355 13356 // DeviceManagementReportsReportSchedulesCollectionRequestBuilder is request builder for DeviceManagementReportSchedule collection 13357 type DeviceManagementReportsReportSchedulesCollectionRequestBuilder struct{ BaseRequestBuilder } 13358 13359 // Request returns request for DeviceManagementReportSchedule collection 13360 func (b *DeviceManagementReportsReportSchedulesCollectionRequestBuilder) Request() *DeviceManagementReportsReportSchedulesCollectionRequest { 13361 return &DeviceManagementReportsReportSchedulesCollectionRequest{ 13362 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 13363 } 13364 } 13365 13366 // ID returns request builder for DeviceManagementReportSchedule item 13367 func (b *DeviceManagementReportsReportSchedulesCollectionRequestBuilder) ID(id string) *DeviceManagementReportScheduleRequestBuilder { 13368 bb := &DeviceManagementReportScheduleRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13369 bb.baseURL += "/" + id 13370 return bb 13371 } 13372 13373 // DeviceManagementReportsReportSchedulesCollectionRequest is request for DeviceManagementReportSchedule collection 13374 type DeviceManagementReportsReportSchedulesCollectionRequest struct{ BaseRequest } 13375 13376 // Paging perfoms paging operation for DeviceManagementReportSchedule collection 13377 func (r *DeviceManagementReportsReportSchedulesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementReportSchedule, error) { 13378 req, err := r.NewJSONRequest(method, path, obj) 13379 if err != nil { 13380 return nil, err 13381 } 13382 if ctx != nil { 13383 req = req.WithContext(ctx) 13384 } 13385 res, err := r.client.Do(req) 13386 if err != nil { 13387 return nil, err 13388 } 13389 var values []DeviceManagementReportSchedule 13390 for { 13391 if res.StatusCode != http.StatusOK { 13392 b, _ := ioutil.ReadAll(res.Body) 13393 res.Body.Close() 13394 errRes := &ErrorResponse{Response: res} 13395 err := jsonx.Unmarshal(b, errRes) 13396 if err != nil { 13397 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 13398 } 13399 return nil, errRes 13400 } 13401 var ( 13402 paging Paging 13403 value []DeviceManagementReportSchedule 13404 ) 13405 err := jsonx.NewDecoder(res.Body).Decode(&paging) 13406 res.Body.Close() 13407 if err != nil { 13408 return nil, err 13409 } 13410 err = jsonx.Unmarshal(paging.Value, &value) 13411 if err != nil { 13412 return nil, err 13413 } 13414 values = append(values, value...) 13415 if n >= 0 { 13416 n-- 13417 } 13418 if n == 0 || len(paging.NextLink) == 0 { 13419 return values, nil 13420 } 13421 req, err = http.NewRequest("GET", paging.NextLink, nil) 13422 if ctx != nil { 13423 req = req.WithContext(ctx) 13424 } 13425 res, err = r.client.Do(req) 13426 if err != nil { 13427 return nil, err 13428 } 13429 } 13430 } 13431 13432 // GetN performs GET request for DeviceManagementReportSchedule collection, max N pages 13433 func (r *DeviceManagementReportsReportSchedulesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementReportSchedule, error) { 13434 var query string 13435 if r.query != nil { 13436 query = "?" + r.query.Encode() 13437 } 13438 return r.Paging(ctx, "GET", query, nil, n) 13439 } 13440 13441 // Get performs GET request for DeviceManagementReportSchedule collection 13442 func (r *DeviceManagementReportsReportSchedulesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementReportSchedule, error) { 13443 return r.GetN(ctx, 0) 13444 } 13445 13446 // Add performs POST request for DeviceManagementReportSchedule collection 13447 func (r *DeviceManagementReportsReportSchedulesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementReportSchedule) (resObj *DeviceManagementReportSchedule, err error) { 13448 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 13449 return 13450 } 13451 13452 // Assignments returns request builder for DeviceManagementScriptAssignment collection 13453 func (b *DeviceManagementScriptRequestBuilder) Assignments() *DeviceManagementScriptAssignmentsCollectionRequestBuilder { 13454 bb := &DeviceManagementScriptAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13455 bb.baseURL += "/assignments" 13456 return bb 13457 } 13458 13459 // DeviceManagementScriptAssignmentsCollectionRequestBuilder is request builder for DeviceManagementScriptAssignment collection 13460 type DeviceManagementScriptAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder } 13461 13462 // Request returns request for DeviceManagementScriptAssignment collection 13463 func (b *DeviceManagementScriptAssignmentsCollectionRequestBuilder) Request() *DeviceManagementScriptAssignmentsCollectionRequest { 13464 return &DeviceManagementScriptAssignmentsCollectionRequest{ 13465 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 13466 } 13467 } 13468 13469 // ID returns request builder for DeviceManagementScriptAssignment item 13470 func (b *DeviceManagementScriptAssignmentsCollectionRequestBuilder) ID(id string) *DeviceManagementScriptAssignmentRequestBuilder { 13471 bb := &DeviceManagementScriptAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13472 bb.baseURL += "/" + id 13473 return bb 13474 } 13475 13476 // DeviceManagementScriptAssignmentsCollectionRequest is request for DeviceManagementScriptAssignment collection 13477 type DeviceManagementScriptAssignmentsCollectionRequest struct{ BaseRequest } 13478 13479 // Paging perfoms paging operation for DeviceManagementScriptAssignment collection 13480 func (r *DeviceManagementScriptAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementScriptAssignment, error) { 13481 req, err := r.NewJSONRequest(method, path, obj) 13482 if err != nil { 13483 return nil, err 13484 } 13485 if ctx != nil { 13486 req = req.WithContext(ctx) 13487 } 13488 res, err := r.client.Do(req) 13489 if err != nil { 13490 return nil, err 13491 } 13492 var values []DeviceManagementScriptAssignment 13493 for { 13494 if res.StatusCode != http.StatusOK { 13495 b, _ := ioutil.ReadAll(res.Body) 13496 res.Body.Close() 13497 errRes := &ErrorResponse{Response: res} 13498 err := jsonx.Unmarshal(b, errRes) 13499 if err != nil { 13500 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 13501 } 13502 return nil, errRes 13503 } 13504 var ( 13505 paging Paging 13506 value []DeviceManagementScriptAssignment 13507 ) 13508 err := jsonx.NewDecoder(res.Body).Decode(&paging) 13509 res.Body.Close() 13510 if err != nil { 13511 return nil, err 13512 } 13513 err = jsonx.Unmarshal(paging.Value, &value) 13514 if err != nil { 13515 return nil, err 13516 } 13517 values = append(values, value...) 13518 if n >= 0 { 13519 n-- 13520 } 13521 if n == 0 || len(paging.NextLink) == 0 { 13522 return values, nil 13523 } 13524 req, err = http.NewRequest("GET", paging.NextLink, nil) 13525 if ctx != nil { 13526 req = req.WithContext(ctx) 13527 } 13528 res, err = r.client.Do(req) 13529 if err != nil { 13530 return nil, err 13531 } 13532 } 13533 } 13534 13535 // GetN performs GET request for DeviceManagementScriptAssignment collection, max N pages 13536 func (r *DeviceManagementScriptAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementScriptAssignment, error) { 13537 var query string 13538 if r.query != nil { 13539 query = "?" + r.query.Encode() 13540 } 13541 return r.Paging(ctx, "GET", query, nil, n) 13542 } 13543 13544 // Get performs GET request for DeviceManagementScriptAssignment collection 13545 func (r *DeviceManagementScriptAssignmentsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementScriptAssignment, error) { 13546 return r.GetN(ctx, 0) 13547 } 13548 13549 // Add performs POST request for DeviceManagementScriptAssignment collection 13550 func (r *DeviceManagementScriptAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementScriptAssignment) (resObj *DeviceManagementScriptAssignment, err error) { 13551 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 13552 return 13553 } 13554 13555 // DeviceRunStates returns request builder for DeviceManagementScriptDeviceState collection 13556 func (b *DeviceManagementScriptRequestBuilder) DeviceRunStates() *DeviceManagementScriptDeviceRunStatesCollectionRequestBuilder { 13557 bb := &DeviceManagementScriptDeviceRunStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13558 bb.baseURL += "/deviceRunStates" 13559 return bb 13560 } 13561 13562 // DeviceManagementScriptDeviceRunStatesCollectionRequestBuilder is request builder for DeviceManagementScriptDeviceState collection 13563 type DeviceManagementScriptDeviceRunStatesCollectionRequestBuilder struct{ BaseRequestBuilder } 13564 13565 // Request returns request for DeviceManagementScriptDeviceState collection 13566 func (b *DeviceManagementScriptDeviceRunStatesCollectionRequestBuilder) Request() *DeviceManagementScriptDeviceRunStatesCollectionRequest { 13567 return &DeviceManagementScriptDeviceRunStatesCollectionRequest{ 13568 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 13569 } 13570 } 13571 13572 // ID returns request builder for DeviceManagementScriptDeviceState item 13573 func (b *DeviceManagementScriptDeviceRunStatesCollectionRequestBuilder) ID(id string) *DeviceManagementScriptDeviceStateRequestBuilder { 13574 bb := &DeviceManagementScriptDeviceStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13575 bb.baseURL += "/" + id 13576 return bb 13577 } 13578 13579 // DeviceManagementScriptDeviceRunStatesCollectionRequest is request for DeviceManagementScriptDeviceState collection 13580 type DeviceManagementScriptDeviceRunStatesCollectionRequest struct{ BaseRequest } 13581 13582 // Paging perfoms paging operation for DeviceManagementScriptDeviceState collection 13583 func (r *DeviceManagementScriptDeviceRunStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementScriptDeviceState, error) { 13584 req, err := r.NewJSONRequest(method, path, obj) 13585 if err != nil { 13586 return nil, err 13587 } 13588 if ctx != nil { 13589 req = req.WithContext(ctx) 13590 } 13591 res, err := r.client.Do(req) 13592 if err != nil { 13593 return nil, err 13594 } 13595 var values []DeviceManagementScriptDeviceState 13596 for { 13597 if res.StatusCode != http.StatusOK { 13598 b, _ := ioutil.ReadAll(res.Body) 13599 res.Body.Close() 13600 errRes := &ErrorResponse{Response: res} 13601 err := jsonx.Unmarshal(b, errRes) 13602 if err != nil { 13603 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 13604 } 13605 return nil, errRes 13606 } 13607 var ( 13608 paging Paging 13609 value []DeviceManagementScriptDeviceState 13610 ) 13611 err := jsonx.NewDecoder(res.Body).Decode(&paging) 13612 res.Body.Close() 13613 if err != nil { 13614 return nil, err 13615 } 13616 err = jsonx.Unmarshal(paging.Value, &value) 13617 if err != nil { 13618 return nil, err 13619 } 13620 values = append(values, value...) 13621 if n >= 0 { 13622 n-- 13623 } 13624 if n == 0 || len(paging.NextLink) == 0 { 13625 return values, nil 13626 } 13627 req, err = http.NewRequest("GET", paging.NextLink, nil) 13628 if ctx != nil { 13629 req = req.WithContext(ctx) 13630 } 13631 res, err = r.client.Do(req) 13632 if err != nil { 13633 return nil, err 13634 } 13635 } 13636 } 13637 13638 // GetN performs GET request for DeviceManagementScriptDeviceState collection, max N pages 13639 func (r *DeviceManagementScriptDeviceRunStatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementScriptDeviceState, error) { 13640 var query string 13641 if r.query != nil { 13642 query = "?" + r.query.Encode() 13643 } 13644 return r.Paging(ctx, "GET", query, nil, n) 13645 } 13646 13647 // Get performs GET request for DeviceManagementScriptDeviceState collection 13648 func (r *DeviceManagementScriptDeviceRunStatesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementScriptDeviceState, error) { 13649 return r.GetN(ctx, 0) 13650 } 13651 13652 // Add performs POST request for DeviceManagementScriptDeviceState collection 13653 func (r *DeviceManagementScriptDeviceRunStatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementScriptDeviceState) (resObj *DeviceManagementScriptDeviceState, err error) { 13654 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 13655 return 13656 } 13657 13658 // GroupAssignments returns request builder for DeviceManagementScriptGroupAssignment collection 13659 func (b *DeviceManagementScriptRequestBuilder) GroupAssignments() *DeviceManagementScriptGroupAssignmentsCollectionRequestBuilder { 13660 bb := &DeviceManagementScriptGroupAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13661 bb.baseURL += "/groupAssignments" 13662 return bb 13663 } 13664 13665 // DeviceManagementScriptGroupAssignmentsCollectionRequestBuilder is request builder for DeviceManagementScriptGroupAssignment collection 13666 type DeviceManagementScriptGroupAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder } 13667 13668 // Request returns request for DeviceManagementScriptGroupAssignment collection 13669 func (b *DeviceManagementScriptGroupAssignmentsCollectionRequestBuilder) Request() *DeviceManagementScriptGroupAssignmentsCollectionRequest { 13670 return &DeviceManagementScriptGroupAssignmentsCollectionRequest{ 13671 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 13672 } 13673 } 13674 13675 // ID returns request builder for DeviceManagementScriptGroupAssignment item 13676 func (b *DeviceManagementScriptGroupAssignmentsCollectionRequestBuilder) ID(id string) *DeviceManagementScriptGroupAssignmentRequestBuilder { 13677 bb := &DeviceManagementScriptGroupAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13678 bb.baseURL += "/" + id 13679 return bb 13680 } 13681 13682 // DeviceManagementScriptGroupAssignmentsCollectionRequest is request for DeviceManagementScriptGroupAssignment collection 13683 type DeviceManagementScriptGroupAssignmentsCollectionRequest struct{ BaseRequest } 13684 13685 // Paging perfoms paging operation for DeviceManagementScriptGroupAssignment collection 13686 func (r *DeviceManagementScriptGroupAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementScriptGroupAssignment, error) { 13687 req, err := r.NewJSONRequest(method, path, obj) 13688 if err != nil { 13689 return nil, err 13690 } 13691 if ctx != nil { 13692 req = req.WithContext(ctx) 13693 } 13694 res, err := r.client.Do(req) 13695 if err != nil { 13696 return nil, err 13697 } 13698 var values []DeviceManagementScriptGroupAssignment 13699 for { 13700 if res.StatusCode != http.StatusOK { 13701 b, _ := ioutil.ReadAll(res.Body) 13702 res.Body.Close() 13703 errRes := &ErrorResponse{Response: res} 13704 err := jsonx.Unmarshal(b, errRes) 13705 if err != nil { 13706 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 13707 } 13708 return nil, errRes 13709 } 13710 var ( 13711 paging Paging 13712 value []DeviceManagementScriptGroupAssignment 13713 ) 13714 err := jsonx.NewDecoder(res.Body).Decode(&paging) 13715 res.Body.Close() 13716 if err != nil { 13717 return nil, err 13718 } 13719 err = jsonx.Unmarshal(paging.Value, &value) 13720 if err != nil { 13721 return nil, err 13722 } 13723 values = append(values, value...) 13724 if n >= 0 { 13725 n-- 13726 } 13727 if n == 0 || len(paging.NextLink) == 0 { 13728 return values, nil 13729 } 13730 req, err = http.NewRequest("GET", paging.NextLink, nil) 13731 if ctx != nil { 13732 req = req.WithContext(ctx) 13733 } 13734 res, err = r.client.Do(req) 13735 if err != nil { 13736 return nil, err 13737 } 13738 } 13739 } 13740 13741 // GetN performs GET request for DeviceManagementScriptGroupAssignment collection, max N pages 13742 func (r *DeviceManagementScriptGroupAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementScriptGroupAssignment, error) { 13743 var query string 13744 if r.query != nil { 13745 query = "?" + r.query.Encode() 13746 } 13747 return r.Paging(ctx, "GET", query, nil, n) 13748 } 13749 13750 // Get performs GET request for DeviceManagementScriptGroupAssignment collection 13751 func (r *DeviceManagementScriptGroupAssignmentsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementScriptGroupAssignment, error) { 13752 return r.GetN(ctx, 0) 13753 } 13754 13755 // Add performs POST request for DeviceManagementScriptGroupAssignment collection 13756 func (r *DeviceManagementScriptGroupAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementScriptGroupAssignment) (resObj *DeviceManagementScriptGroupAssignment, err error) { 13757 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 13758 return 13759 } 13760 13761 // RunSummary is navigation property 13762 func (b *DeviceManagementScriptRequestBuilder) RunSummary() *DeviceManagementScriptRunSummaryRequestBuilder { 13763 bb := &DeviceManagementScriptRunSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13764 bb.baseURL += "/runSummary" 13765 return bb 13766 } 13767 13768 // UserRunStates returns request builder for DeviceManagementScriptUserState collection 13769 func (b *DeviceManagementScriptRequestBuilder) UserRunStates() *DeviceManagementScriptUserRunStatesCollectionRequestBuilder { 13770 bb := &DeviceManagementScriptUserRunStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13771 bb.baseURL += "/userRunStates" 13772 return bb 13773 } 13774 13775 // DeviceManagementScriptUserRunStatesCollectionRequestBuilder is request builder for DeviceManagementScriptUserState collection 13776 type DeviceManagementScriptUserRunStatesCollectionRequestBuilder struct{ BaseRequestBuilder } 13777 13778 // Request returns request for DeviceManagementScriptUserState collection 13779 func (b *DeviceManagementScriptUserRunStatesCollectionRequestBuilder) Request() *DeviceManagementScriptUserRunStatesCollectionRequest { 13780 return &DeviceManagementScriptUserRunStatesCollectionRequest{ 13781 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 13782 } 13783 } 13784 13785 // ID returns request builder for DeviceManagementScriptUserState item 13786 func (b *DeviceManagementScriptUserRunStatesCollectionRequestBuilder) ID(id string) *DeviceManagementScriptUserStateRequestBuilder { 13787 bb := &DeviceManagementScriptUserStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13788 bb.baseURL += "/" + id 13789 return bb 13790 } 13791 13792 // DeviceManagementScriptUserRunStatesCollectionRequest is request for DeviceManagementScriptUserState collection 13793 type DeviceManagementScriptUserRunStatesCollectionRequest struct{ BaseRequest } 13794 13795 // Paging perfoms paging operation for DeviceManagementScriptUserState collection 13796 func (r *DeviceManagementScriptUserRunStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementScriptUserState, error) { 13797 req, err := r.NewJSONRequest(method, path, obj) 13798 if err != nil { 13799 return nil, err 13800 } 13801 if ctx != nil { 13802 req = req.WithContext(ctx) 13803 } 13804 res, err := r.client.Do(req) 13805 if err != nil { 13806 return nil, err 13807 } 13808 var values []DeviceManagementScriptUserState 13809 for { 13810 if res.StatusCode != http.StatusOK { 13811 b, _ := ioutil.ReadAll(res.Body) 13812 res.Body.Close() 13813 errRes := &ErrorResponse{Response: res} 13814 err := jsonx.Unmarshal(b, errRes) 13815 if err != nil { 13816 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 13817 } 13818 return nil, errRes 13819 } 13820 var ( 13821 paging Paging 13822 value []DeviceManagementScriptUserState 13823 ) 13824 err := jsonx.NewDecoder(res.Body).Decode(&paging) 13825 res.Body.Close() 13826 if err != nil { 13827 return nil, err 13828 } 13829 err = jsonx.Unmarshal(paging.Value, &value) 13830 if err != nil { 13831 return nil, err 13832 } 13833 values = append(values, value...) 13834 if n >= 0 { 13835 n-- 13836 } 13837 if n == 0 || len(paging.NextLink) == 0 { 13838 return values, nil 13839 } 13840 req, err = http.NewRequest("GET", paging.NextLink, nil) 13841 if ctx != nil { 13842 req = req.WithContext(ctx) 13843 } 13844 res, err = r.client.Do(req) 13845 if err != nil { 13846 return nil, err 13847 } 13848 } 13849 } 13850 13851 // GetN performs GET request for DeviceManagementScriptUserState collection, max N pages 13852 func (r *DeviceManagementScriptUserRunStatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementScriptUserState, error) { 13853 var query string 13854 if r.query != nil { 13855 query = "?" + r.query.Encode() 13856 } 13857 return r.Paging(ctx, "GET", query, nil, n) 13858 } 13859 13860 // Get performs GET request for DeviceManagementScriptUserState collection 13861 func (r *DeviceManagementScriptUserRunStatesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementScriptUserState, error) { 13862 return r.GetN(ctx, 0) 13863 } 13864 13865 // Add performs POST request for DeviceManagementScriptUserState collection 13866 func (r *DeviceManagementScriptUserRunStatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementScriptUserState) (resObj *DeviceManagementScriptUserState, err error) { 13867 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 13868 return 13869 } 13870 13871 // ManagedDevice is navigation property 13872 func (b *DeviceManagementScriptDeviceStateRequestBuilder) ManagedDevice() *ManagedDeviceRequestBuilder { 13873 bb := &ManagedDeviceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13874 bb.baseURL += "/managedDevice" 13875 return bb 13876 } 13877 13878 // DeviceRunStates returns request builder for DeviceManagementScriptDeviceState collection 13879 func (b *DeviceManagementScriptUserStateRequestBuilder) DeviceRunStates() *DeviceManagementScriptUserStateDeviceRunStatesCollectionRequestBuilder { 13880 bb := &DeviceManagementScriptUserStateDeviceRunStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13881 bb.baseURL += "/deviceRunStates" 13882 return bb 13883 } 13884 13885 // DeviceManagementScriptUserStateDeviceRunStatesCollectionRequestBuilder is request builder for DeviceManagementScriptDeviceState collection 13886 type DeviceManagementScriptUserStateDeviceRunStatesCollectionRequestBuilder struct{ BaseRequestBuilder } 13887 13888 // Request returns request for DeviceManagementScriptDeviceState collection 13889 func (b *DeviceManagementScriptUserStateDeviceRunStatesCollectionRequestBuilder) Request() *DeviceManagementScriptUserStateDeviceRunStatesCollectionRequest { 13890 return &DeviceManagementScriptUserStateDeviceRunStatesCollectionRequest{ 13891 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 13892 } 13893 } 13894 13895 // ID returns request builder for DeviceManagementScriptDeviceState item 13896 func (b *DeviceManagementScriptUserStateDeviceRunStatesCollectionRequestBuilder) ID(id string) *DeviceManagementScriptDeviceStateRequestBuilder { 13897 bb := &DeviceManagementScriptDeviceStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13898 bb.baseURL += "/" + id 13899 return bb 13900 } 13901 13902 // DeviceManagementScriptUserStateDeviceRunStatesCollectionRequest is request for DeviceManagementScriptDeviceState collection 13903 type DeviceManagementScriptUserStateDeviceRunStatesCollectionRequest struct{ BaseRequest } 13904 13905 // Paging perfoms paging operation for DeviceManagementScriptDeviceState collection 13906 func (r *DeviceManagementScriptUserStateDeviceRunStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementScriptDeviceState, error) { 13907 req, err := r.NewJSONRequest(method, path, obj) 13908 if err != nil { 13909 return nil, err 13910 } 13911 if ctx != nil { 13912 req = req.WithContext(ctx) 13913 } 13914 res, err := r.client.Do(req) 13915 if err != nil { 13916 return nil, err 13917 } 13918 var values []DeviceManagementScriptDeviceState 13919 for { 13920 if res.StatusCode != http.StatusOK { 13921 b, _ := ioutil.ReadAll(res.Body) 13922 res.Body.Close() 13923 errRes := &ErrorResponse{Response: res} 13924 err := jsonx.Unmarshal(b, errRes) 13925 if err != nil { 13926 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 13927 } 13928 return nil, errRes 13929 } 13930 var ( 13931 paging Paging 13932 value []DeviceManagementScriptDeviceState 13933 ) 13934 err := jsonx.NewDecoder(res.Body).Decode(&paging) 13935 res.Body.Close() 13936 if err != nil { 13937 return nil, err 13938 } 13939 err = jsonx.Unmarshal(paging.Value, &value) 13940 if err != nil { 13941 return nil, err 13942 } 13943 values = append(values, value...) 13944 if n >= 0 { 13945 n-- 13946 } 13947 if n == 0 || len(paging.NextLink) == 0 { 13948 return values, nil 13949 } 13950 req, err = http.NewRequest("GET", paging.NextLink, nil) 13951 if ctx != nil { 13952 req = req.WithContext(ctx) 13953 } 13954 res, err = r.client.Do(req) 13955 if err != nil { 13956 return nil, err 13957 } 13958 } 13959 } 13960 13961 // GetN performs GET request for DeviceManagementScriptDeviceState collection, max N pages 13962 func (r *DeviceManagementScriptUserStateDeviceRunStatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementScriptDeviceState, error) { 13963 var query string 13964 if r.query != nil { 13965 query = "?" + r.query.Encode() 13966 } 13967 return r.Paging(ctx, "GET", query, nil, n) 13968 } 13969 13970 // Get performs GET request for DeviceManagementScriptDeviceState collection 13971 func (r *DeviceManagementScriptUserStateDeviceRunStatesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementScriptDeviceState, error) { 13972 return r.GetN(ctx, 0) 13973 } 13974 13975 // Add performs POST request for DeviceManagementScriptDeviceState collection 13976 func (r *DeviceManagementScriptUserStateDeviceRunStatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementScriptDeviceState) (resObj *DeviceManagementScriptDeviceState, err error) { 13977 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 13978 return 13979 } 13980 13981 // SettingDefinitions returns request builder for DeviceManagementSettingDefinition collection 13982 func (b *DeviceManagementSettingCategoryRequestBuilder) SettingDefinitions() *DeviceManagementSettingCategorySettingDefinitionsCollectionRequestBuilder { 13983 bb := &DeviceManagementSettingCategorySettingDefinitionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 13984 bb.baseURL += "/settingDefinitions" 13985 return bb 13986 } 13987 13988 // DeviceManagementSettingCategorySettingDefinitionsCollectionRequestBuilder is request builder for DeviceManagementSettingDefinition collection 13989 type DeviceManagementSettingCategorySettingDefinitionsCollectionRequestBuilder struct{ BaseRequestBuilder } 13990 13991 // Request returns request for DeviceManagementSettingDefinition collection 13992 func (b *DeviceManagementSettingCategorySettingDefinitionsCollectionRequestBuilder) Request() *DeviceManagementSettingCategorySettingDefinitionsCollectionRequest { 13993 return &DeviceManagementSettingCategorySettingDefinitionsCollectionRequest{ 13994 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 13995 } 13996 } 13997 13998 // ID returns request builder for DeviceManagementSettingDefinition item 13999 func (b *DeviceManagementSettingCategorySettingDefinitionsCollectionRequestBuilder) ID(id string) *DeviceManagementSettingDefinitionRequestBuilder { 14000 bb := &DeviceManagementSettingDefinitionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 14001 bb.baseURL += "/" + id 14002 return bb 14003 } 14004 14005 // DeviceManagementSettingCategorySettingDefinitionsCollectionRequest is request for DeviceManagementSettingDefinition collection 14006 type DeviceManagementSettingCategorySettingDefinitionsCollectionRequest struct{ BaseRequest } 14007 14008 // Paging perfoms paging operation for DeviceManagementSettingDefinition collection 14009 func (r *DeviceManagementSettingCategorySettingDefinitionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementSettingDefinition, error) { 14010 req, err := r.NewJSONRequest(method, path, obj) 14011 if err != nil { 14012 return nil, err 14013 } 14014 if ctx != nil { 14015 req = req.WithContext(ctx) 14016 } 14017 res, err := r.client.Do(req) 14018 if err != nil { 14019 return nil, err 14020 } 14021 var values []DeviceManagementSettingDefinition 14022 for { 14023 if res.StatusCode != http.StatusOK { 14024 b, _ := ioutil.ReadAll(res.Body) 14025 res.Body.Close() 14026 errRes := &ErrorResponse{Response: res} 14027 err := jsonx.Unmarshal(b, errRes) 14028 if err != nil { 14029 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 14030 } 14031 return nil, errRes 14032 } 14033 var ( 14034 paging Paging 14035 value []DeviceManagementSettingDefinition 14036 ) 14037 err := jsonx.NewDecoder(res.Body).Decode(&paging) 14038 res.Body.Close() 14039 if err != nil { 14040 return nil, err 14041 } 14042 err = jsonx.Unmarshal(paging.Value, &value) 14043 if err != nil { 14044 return nil, err 14045 } 14046 values = append(values, value...) 14047 if n >= 0 { 14048 n-- 14049 } 14050 if n == 0 || len(paging.NextLink) == 0 { 14051 return values, nil 14052 } 14053 req, err = http.NewRequest("GET", paging.NextLink, nil) 14054 if ctx != nil { 14055 req = req.WithContext(ctx) 14056 } 14057 res, err = r.client.Do(req) 14058 if err != nil { 14059 return nil, err 14060 } 14061 } 14062 } 14063 14064 // GetN performs GET request for DeviceManagementSettingDefinition collection, max N pages 14065 func (r *DeviceManagementSettingCategorySettingDefinitionsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementSettingDefinition, error) { 14066 var query string 14067 if r.query != nil { 14068 query = "?" + r.query.Encode() 14069 } 14070 return r.Paging(ctx, "GET", query, nil, n) 14071 } 14072 14073 // Get performs GET request for DeviceManagementSettingDefinition collection 14074 func (r *DeviceManagementSettingCategorySettingDefinitionsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingDefinition, error) { 14075 return r.GetN(ctx, 0) 14076 } 14077 14078 // Add performs POST request for DeviceManagementSettingDefinition collection 14079 func (r *DeviceManagementSettingCategorySettingDefinitionsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingDefinition) (resObj *DeviceManagementSettingDefinition, err error) { 14080 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 14081 return 14082 } 14083 14084 // Categories returns request builder for DeviceManagementTemplateSettingCategory collection 14085 func (b *DeviceManagementTemplateRequestBuilder) Categories() *DeviceManagementTemplateCategoriesCollectionRequestBuilder { 14086 bb := &DeviceManagementTemplateCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 14087 bb.baseURL += "/categories" 14088 return bb 14089 } 14090 14091 // DeviceManagementTemplateCategoriesCollectionRequestBuilder is request builder for DeviceManagementTemplateSettingCategory collection 14092 type DeviceManagementTemplateCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder } 14093 14094 // Request returns request for DeviceManagementTemplateSettingCategory collection 14095 func (b *DeviceManagementTemplateCategoriesCollectionRequestBuilder) Request() *DeviceManagementTemplateCategoriesCollectionRequest { 14096 return &DeviceManagementTemplateCategoriesCollectionRequest{ 14097 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 14098 } 14099 } 14100 14101 // ID returns request builder for DeviceManagementTemplateSettingCategory item 14102 func (b *DeviceManagementTemplateCategoriesCollectionRequestBuilder) ID(id string) *DeviceManagementTemplateSettingCategoryRequestBuilder { 14103 bb := &DeviceManagementTemplateSettingCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 14104 bb.baseURL += "/" + id 14105 return bb 14106 } 14107 14108 // DeviceManagementTemplateCategoriesCollectionRequest is request for DeviceManagementTemplateSettingCategory collection 14109 type DeviceManagementTemplateCategoriesCollectionRequest struct{ BaseRequest } 14110 14111 // Paging perfoms paging operation for DeviceManagementTemplateSettingCategory collection 14112 func (r *DeviceManagementTemplateCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementTemplateSettingCategory, error) { 14113 req, err := r.NewJSONRequest(method, path, obj) 14114 if err != nil { 14115 return nil, err 14116 } 14117 if ctx != nil { 14118 req = req.WithContext(ctx) 14119 } 14120 res, err := r.client.Do(req) 14121 if err != nil { 14122 return nil, err 14123 } 14124 var values []DeviceManagementTemplateSettingCategory 14125 for { 14126 if res.StatusCode != http.StatusOK { 14127 b, _ := ioutil.ReadAll(res.Body) 14128 res.Body.Close() 14129 errRes := &ErrorResponse{Response: res} 14130 err := jsonx.Unmarshal(b, errRes) 14131 if err != nil { 14132 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 14133 } 14134 return nil, errRes 14135 } 14136 var ( 14137 paging Paging 14138 value []DeviceManagementTemplateSettingCategory 14139 ) 14140 err := jsonx.NewDecoder(res.Body).Decode(&paging) 14141 res.Body.Close() 14142 if err != nil { 14143 return nil, err 14144 } 14145 err = jsonx.Unmarshal(paging.Value, &value) 14146 if err != nil { 14147 return nil, err 14148 } 14149 values = append(values, value...) 14150 if n >= 0 { 14151 n-- 14152 } 14153 if n == 0 || len(paging.NextLink) == 0 { 14154 return values, nil 14155 } 14156 req, err = http.NewRequest("GET", paging.NextLink, nil) 14157 if ctx != nil { 14158 req = req.WithContext(ctx) 14159 } 14160 res, err = r.client.Do(req) 14161 if err != nil { 14162 return nil, err 14163 } 14164 } 14165 } 14166 14167 // GetN performs GET request for DeviceManagementTemplateSettingCategory collection, max N pages 14168 func (r *DeviceManagementTemplateCategoriesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementTemplateSettingCategory, error) { 14169 var query string 14170 if r.query != nil { 14171 query = "?" + r.query.Encode() 14172 } 14173 return r.Paging(ctx, "GET", query, nil, n) 14174 } 14175 14176 // Get performs GET request for DeviceManagementTemplateSettingCategory collection 14177 func (r *DeviceManagementTemplateCategoriesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementTemplateSettingCategory, error) { 14178 return r.GetN(ctx, 0) 14179 } 14180 14181 // Add performs POST request for DeviceManagementTemplateSettingCategory collection 14182 func (r *DeviceManagementTemplateCategoriesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementTemplateSettingCategory) (resObj *DeviceManagementTemplateSettingCategory, err error) { 14183 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 14184 return 14185 } 14186 14187 // MigratableTo returns request builder for DeviceManagementTemplate collection 14188 func (b *DeviceManagementTemplateRequestBuilder) MigratableTo() *DeviceManagementTemplateMigratableToCollectionRequestBuilder { 14189 bb := &DeviceManagementTemplateMigratableToCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 14190 bb.baseURL += "/migratableTo" 14191 return bb 14192 } 14193 14194 // DeviceManagementTemplateMigratableToCollectionRequestBuilder is request builder for DeviceManagementTemplate collection 14195 type DeviceManagementTemplateMigratableToCollectionRequestBuilder struct{ BaseRequestBuilder } 14196 14197 // Request returns request for DeviceManagementTemplate collection 14198 func (b *DeviceManagementTemplateMigratableToCollectionRequestBuilder) Request() *DeviceManagementTemplateMigratableToCollectionRequest { 14199 return &DeviceManagementTemplateMigratableToCollectionRequest{ 14200 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 14201 } 14202 } 14203 14204 // ID returns request builder for DeviceManagementTemplate item 14205 func (b *DeviceManagementTemplateMigratableToCollectionRequestBuilder) ID(id string) *DeviceManagementTemplateRequestBuilder { 14206 bb := &DeviceManagementTemplateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 14207 bb.baseURL += "/" + id 14208 return bb 14209 } 14210 14211 // DeviceManagementTemplateMigratableToCollectionRequest is request for DeviceManagementTemplate collection 14212 type DeviceManagementTemplateMigratableToCollectionRequest struct{ BaseRequest } 14213 14214 // Paging perfoms paging operation for DeviceManagementTemplate collection 14215 func (r *DeviceManagementTemplateMigratableToCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementTemplate, error) { 14216 req, err := r.NewJSONRequest(method, path, obj) 14217 if err != nil { 14218 return nil, err 14219 } 14220 if ctx != nil { 14221 req = req.WithContext(ctx) 14222 } 14223 res, err := r.client.Do(req) 14224 if err != nil { 14225 return nil, err 14226 } 14227 var values []DeviceManagementTemplate 14228 for { 14229 if res.StatusCode != http.StatusOK { 14230 b, _ := ioutil.ReadAll(res.Body) 14231 res.Body.Close() 14232 errRes := &ErrorResponse{Response: res} 14233 err := jsonx.Unmarshal(b, errRes) 14234 if err != nil { 14235 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 14236 } 14237 return nil, errRes 14238 } 14239 var ( 14240 paging Paging 14241 value []DeviceManagementTemplate 14242 ) 14243 err := jsonx.NewDecoder(res.Body).Decode(&paging) 14244 res.Body.Close() 14245 if err != nil { 14246 return nil, err 14247 } 14248 err = jsonx.Unmarshal(paging.Value, &value) 14249 if err != nil { 14250 return nil, err 14251 } 14252 values = append(values, value...) 14253 if n >= 0 { 14254 n-- 14255 } 14256 if n == 0 || len(paging.NextLink) == 0 { 14257 return values, nil 14258 } 14259 req, err = http.NewRequest("GET", paging.NextLink, nil) 14260 if ctx != nil { 14261 req = req.WithContext(ctx) 14262 } 14263 res, err = r.client.Do(req) 14264 if err != nil { 14265 return nil, err 14266 } 14267 } 14268 } 14269 14270 // GetN performs GET request for DeviceManagementTemplate collection, max N pages 14271 func (r *DeviceManagementTemplateMigratableToCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementTemplate, error) { 14272 var query string 14273 if r.query != nil { 14274 query = "?" + r.query.Encode() 14275 } 14276 return r.Paging(ctx, "GET", query, nil, n) 14277 } 14278 14279 // Get performs GET request for DeviceManagementTemplate collection 14280 func (r *DeviceManagementTemplateMigratableToCollectionRequest) Get(ctx context.Context) ([]DeviceManagementTemplate, error) { 14281 return r.GetN(ctx, 0) 14282 } 14283 14284 // Add performs POST request for DeviceManagementTemplate collection 14285 func (r *DeviceManagementTemplateMigratableToCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementTemplate) (resObj *DeviceManagementTemplate, err error) { 14286 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 14287 return 14288 } 14289 14290 // Settings returns request builder for DeviceManagementSettingInstance collection 14291 func (b *DeviceManagementTemplateRequestBuilder) Settings() *DeviceManagementTemplateSettingsCollectionRequestBuilder { 14292 bb := &DeviceManagementTemplateSettingsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 14293 bb.baseURL += "/settings" 14294 return bb 14295 } 14296 14297 // DeviceManagementTemplateSettingsCollectionRequestBuilder is request builder for DeviceManagementSettingInstance collection 14298 type DeviceManagementTemplateSettingsCollectionRequestBuilder struct{ BaseRequestBuilder } 14299 14300 // Request returns request for DeviceManagementSettingInstance collection 14301 func (b *DeviceManagementTemplateSettingsCollectionRequestBuilder) Request() *DeviceManagementTemplateSettingsCollectionRequest { 14302 return &DeviceManagementTemplateSettingsCollectionRequest{ 14303 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 14304 } 14305 } 14306 14307 // ID returns request builder for DeviceManagementSettingInstance item 14308 func (b *DeviceManagementTemplateSettingsCollectionRequestBuilder) ID(id string) *DeviceManagementSettingInstanceRequestBuilder { 14309 bb := &DeviceManagementSettingInstanceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 14310 bb.baseURL += "/" + id 14311 return bb 14312 } 14313 14314 // DeviceManagementTemplateSettingsCollectionRequest is request for DeviceManagementSettingInstance collection 14315 type DeviceManagementTemplateSettingsCollectionRequest struct{ BaseRequest } 14316 14317 // Paging perfoms paging operation for DeviceManagementSettingInstance collection 14318 func (r *DeviceManagementTemplateSettingsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementSettingInstance, error) { 14319 req, err := r.NewJSONRequest(method, path, obj) 14320 if err != nil { 14321 return nil, err 14322 } 14323 if ctx != nil { 14324 req = req.WithContext(ctx) 14325 } 14326 res, err := r.client.Do(req) 14327 if err != nil { 14328 return nil, err 14329 } 14330 var values []DeviceManagementSettingInstance 14331 for { 14332 if res.StatusCode != http.StatusOK { 14333 b, _ := ioutil.ReadAll(res.Body) 14334 res.Body.Close() 14335 errRes := &ErrorResponse{Response: res} 14336 err := jsonx.Unmarshal(b, errRes) 14337 if err != nil { 14338 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 14339 } 14340 return nil, errRes 14341 } 14342 var ( 14343 paging Paging 14344 value []DeviceManagementSettingInstance 14345 ) 14346 err := jsonx.NewDecoder(res.Body).Decode(&paging) 14347 res.Body.Close() 14348 if err != nil { 14349 return nil, err 14350 } 14351 err = jsonx.Unmarshal(paging.Value, &value) 14352 if err != nil { 14353 return nil, err 14354 } 14355 values = append(values, value...) 14356 if n >= 0 { 14357 n-- 14358 } 14359 if n == 0 || len(paging.NextLink) == 0 { 14360 return values, nil 14361 } 14362 req, err = http.NewRequest("GET", paging.NextLink, nil) 14363 if ctx != nil { 14364 req = req.WithContext(ctx) 14365 } 14366 res, err = r.client.Do(req) 14367 if err != nil { 14368 return nil, err 14369 } 14370 } 14371 } 14372 14373 // GetN performs GET request for DeviceManagementSettingInstance collection, max N pages 14374 func (r *DeviceManagementTemplateSettingsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementSettingInstance, error) { 14375 var query string 14376 if r.query != nil { 14377 query = "?" + r.query.Encode() 14378 } 14379 return r.Paging(ctx, "GET", query, nil, n) 14380 } 14381 14382 // Get performs GET request for DeviceManagementSettingInstance collection 14383 func (r *DeviceManagementTemplateSettingsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingInstance, error) { 14384 return r.GetN(ctx, 0) 14385 } 14386 14387 // Add performs POST request for DeviceManagementSettingInstance collection 14388 func (r *DeviceManagementTemplateSettingsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingInstance) (resObj *DeviceManagementSettingInstance, err error) { 14389 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 14390 return 14391 } 14392 14393 // RecommendedSettings returns request builder for DeviceManagementSettingInstance collection 14394 func (b *DeviceManagementTemplateSettingCategoryRequestBuilder) RecommendedSettings() *DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequestBuilder { 14395 bb := &DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 14396 bb.baseURL += "/recommendedSettings" 14397 return bb 14398 } 14399 14400 // DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequestBuilder is request builder for DeviceManagementSettingInstance collection 14401 type DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequestBuilder struct{ BaseRequestBuilder } 14402 14403 // Request returns request for DeviceManagementSettingInstance collection 14404 func (b *DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequestBuilder) Request() *DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequest { 14405 return &DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequest{ 14406 BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, 14407 } 14408 } 14409 14410 // ID returns request builder for DeviceManagementSettingInstance item 14411 func (b *DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequestBuilder) ID(id string) *DeviceManagementSettingInstanceRequestBuilder { 14412 bb := &DeviceManagementSettingInstanceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} 14413 bb.baseURL += "/" + id 14414 return bb 14415 } 14416 14417 // DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequest is request for DeviceManagementSettingInstance collection 14418 type DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequest struct{ BaseRequest } 14419 14420 // Paging perfoms paging operation for DeviceManagementSettingInstance collection 14421 func (r *DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceManagementSettingInstance, error) { 14422 req, err := r.NewJSONRequest(method, path, obj) 14423 if err != nil { 14424 return nil, err 14425 } 14426 if ctx != nil { 14427 req = req.WithContext(ctx) 14428 } 14429 res, err := r.client.Do(req) 14430 if err != nil { 14431 return nil, err 14432 } 14433 var values []DeviceManagementSettingInstance 14434 for { 14435 if res.StatusCode != http.StatusOK { 14436 b, _ := ioutil.ReadAll(res.Body) 14437 res.Body.Close() 14438 errRes := &ErrorResponse{Response: res} 14439 err := jsonx.Unmarshal(b, errRes) 14440 if err != nil { 14441 return nil, fmt.Errorf("%s: %s", res.Status, string(b)) 14442 } 14443 return nil, errRes 14444 } 14445 var ( 14446 paging Paging 14447 value []DeviceManagementSettingInstance 14448 ) 14449 err := jsonx.NewDecoder(res.Body).Decode(&paging) 14450 res.Body.Close() 14451 if err != nil { 14452 return nil, err 14453 } 14454 err = jsonx.Unmarshal(paging.Value, &value) 14455 if err != nil { 14456 return nil, err 14457 } 14458 values = append(values, value...) 14459 if n >= 0 { 14460 n-- 14461 } 14462 if n == 0 || len(paging.NextLink) == 0 { 14463 return values, nil 14464 } 14465 req, err = http.NewRequest("GET", paging.NextLink, nil) 14466 if ctx != nil { 14467 req = req.WithContext(ctx) 14468 } 14469 res, err = r.client.Do(req) 14470 if err != nil { 14471 return nil, err 14472 } 14473 } 14474 } 14475 14476 // GetN performs GET request for DeviceManagementSettingInstance collection, max N pages 14477 func (r *DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceManagementSettingInstance, error) { 14478 var query string 14479 if r.query != nil { 14480 query = "?" + r.query.Encode() 14481 } 14482 return r.Paging(ctx, "GET", query, nil, n) 14483 } 14484 14485 // Get performs GET request for DeviceManagementSettingInstance collection 14486 func (r *DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingInstance, error) { 14487 return r.GetN(ctx, 0) 14488 } 14489 14490 // Add performs POST request for DeviceManagementSettingInstance collection 14491 func (r *DeviceManagementTemplateSettingCategoryRecommendedSettingsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingInstance) (resObj *DeviceManagementSettingInstance, err error) { 14492 err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) 14493 return 14494 }