summaryrefslogblamecommitdiffstats
path: root/vendor/github.com/yaegashi/msgraph.go/beta/ActionSecurity.go
blob: 9d0cc9786925378fba556fa8c0871e529f25fda1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553








                                                     
                                              
 
                                                                  




























                                                                                               
                                                                                                                                     


































                                                                                       


                                                        











                                                                       
                                                                                             


                                              




                                                                                     


































                                                                                                                                 
                                                                                                                                                                         


































                                                                                       


                                                        











                                                                       
                                                                                                                                 


                                              




                                                                                                                         


































                                                                                                                                                                    
                                                                                                                                                                     


































                                                                                       


                                                        











                                                                       
                                                                                                                             


                                              




                                                                                                                     


































                                                                                                                                                              
                                                                                                                                                                 


































                                                                                       


                                                        











                                                                       
                                                                                                                         


                                              




                                                                                                                 


































                                                                                                                                                        
                                                                                                                                                                 


































                                                                                       


                                                        











                                                                       
                                                                                                                         


                                              




                                                                                                                 


































                                                                                                                                                        
                                                                                                                                                             


































                                                                                       


                                                        











                                                                       
                                                                                                                     


                                              




                                                                                                             


































                                                                                                                                                  
                                                                                                                                                                     


































                                                                                       


                                                        











                                                                       
                                                                                                                             


                                              




                                                                                                                     


































                                                                                                                                                              
                                                                                                                                                                             


































                                                                                       


                                                        











                                                                       
                                                                                                                                     


                                              




                                                                                                                             


































                                                                                                                                                                          
                                                                                                                                                 


































                                                                                       


                                                        











                                                                       
                                                                                                         


                                              




                                                                                                 


































                                                                                                                                
                                                                                                                                                       


































                                                                                       


                                                        











                                                                       
                                                                                                               


                                              




                                                                                                       


































                                                                                                                                         
                                                                                                                                                 


































                                                                                       


                                                        











                                                                       
                                                                                                         


                                              




                                                                                                 


































                                                                                                                                
                                                                                                                                                                 


































                                                                                       


                                                        











                                                                       
                                                                                                                         


                                              




                                                                                                                 





                                                                                                                                                        























































































































































































































































































































                                                                                                                                                                                                                  
// Code generated by msgraph-generate.go DO NOT EDIT.

package msgraph

import (
	"context"
	"fmt"
	"io/ioutil"
	"net/http"

	"github.com/yaegashi/msgraph.go/jsonx"
)

// SecurityActionCancelSecurityActionRequestParameter undocumented
type SecurityActionCancelSecurityActionRequestParameter struct {
}

// Alerts returns request builder for Alert collection
func (b *SecurityRequestBuilder) Alerts() *SecurityAlertsCollectionRequestBuilder {
	bb := &SecurityAlertsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/alerts"
	return bb
}

// SecurityAlertsCollectionRequestBuilder is request builder for Alert collection
type SecurityAlertsCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for Alert collection
func (b *SecurityAlertsCollectionRequestBuilder) Request() *SecurityAlertsCollectionRequest {
	return &SecurityAlertsCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for Alert item
func (b *SecurityAlertsCollectionRequestBuilder) ID(id string) *AlertRequestBuilder {
	bb := &AlertRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityAlertsCollectionRequest is request for Alert collection
type SecurityAlertsCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for Alert collection
func (r *SecurityAlertsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]Alert, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []Alert
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []Alert
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for Alert collection, max N pages
func (r *SecurityAlertsCollectionRequest) GetN(ctx context.Context, n int) ([]Alert, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for Alert collection
func (r *SecurityAlertsCollectionRequest) Get(ctx context.Context) ([]Alert, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for Alert collection
func (r *SecurityAlertsCollectionRequest) Add(ctx context.Context, reqObj *Alert) (resObj *Alert, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// CloudAppSecurityProfiles returns request builder for CloudAppSecurityProfile collection
func (b *SecurityRequestBuilder) CloudAppSecurityProfiles() *SecurityCloudAppSecurityProfilesCollectionRequestBuilder {
	bb := &SecurityCloudAppSecurityProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/cloudAppSecurityProfiles"
	return bb
}

// SecurityCloudAppSecurityProfilesCollectionRequestBuilder is request builder for CloudAppSecurityProfile collection
type SecurityCloudAppSecurityProfilesCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for CloudAppSecurityProfile collection
func (b *SecurityCloudAppSecurityProfilesCollectionRequestBuilder) Request() *SecurityCloudAppSecurityProfilesCollectionRequest {
	return &SecurityCloudAppSecurityProfilesCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for CloudAppSecurityProfile item
func (b *SecurityCloudAppSecurityProfilesCollectionRequestBuilder) ID(id string) *CloudAppSecurityProfileRequestBuilder {
	bb := &CloudAppSecurityProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityCloudAppSecurityProfilesCollectionRequest is request for CloudAppSecurityProfile collection
type SecurityCloudAppSecurityProfilesCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for CloudAppSecurityProfile collection
func (r *SecurityCloudAppSecurityProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]CloudAppSecurityProfile, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []CloudAppSecurityProfile
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []CloudAppSecurityProfile
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for CloudAppSecurityProfile collection, max N pages
func (r *SecurityCloudAppSecurityProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]CloudAppSecurityProfile, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for CloudAppSecurityProfile collection
func (r *SecurityCloudAppSecurityProfilesCollectionRequest) Get(ctx context.Context) ([]CloudAppSecurityProfile, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for CloudAppSecurityProfile collection
func (r *SecurityCloudAppSecurityProfilesCollectionRequest) Add(ctx context.Context, reqObj *CloudAppSecurityProfile) (resObj *CloudAppSecurityProfile, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// DomainSecurityProfiles returns request builder for DomainSecurityProfile collection
func (b *SecurityRequestBuilder) DomainSecurityProfiles() *SecurityDomainSecurityProfilesCollectionRequestBuilder {
	bb := &SecurityDomainSecurityProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/domainSecurityProfiles"
	return bb
}

// SecurityDomainSecurityProfilesCollectionRequestBuilder is request builder for DomainSecurityProfile collection
type SecurityDomainSecurityProfilesCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for DomainSecurityProfile collection
func (b *SecurityDomainSecurityProfilesCollectionRequestBuilder) Request() *SecurityDomainSecurityProfilesCollectionRequest {
	return &SecurityDomainSecurityProfilesCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for DomainSecurityProfile item
func (b *SecurityDomainSecurityProfilesCollectionRequestBuilder) ID(id string) *DomainSecurityProfileRequestBuilder {
	bb := &DomainSecurityProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityDomainSecurityProfilesCollectionRequest is request for DomainSecurityProfile collection
type SecurityDomainSecurityProfilesCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for DomainSecurityProfile collection
func (r *SecurityDomainSecurityProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DomainSecurityProfile, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []DomainSecurityProfile
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []DomainSecurityProfile
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for DomainSecurityProfile collection, max N pages
func (r *SecurityDomainSecurityProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]DomainSecurityProfile, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for DomainSecurityProfile collection
func (r *SecurityDomainSecurityProfilesCollectionRequest) Get(ctx context.Context) ([]DomainSecurityProfile, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for DomainSecurityProfile collection
func (r *SecurityDomainSecurityProfilesCollectionRequest) Add(ctx context.Context, reqObj *DomainSecurityProfile) (resObj *DomainSecurityProfile, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// FileSecurityProfiles returns request builder for FileSecurityProfile collection
func (b *SecurityRequestBuilder) FileSecurityProfiles() *SecurityFileSecurityProfilesCollectionRequestBuilder {
	bb := &SecurityFileSecurityProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/fileSecurityProfiles"
	return bb
}

// SecurityFileSecurityProfilesCollectionRequestBuilder is request builder for FileSecurityProfile collection
type SecurityFileSecurityProfilesCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for FileSecurityProfile collection
func (b *SecurityFileSecurityProfilesCollectionRequestBuilder) Request() *SecurityFileSecurityProfilesCollectionRequest {
	return &SecurityFileSecurityProfilesCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for FileSecurityProfile item
func (b *SecurityFileSecurityProfilesCollectionRequestBuilder) ID(id string) *FileSecurityProfileRequestBuilder {
	bb := &FileSecurityProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityFileSecurityProfilesCollectionRequest is request for FileSecurityProfile collection
type SecurityFileSecurityProfilesCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for FileSecurityProfile collection
func (r *SecurityFileSecurityProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]FileSecurityProfile, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []FileSecurityProfile
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []FileSecurityProfile
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for FileSecurityProfile collection, max N pages
func (r *SecurityFileSecurityProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]FileSecurityProfile, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for FileSecurityProfile collection
func (r *SecurityFileSecurityProfilesCollectionRequest) Get(ctx context.Context) ([]FileSecurityProfile, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for FileSecurityProfile collection
func (r *SecurityFileSecurityProfilesCollectionRequest) Add(ctx context.Context, reqObj *FileSecurityProfile) (resObj *FileSecurityProfile, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// HostSecurityProfiles returns request builder for HostSecurityProfile collection
func (b *SecurityRequestBuilder) HostSecurityProfiles() *SecurityHostSecurityProfilesCollectionRequestBuilder {
	bb := &SecurityHostSecurityProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/hostSecurityProfiles"
	return bb
}

// SecurityHostSecurityProfilesCollectionRequestBuilder is request builder for HostSecurityProfile collection
type SecurityHostSecurityProfilesCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for HostSecurityProfile collection
func (b *SecurityHostSecurityProfilesCollectionRequestBuilder) Request() *SecurityHostSecurityProfilesCollectionRequest {
	return &SecurityHostSecurityProfilesCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for HostSecurityProfile item
func (b *SecurityHostSecurityProfilesCollectionRequestBuilder) ID(id string) *HostSecurityProfileRequestBuilder {
	bb := &HostSecurityProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityHostSecurityProfilesCollectionRequest is request for HostSecurityProfile collection
type SecurityHostSecurityProfilesCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for HostSecurityProfile collection
func (r *SecurityHostSecurityProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]HostSecurityProfile, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []HostSecurityProfile
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []HostSecurityProfile
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for HostSecurityProfile collection, max N pages
func (r *SecurityHostSecurityProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]HostSecurityProfile, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for HostSecurityProfile collection
func (r *SecurityHostSecurityProfilesCollectionRequest) Get(ctx context.Context) ([]HostSecurityProfile, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for HostSecurityProfile collection
func (r *SecurityHostSecurityProfilesCollectionRequest) Add(ctx context.Context, reqObj *HostSecurityProfile) (resObj *HostSecurityProfile, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// IPSecurityProfiles returns request builder for IPSecurityProfile collection
func (b *SecurityRequestBuilder) IPSecurityProfiles() *SecurityIPSecurityProfilesCollectionRequestBuilder {
	bb := &SecurityIPSecurityProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/ipSecurityProfiles"
	return bb
}

// SecurityIPSecurityProfilesCollectionRequestBuilder is request builder for IPSecurityProfile collection
type SecurityIPSecurityProfilesCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for IPSecurityProfile collection
func (b *SecurityIPSecurityProfilesCollectionRequestBuilder) Request() *SecurityIPSecurityProfilesCollectionRequest {
	return &SecurityIPSecurityProfilesCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for IPSecurityProfile item
func (b *SecurityIPSecurityProfilesCollectionRequestBuilder) ID(id string) *IPSecurityProfileRequestBuilder {
	bb := &IPSecurityProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityIPSecurityProfilesCollectionRequest is request for IPSecurityProfile collection
type SecurityIPSecurityProfilesCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for IPSecurityProfile collection
func (r *SecurityIPSecurityProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]IPSecurityProfile, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []IPSecurityProfile
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []IPSecurityProfile
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for IPSecurityProfile collection, max N pages
func (r *SecurityIPSecurityProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]IPSecurityProfile, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for IPSecurityProfile collection
func (r *SecurityIPSecurityProfilesCollectionRequest) Get(ctx context.Context) ([]IPSecurityProfile, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for IPSecurityProfile collection
func (r *SecurityIPSecurityProfilesCollectionRequest) Add(ctx context.Context, reqObj *IPSecurityProfile) (resObj *IPSecurityProfile, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// ProviderTenantSettings returns request builder for ProviderTenantSetting collection
func (b *SecurityRequestBuilder) ProviderTenantSettings() *SecurityProviderTenantSettingsCollectionRequestBuilder {
	bb := &SecurityProviderTenantSettingsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/providerTenantSettings"
	return bb
}

// SecurityProviderTenantSettingsCollectionRequestBuilder is request builder for ProviderTenantSetting collection
type SecurityProviderTenantSettingsCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for ProviderTenantSetting collection
func (b *SecurityProviderTenantSettingsCollectionRequestBuilder) Request() *SecurityProviderTenantSettingsCollectionRequest {
	return &SecurityProviderTenantSettingsCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for ProviderTenantSetting item
func (b *SecurityProviderTenantSettingsCollectionRequestBuilder) ID(id string) *ProviderTenantSettingRequestBuilder {
	bb := &ProviderTenantSettingRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityProviderTenantSettingsCollectionRequest is request for ProviderTenantSetting collection
type SecurityProviderTenantSettingsCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for ProviderTenantSetting collection
func (r *SecurityProviderTenantSettingsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ProviderTenantSetting, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []ProviderTenantSetting
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []ProviderTenantSetting
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for ProviderTenantSetting collection, max N pages
func (r *SecurityProviderTenantSettingsCollectionRequest) GetN(ctx context.Context, n int) ([]ProviderTenantSetting, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for ProviderTenantSetting collection
func (r *SecurityProviderTenantSettingsCollectionRequest) Get(ctx context.Context) ([]ProviderTenantSetting, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for ProviderTenantSetting collection
func (r *SecurityProviderTenantSettingsCollectionRequest) Add(ctx context.Context, reqObj *ProviderTenantSetting) (resObj *ProviderTenantSetting, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// SecureScoreControlProfiles returns request builder for SecureScoreControlProfile collection
func (b *SecurityRequestBuilder) SecureScoreControlProfiles() *SecuritySecureScoreControlProfilesCollectionRequestBuilder {
	bb := &SecuritySecureScoreControlProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/secureScoreControlProfiles"
	return bb
}

// SecuritySecureScoreControlProfilesCollectionRequestBuilder is request builder for SecureScoreControlProfile collection
type SecuritySecureScoreControlProfilesCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for SecureScoreControlProfile collection
func (b *SecuritySecureScoreControlProfilesCollectionRequestBuilder) Request() *SecuritySecureScoreControlProfilesCollectionRequest {
	return &SecuritySecureScoreControlProfilesCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for SecureScoreControlProfile item
func (b *SecuritySecureScoreControlProfilesCollectionRequestBuilder) ID(id string) *SecureScoreControlProfileRequestBuilder {
	bb := &SecureScoreControlProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecuritySecureScoreControlProfilesCollectionRequest is request for SecureScoreControlProfile collection
type SecuritySecureScoreControlProfilesCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for SecureScoreControlProfile collection
func (r *SecuritySecureScoreControlProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]SecureScoreControlProfile, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []SecureScoreControlProfile
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []SecureScoreControlProfile
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for SecureScoreControlProfile collection, max N pages
func (r *SecuritySecureScoreControlProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]SecureScoreControlProfile, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for SecureScoreControlProfile collection
func (r *SecuritySecureScoreControlProfilesCollectionRequest) Get(ctx context.Context) ([]SecureScoreControlProfile, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for SecureScoreControlProfile collection
func (r *SecuritySecureScoreControlProfilesCollectionRequest) Add(ctx context.Context, reqObj *SecureScoreControlProfile) (resObj *SecureScoreControlProfile, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// SecureScores returns request builder for SecureScore collection
func (b *SecurityRequestBuilder) SecureScores() *SecuritySecureScoresCollectionRequestBuilder {
	bb := &SecuritySecureScoresCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/secureScores"
	return bb
}

// SecuritySecureScoresCollectionRequestBuilder is request builder for SecureScore collection
type SecuritySecureScoresCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for SecureScore collection
func (b *SecuritySecureScoresCollectionRequestBuilder) Request() *SecuritySecureScoresCollectionRequest {
	return &SecuritySecureScoresCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for SecureScore item
func (b *SecuritySecureScoresCollectionRequestBuilder) ID(id string) *SecureScoreRequestBuilder {
	bb := &SecureScoreRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecuritySecureScoresCollectionRequest is request for SecureScore collection
type SecuritySecureScoresCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for SecureScore collection
func (r *SecuritySecureScoresCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]SecureScore, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []SecureScore
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []SecureScore
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for SecureScore collection, max N pages
func (r *SecuritySecureScoresCollectionRequest) GetN(ctx context.Context, n int) ([]SecureScore, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for SecureScore collection
func (r *SecuritySecureScoresCollectionRequest) Get(ctx context.Context) ([]SecureScore, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for SecureScore collection
func (r *SecuritySecureScoresCollectionRequest) Add(ctx context.Context, reqObj *SecureScore) (resObj *SecureScore, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// SecurityActions returns request builder for SecurityAction collection
func (b *SecurityRequestBuilder) SecurityActions() *SecuritySecurityActionsCollectionRequestBuilder {
	bb := &SecuritySecurityActionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/securityActions"
	return bb
}

// SecuritySecurityActionsCollectionRequestBuilder is request builder for SecurityAction collection
type SecuritySecurityActionsCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for SecurityAction collection
func (b *SecuritySecurityActionsCollectionRequestBuilder) Request() *SecuritySecurityActionsCollectionRequest {
	return &SecuritySecurityActionsCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for SecurityAction item
func (b *SecuritySecurityActionsCollectionRequestBuilder) ID(id string) *SecurityActionRequestBuilder {
	bb := &SecurityActionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecuritySecurityActionsCollectionRequest is request for SecurityAction collection
type SecuritySecurityActionsCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for SecurityAction collection
func (r *SecuritySecurityActionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]SecurityAction, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []SecurityAction
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []SecurityAction
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for SecurityAction collection, max N pages
func (r *SecuritySecurityActionsCollectionRequest) GetN(ctx context.Context, n int) ([]SecurityAction, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for SecurityAction collection
func (r *SecuritySecurityActionsCollectionRequest) Get(ctx context.Context) ([]SecurityAction, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for SecurityAction collection
func (r *SecuritySecurityActionsCollectionRequest) Add(ctx context.Context, reqObj *SecurityAction) (resObj *SecurityAction, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// TiIndicators returns request builder for TiIndicator collection
func (b *SecurityRequestBuilder) TiIndicators() *SecurityTiIndicatorsCollectionRequestBuilder {
	bb := &SecurityTiIndicatorsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/tiIndicators"
	return bb
}

// SecurityTiIndicatorsCollectionRequestBuilder is request builder for TiIndicator collection
type SecurityTiIndicatorsCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for TiIndicator collection
func (b *SecurityTiIndicatorsCollectionRequestBuilder) Request() *SecurityTiIndicatorsCollectionRequest {
	return &SecurityTiIndicatorsCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for TiIndicator item
func (b *SecurityTiIndicatorsCollectionRequestBuilder) ID(id string) *TiIndicatorRequestBuilder {
	bb := &TiIndicatorRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityTiIndicatorsCollectionRequest is request for TiIndicator collection
type SecurityTiIndicatorsCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for TiIndicator collection
func (r *SecurityTiIndicatorsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]TiIndicator, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []TiIndicator
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []TiIndicator
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for TiIndicator collection, max N pages
func (r *SecurityTiIndicatorsCollectionRequest) GetN(ctx context.Context, n int) ([]TiIndicator, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for TiIndicator collection
func (r *SecurityTiIndicatorsCollectionRequest) Get(ctx context.Context) ([]TiIndicator, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for TiIndicator collection
func (r *SecurityTiIndicatorsCollectionRequest) Add(ctx context.Context, reqObj *TiIndicator) (resObj *TiIndicator, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// UserSecurityProfiles returns request builder for UserSecurityProfile collection
func (b *SecurityRequestBuilder) UserSecurityProfiles() *SecurityUserSecurityProfilesCollectionRequestBuilder {
	bb := &SecurityUserSecurityProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/userSecurityProfiles"
	return bb
}

// SecurityUserSecurityProfilesCollectionRequestBuilder is request builder for UserSecurityProfile collection
type SecurityUserSecurityProfilesCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for UserSecurityProfile collection
func (b *SecurityUserSecurityProfilesCollectionRequestBuilder) Request() *SecurityUserSecurityProfilesCollectionRequest {
	return &SecurityUserSecurityProfilesCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for UserSecurityProfile item
func (b *SecurityUserSecurityProfilesCollectionRequestBuilder) ID(id string) *UserSecurityProfileRequestBuilder {
	bb := &UserSecurityProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityUserSecurityProfilesCollectionRequest is request for UserSecurityProfile collection
type SecurityUserSecurityProfilesCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for UserSecurityProfile collection
func (r *SecurityUserSecurityProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]UserSecurityProfile, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []UserSecurityProfile
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []UserSecurityProfile
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for UserSecurityProfile collection, max N pages
func (r *SecurityUserSecurityProfilesCollectionRequest) GetN(ctx context.Context, n int) ([]UserSecurityProfile, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for UserSecurityProfile collection
func (r *SecurityUserSecurityProfilesCollectionRequest) Get(ctx context.Context) ([]UserSecurityProfile, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for UserSecurityProfile collection
func (r *SecurityUserSecurityProfilesCollectionRequest) Add(ctx context.Context, reqObj *UserSecurityProfile) (resObj *UserSecurityProfile, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// SettingStates returns request builder for SecurityBaselineSettingState collection
func (b *SecurityBaselineStateRequestBuilder) SettingStates() *SecurityBaselineStateSettingStatesCollectionRequestBuilder {
	bb := &SecurityBaselineStateSettingStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/settingStates"
	return bb
}

// SecurityBaselineStateSettingStatesCollectionRequestBuilder is request builder for SecurityBaselineSettingState collection
type SecurityBaselineStateSettingStatesCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for SecurityBaselineSettingState collection
func (b *SecurityBaselineStateSettingStatesCollectionRequestBuilder) Request() *SecurityBaselineStateSettingStatesCollectionRequest {
	return &SecurityBaselineStateSettingStatesCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for SecurityBaselineSettingState item
func (b *SecurityBaselineStateSettingStatesCollectionRequestBuilder) ID(id string) *SecurityBaselineSettingStateRequestBuilder {
	bb := &SecurityBaselineSettingStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityBaselineStateSettingStatesCollectionRequest is request for SecurityBaselineSettingState collection
type SecurityBaselineStateSettingStatesCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for SecurityBaselineSettingState collection
func (r *SecurityBaselineStateSettingStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]SecurityBaselineSettingState, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []SecurityBaselineSettingState
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []SecurityBaselineSettingState
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for SecurityBaselineSettingState collection, max N pages
func (r *SecurityBaselineStateSettingStatesCollectionRequest) GetN(ctx context.Context, n int) ([]SecurityBaselineSettingState, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for SecurityBaselineSettingState collection
func (r *SecurityBaselineStateSettingStatesCollectionRequest) Get(ctx context.Context) ([]SecurityBaselineSettingState, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for SecurityBaselineSettingState collection
func (r *SecurityBaselineStateSettingStatesCollectionRequest) Add(ctx context.Context, reqObj *SecurityBaselineSettingState) (resObj *SecurityBaselineSettingState, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// CategoryDeviceStateSummaries returns request builder for SecurityBaselineCategoryStateSummary collection
func (b *SecurityBaselineTemplateRequestBuilder) CategoryDeviceStateSummaries() *SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequestBuilder {
	bb := &SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/categoryDeviceStateSummaries"
	return bb
}

// SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequestBuilder is request builder for SecurityBaselineCategoryStateSummary collection
type SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for SecurityBaselineCategoryStateSummary collection
func (b *SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequestBuilder) Request() *SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequest {
	return &SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for SecurityBaselineCategoryStateSummary item
func (b *SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequestBuilder) ID(id string) *SecurityBaselineCategoryStateSummaryRequestBuilder {
	bb := &SecurityBaselineCategoryStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequest is request for SecurityBaselineCategoryStateSummary collection
type SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for SecurityBaselineCategoryStateSummary collection
func (r *SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]SecurityBaselineCategoryStateSummary, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []SecurityBaselineCategoryStateSummary
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []SecurityBaselineCategoryStateSummary
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for SecurityBaselineCategoryStateSummary collection, max N pages
func (r *SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequest) GetN(ctx context.Context, n int) ([]SecurityBaselineCategoryStateSummary, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for SecurityBaselineCategoryStateSummary collection
func (r *SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequest) Get(ctx context.Context) ([]SecurityBaselineCategoryStateSummary, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for SecurityBaselineCategoryStateSummary collection
func (r *SecurityBaselineTemplateCategoryDeviceStateSummariesCollectionRequest) Add(ctx context.Context, reqObj *SecurityBaselineCategoryStateSummary) (resObj *SecurityBaselineCategoryStateSummary, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}

// DeviceStateSummary is navigation property
func (b *SecurityBaselineTemplateRequestBuilder) DeviceStateSummary() *SecurityBaselineStateSummaryRequestBuilder {
	bb := &SecurityBaselineStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/deviceStateSummary"
	return bb
}

// DeviceStates returns request builder for SecurityBaselineDeviceState collection
func (b *SecurityBaselineTemplateRequestBuilder) DeviceStates() *SecurityBaselineTemplateDeviceStatesCollectionRequestBuilder {
	bb := &SecurityBaselineTemplateDeviceStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/deviceStates"
	return bb
}

// SecurityBaselineTemplateDeviceStatesCollectionRequestBuilder is request builder for SecurityBaselineDeviceState collection
type SecurityBaselineTemplateDeviceStatesCollectionRequestBuilder struct{ BaseRequestBuilder }

// Request returns request for SecurityBaselineDeviceState collection
func (b *SecurityBaselineTemplateDeviceStatesCollectionRequestBuilder) Request() *SecurityBaselineTemplateDeviceStatesCollectionRequest {
	return &SecurityBaselineTemplateDeviceStatesCollectionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// ID returns request builder for SecurityBaselineDeviceState item
func (b *SecurityBaselineTemplateDeviceStatesCollectionRequestBuilder) ID(id string) *SecurityBaselineDeviceStateRequestBuilder {
	bb := &SecurityBaselineDeviceStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.baseURL += "/" + id
	return bb
}

// SecurityBaselineTemplateDeviceStatesCollectionRequest is request for SecurityBaselineDeviceState collection
type SecurityBaselineTemplateDeviceStatesCollectionRequest struct{ BaseRequest }

// Paging perfoms paging operation for SecurityBaselineDeviceState collection
func (r *SecurityBaselineTemplateDeviceStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]SecurityBaselineDeviceState, error) {
	req, err := r.NewJSONRequest(method, path, obj)
	if err != nil {
		return nil, err
	}
	if ctx != nil {
		req = req.WithContext(ctx)
	}
	res, err := r.client.Do(req)
	if err != nil {
		return nil, err
	}
	var values []SecurityBaselineDeviceState
	for {
		defer res.Body.Close()
		if res.StatusCode != http.StatusOK {
			b, _ := ioutil.ReadAll(res.Body)
			errRes := &ErrorResponse{Response: res}
			err := jsonx.Unmarshal(b, errRes)
			if err != nil {
				return nil, fmt.Errorf("%s: %s", res.Status, string(b))
			}
			return nil, errRes
		}
		var (
			paging Paging
			value  []SecurityBaselineDeviceState
		)
		err := jsonx.NewDecoder(res.Body).Decode(&paging)
		if err != nil {
			return nil, err
		}
		err = jsonx.Unmarshal(paging.Value, &value)
		if err != nil {
			return nil, err
		}
		values = append(values, value...)
		if n >= 0 {
			n--
		}
		if n == 0 || len(paging.NextLink) == 0 {
			return values, nil
		}
		req, err = http.NewRequest("GET", paging.NextLink, nil)
		if ctx != nil {
			req = req.WithContext(ctx)
		}
		res, err = r.client.Do(req)
		if err != nil {
			return nil, err
		}
	}
}

// GetN performs GET request for SecurityBaselineDeviceState collection, max N pages
func (r *SecurityBaselineTemplateDeviceStatesCollectionRequest) GetN(ctx context.Context, n int) ([]SecurityBaselineDeviceState, error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	return r.Paging(ctx, "GET", query, nil, n)
}

// Get performs GET request for SecurityBaselineDeviceState collection
func (r *SecurityBaselineTemplateDeviceStatesCollectionRequest) Get(ctx context.Context) ([]SecurityBaselineDeviceState, error) {
	return r.GetN(ctx, 0)
}

// Add performs POST request for SecurityBaselineDeviceState collection
func (r *SecurityBaselineTemplateDeviceStatesCollectionRequest) Add(ctx context.Context, reqObj *SecurityBaselineDeviceState) (resObj *SecurityBaselineDeviceState, err error) {
	err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
	return
}