// Code generated by msgraph-generate.go DO NOT EDIT. package msgraph import ( "context" "fmt" "io/ioutil" "net/http" "github.com/matterbridge/msgraph.go/jsonx" ) // DeviceManagementRequestBuilder is request builder for DeviceManagement type DeviceManagementRequestBuilder struct{ BaseRequestBuilder } // Request returns DeviceManagementRequest func (b *DeviceManagementRequestBuilder) Request() *DeviceManagementRequest { return &DeviceManagementRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // DeviceManagementRequest is request for DeviceManagement type DeviceManagementRequest struct{ BaseRequest } // Get performs GET request for DeviceManagement func (r *DeviceManagementRequest) Get(ctx context.Context) (resObj *DeviceManagement, err error) { var query string if r.query != nil { query = "?" + r.query.Encode() } err = r.JSONRequest(ctx, "GET", query, nil, &resObj) return } // Update performs PATCH request for DeviceManagement func (r *DeviceManagementRequest) Update(ctx context.Context, reqObj *DeviceManagement) error { return r.JSONRequest(ctx, "PATCH", "", reqObj, nil) } // Delete performs DELETE request for DeviceManagement func (r *DeviceManagementRequest) Delete(ctx context.Context) error { return r.JSONRequest(ctx, "DELETE", "", nil, nil) } // AdvancedThreatProtectionOnboardingStateSummary is navigation property func (b *DeviceManagementRequestBuilder) AdvancedThreatProtectionOnboardingStateSummary() *AdvancedThreatProtectionOnboardingStateSummaryRequestBuilder { bb := &AdvancedThreatProtectionOnboardingStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/advancedThreatProtectionOnboardingStateSummary" return bb } // AndroidDeviceOwnerEnrollmentProfiles returns request builder for AndroidDeviceOwnerEnrollmentProfile collection func (b *DeviceManagementRequestBuilder) AndroidDeviceOwnerEnrollmentProfiles() *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder { bb := &DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/androidDeviceOwnerEnrollmentProfiles" return bb } // DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder is request builder for AndroidDeviceOwnerEnrollmentProfile collection type DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for AndroidDeviceOwnerEnrollmentProfile collection func (b *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder) Request() *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest { return &DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for AndroidDeviceOwnerEnrollmentProfile item func (b *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequestBuilder) ID(id string) *AndroidDeviceOwnerEnrollmentProfileRequestBuilder { bb := &AndroidDeviceOwnerEnrollmentProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest is request for AndroidDeviceOwnerEnrollmentProfile collection type DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for AndroidDeviceOwnerEnrollmentProfile collection func (r *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]AndroidDeviceOwnerEnrollmentProfile, 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 []AndroidDeviceOwnerEnrollmentProfile 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 []AndroidDeviceOwnerEnrollmentProfile ) 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 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 } } } // Get performs GET request for AndroidDeviceOwnerEnrollmentProfile collection func (r *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest) Get(ctx context.Context) ([]AndroidDeviceOwnerEnrollmentProfile, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for AndroidDeviceOwnerEnrollmentProfile collection func (r *DeviceManagementAndroidDeviceOwnerEnrollmentProfilesCollectionRequest) Add(ctx context.Context, reqObj *AndroidDeviceOwnerEnrollmentProfile) (resObj *AndroidDeviceOwnerEnrollmentProfile, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // AndroidForWorkAppConfigurationSchemas returns request builder for AndroidForWorkAppConfigurationSchema collection func (b *DeviceManagementRequestBuilder) AndroidForWorkAppConfigurationSchemas() *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder { bb := &DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/androidForWorkAppConfigurationSchemas" return bb } // DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder is request builder for AndroidForWorkAppConfigurationSchema collection type DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for AndroidForWorkAppConfigurationSchema collection func (b *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder) Request() *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest { return &DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for AndroidForWorkAppConfigurationSchema item func (b *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequestBuilder) ID(id string) *AndroidForWorkAppConfigurationSchemaRequestBuilder { bb := &AndroidForWorkAppConfigurationSchemaRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest is request for AndroidForWorkAppConfigurationSchema collection type DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for AndroidForWorkAppConfigurationSchema collection func (r *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]AndroidForWorkAppConfigurationSchema, 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 []AndroidForWorkAppConfigurationSchema 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 []AndroidForWorkAppConfigurationSchema ) 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 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 } } } // Get performs GET request for AndroidForWorkAppConfigurationSchema collection func (r *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest) Get(ctx context.Context) ([]AndroidForWorkAppConfigurationSchema, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for AndroidForWorkAppConfigurationSchema collection func (r *DeviceManagementAndroidForWorkAppConfigurationSchemasCollectionRequest) Add(ctx context.Context, reqObj *AndroidForWorkAppConfigurationSchema) (resObj *AndroidForWorkAppConfigurationSchema, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // AndroidForWorkEnrollmentProfiles returns request builder for AndroidForWorkEnrollmentProfile collection func (b *DeviceManagementRequestBuilder) AndroidForWorkEnrollmentProfiles() *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder { bb := &DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/androidForWorkEnrollmentProfiles" return bb } // DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder is request builder for AndroidForWorkEnrollmentProfile collection type DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for AndroidForWorkEnrollmentProfile collection func (b *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder) Request() *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest { return &DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for AndroidForWorkEnrollmentProfile item func (b *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequestBuilder) ID(id string) *AndroidForWorkEnrollmentProfileRequestBuilder { bb := &AndroidForWorkEnrollmentProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest is request for AndroidForWorkEnrollmentProfile collection type DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for AndroidForWorkEnrollmentProfile collection func (r *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]AndroidForWorkEnrollmentProfile, 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 []AndroidForWorkEnrollmentProfile 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 []AndroidForWorkEnrollmentProfile ) 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 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 } } } // Get performs GET request for AndroidForWorkEnrollmentProfile collection func (r *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest) Get(ctx context.Context) ([]AndroidForWorkEnrollmentProfile, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for AndroidForWorkEnrollmentProfile collection func (r *DeviceManagementAndroidForWorkEnrollmentProfilesCollectionRequest) Add(ctx context.Context, reqObj *AndroidForWorkEnrollmentProfile) (resObj *AndroidForWorkEnrollmentProfile, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // AndroidForWorkSettings is navigation property func (b *DeviceManagementRequestBuilder) AndroidForWorkSettings() *AndroidForWorkSettingsRequestBuilder { bb := &AndroidForWorkSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/androidForWorkSettings" return bb } // AndroidManagedStoreAccountEnterpriseSettings is navigation property func (b *DeviceManagementRequestBuilder) AndroidManagedStoreAccountEnterpriseSettings() *AndroidManagedStoreAccountEnterpriseSettingsRequestBuilder { bb := &AndroidManagedStoreAccountEnterpriseSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/androidManagedStoreAccountEnterpriseSettings" return bb } // AndroidManagedStoreAppConfigurationSchemas returns request builder for AndroidManagedStoreAppConfigurationSchema collection func (b *DeviceManagementRequestBuilder) AndroidManagedStoreAppConfigurationSchemas() *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder { bb := &DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/androidManagedStoreAppConfigurationSchemas" return bb } // DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder is request builder for AndroidManagedStoreAppConfigurationSchema collection type DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for AndroidManagedStoreAppConfigurationSchema collection func (b *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder) Request() *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest { return &DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for AndroidManagedStoreAppConfigurationSchema item func (b *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequestBuilder) ID(id string) *AndroidManagedStoreAppConfigurationSchemaRequestBuilder { bb := &AndroidManagedStoreAppConfigurationSchemaRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest is request for AndroidManagedStoreAppConfigurationSchema collection type DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for AndroidManagedStoreAppConfigurationSchema collection func (r *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]AndroidManagedStoreAppConfigurationSchema, 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 []AndroidManagedStoreAppConfigurationSchema 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 []AndroidManagedStoreAppConfigurationSchema ) 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 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 } } } // Get performs GET request for AndroidManagedStoreAppConfigurationSchema collection func (r *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest) Get(ctx context.Context) ([]AndroidManagedStoreAppConfigurationSchema, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for AndroidManagedStoreAppConfigurationSchema collection func (r *DeviceManagementAndroidManagedStoreAppConfigurationSchemasCollectionRequest) Add(ctx context.Context, reqObj *AndroidManagedStoreAppConfigurationSchema) (resObj *AndroidManagedStoreAppConfigurationSchema, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ApplePushNotificationCertificate is navigation property func (b *DeviceManagementRequestBuilder) ApplePushNotificationCertificate() *ApplePushNotificationCertificateRequestBuilder { bb := &ApplePushNotificationCertificateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/applePushNotificationCertificate" return bb } // AppleUserInitiatedEnrollmentProfiles returns request builder for AppleUserInitiatedEnrollmentProfile collection func (b *DeviceManagementRequestBuilder) AppleUserInitiatedEnrollmentProfiles() *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder { bb := &DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/appleUserInitiatedEnrollmentProfiles" return bb } // DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder is request builder for AppleUserInitiatedEnrollmentProfile collection type DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for AppleUserInitiatedEnrollmentProfile collection func (b *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder) Request() *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest { return &DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for AppleUserInitiatedEnrollmentProfile item func (b *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequestBuilder) ID(id string) *AppleUserInitiatedEnrollmentProfileRequestBuilder { bb := &AppleUserInitiatedEnrollmentProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest is request for AppleUserInitiatedEnrollmentProfile collection type DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for AppleUserInitiatedEnrollmentProfile collection func (r *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]AppleUserInitiatedEnrollmentProfile, 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 []AppleUserInitiatedEnrollmentProfile 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 []AppleUserInitiatedEnrollmentProfile ) 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 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 } } } // Get performs GET request for AppleUserInitiatedEnrollmentProfile collection func (r *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest) Get(ctx context.Context) ([]AppleUserInitiatedEnrollmentProfile, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for AppleUserInitiatedEnrollmentProfile collection func (r *DeviceManagementAppleUserInitiatedEnrollmentProfilesCollectionRequest) Add(ctx context.Context, reqObj *AppleUserInitiatedEnrollmentProfile) (resObj *AppleUserInitiatedEnrollmentProfile, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // AuditEvents returns request builder for AuditEvent collection func (b *DeviceManagementRequestBuilder) AuditEvents() *DeviceManagementAuditEventsCollectionRequestBuilder { bb := &DeviceManagementAuditEventsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/auditEvents" return bb } // DeviceManagementAuditEventsCollectionRequestBuilder is request builder for AuditEvent collection type DeviceManagementAuditEventsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for AuditEvent collection func (b *DeviceManagementAuditEventsCollectionRequestBuilder) Request() *DeviceManagementAuditEventsCollectionRequest { return &DeviceManagementAuditEventsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for AuditEvent item func (b *DeviceManagementAuditEventsCollectionRequestBuilder) ID(id string) *AuditEventRequestBuilder { bb := &AuditEventRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementAuditEventsCollectionRequest is request for AuditEvent collection type DeviceManagementAuditEventsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for AuditEvent collection func (r *DeviceManagementAuditEventsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]AuditEvent, 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 []AuditEvent 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 []AuditEvent ) 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 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 } } } // Get performs GET request for AuditEvent collection func (r *DeviceManagementAuditEventsCollectionRequest) Get(ctx context.Context) ([]AuditEvent, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for AuditEvent collection func (r *DeviceManagementAuditEventsCollectionRequest) Add(ctx context.Context, reqObj *AuditEvent) (resObj *AuditEvent, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // AutopilotEvents returns request builder for DeviceManagementAutopilotEvent collection func (b *DeviceManagementRequestBuilder) AutopilotEvents() *DeviceManagementAutopilotEventsCollectionRequestBuilder { bb := &DeviceManagementAutopilotEventsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/autopilotEvents" return bb } // DeviceManagementAutopilotEventsCollectionRequestBuilder is request builder for DeviceManagementAutopilotEvent collection type DeviceManagementAutopilotEventsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementAutopilotEvent collection func (b *DeviceManagementAutopilotEventsCollectionRequestBuilder) Request() *DeviceManagementAutopilotEventsCollectionRequest { return &DeviceManagementAutopilotEventsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementAutopilotEvent item func (b *DeviceManagementAutopilotEventsCollectionRequestBuilder) ID(id string) *DeviceManagementAutopilotEventRequestBuilder { bb := &DeviceManagementAutopilotEventRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementAutopilotEventsCollectionRequest is request for DeviceManagementAutopilotEvent collection type DeviceManagementAutopilotEventsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementAutopilotEvent collection func (r *DeviceManagementAutopilotEventsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementAutopilotEvent, 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 []DeviceManagementAutopilotEvent 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 []DeviceManagementAutopilotEvent ) 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 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 } } } // Get performs GET request for DeviceManagementAutopilotEvent collection func (r *DeviceManagementAutopilotEventsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementAutopilotEvent, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementAutopilotEvent collection func (r *DeviceManagementAutopilotEventsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementAutopilotEvent) (resObj *DeviceManagementAutopilotEvent, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // CartToClassAssociations returns request builder for CartToClassAssociation collection func (b *DeviceManagementRequestBuilder) CartToClassAssociations() *DeviceManagementCartToClassAssociationsCollectionRequestBuilder { bb := &DeviceManagementCartToClassAssociationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/cartToClassAssociations" return bb } // DeviceManagementCartToClassAssociationsCollectionRequestBuilder is request builder for CartToClassAssociation collection type DeviceManagementCartToClassAssociationsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for CartToClassAssociation collection func (b *DeviceManagementCartToClassAssociationsCollectionRequestBuilder) Request() *DeviceManagementCartToClassAssociationsCollectionRequest { return &DeviceManagementCartToClassAssociationsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for CartToClassAssociation item func (b *DeviceManagementCartToClassAssociationsCollectionRequestBuilder) ID(id string) *CartToClassAssociationRequestBuilder { bb := &CartToClassAssociationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementCartToClassAssociationsCollectionRequest is request for CartToClassAssociation collection type DeviceManagementCartToClassAssociationsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for CartToClassAssociation collection func (r *DeviceManagementCartToClassAssociationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]CartToClassAssociation, 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 []CartToClassAssociation 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 []CartToClassAssociation ) 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 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 } } } // Get performs GET request for CartToClassAssociation collection func (r *DeviceManagementCartToClassAssociationsCollectionRequest) Get(ctx context.Context) ([]CartToClassAssociation, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for CartToClassAssociation collection func (r *DeviceManagementCartToClassAssociationsCollectionRequest) Add(ctx context.Context, reqObj *CartToClassAssociation) (resObj *CartToClassAssociation, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // Categories returns request builder for DeviceManagementSettingCategory collection func (b *DeviceManagementRequestBuilder) Categories() *DeviceManagementCategoriesCollectionRequestBuilder { bb := &DeviceManagementCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/categories" return bb } // DeviceManagementCategoriesCollectionRequestBuilder is request builder for DeviceManagementSettingCategory collection type DeviceManagementCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementSettingCategory collection func (b *DeviceManagementCategoriesCollectionRequestBuilder) Request() *DeviceManagementCategoriesCollectionRequest { return &DeviceManagementCategoriesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementSettingCategory item func (b *DeviceManagementCategoriesCollectionRequestBuilder) ID(id string) *DeviceManagementSettingCategoryRequestBuilder { bb := &DeviceManagementSettingCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementCategoriesCollectionRequest is request for DeviceManagementSettingCategory collection type DeviceManagementCategoriesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementSettingCategory collection func (r *DeviceManagementCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementSettingCategory, 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 []DeviceManagementSettingCategory 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 []DeviceManagementSettingCategory ) 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 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 } } } // Get performs GET request for DeviceManagementSettingCategory collection func (r *DeviceManagementCategoriesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingCategory, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementSettingCategory collection func (r *DeviceManagementCategoriesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingCategory) (resObj *DeviceManagementSettingCategory, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ComplianceManagementPartners returns request builder for ComplianceManagementPartner collection func (b *DeviceManagementRequestBuilder) ComplianceManagementPartners() *DeviceManagementComplianceManagementPartnersCollectionRequestBuilder { bb := &DeviceManagementComplianceManagementPartnersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/complianceManagementPartners" return bb } // DeviceManagementComplianceManagementPartnersCollectionRequestBuilder is request builder for ComplianceManagementPartner collection type DeviceManagementComplianceManagementPartnersCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for ComplianceManagementPartner collection func (b *DeviceManagementComplianceManagementPartnersCollectionRequestBuilder) Request() *DeviceManagementComplianceManagementPartnersCollectionRequest { return &DeviceManagementComplianceManagementPartnersCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for ComplianceManagementPartner item func (b *DeviceManagementComplianceManagementPartnersCollectionRequestBuilder) ID(id string) *ComplianceManagementPartnerRequestBuilder { bb := &ComplianceManagementPartnerRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementComplianceManagementPartnersCollectionRequest is request for ComplianceManagementPartner collection type DeviceManagementComplianceManagementPartnersCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for ComplianceManagementPartner collection func (r *DeviceManagementComplianceManagementPartnersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]ComplianceManagementPartner, 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 []ComplianceManagementPartner 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 []ComplianceManagementPartner ) 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 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 } } } // Get performs GET request for ComplianceManagementPartner collection func (r *DeviceManagementComplianceManagementPartnersCollectionRequest) Get(ctx context.Context) ([]ComplianceManagementPartner, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for ComplianceManagementPartner collection func (r *DeviceManagementComplianceManagementPartnersCollectionRequest) Add(ctx context.Context, reqObj *ComplianceManagementPartner) (resObj *ComplianceManagementPartner, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ConditionalAccessSettings is navigation property func (b *DeviceManagementRequestBuilder) ConditionalAccessSettings() *OnPremisesConditionalAccessSettingsRequestBuilder { bb := &OnPremisesConditionalAccessSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/conditionalAccessSettings" return bb } // DataSharingConsents returns request builder for DataSharingConsent collection func (b *DeviceManagementRequestBuilder) DataSharingConsents() *DeviceManagementDataSharingConsentsCollectionRequestBuilder { bb := &DeviceManagementDataSharingConsentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/dataSharingConsents" return bb } // DeviceManagementDataSharingConsentsCollectionRequestBuilder is request builder for DataSharingConsent collection type DeviceManagementDataSharingConsentsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DataSharingConsent collection func (b *DeviceManagementDataSharingConsentsCollectionRequestBuilder) Request() *DeviceManagementDataSharingConsentsCollectionRequest { return &DeviceManagementDataSharingConsentsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DataSharingConsent item func (b *DeviceManagementDataSharingConsentsCollectionRequestBuilder) ID(id string) *DataSharingConsentRequestBuilder { bb := &DataSharingConsentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDataSharingConsentsCollectionRequest is request for DataSharingConsent collection type DeviceManagementDataSharingConsentsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DataSharingConsent collection func (r *DeviceManagementDataSharingConsentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DataSharingConsent, 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 []DataSharingConsent 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 []DataSharingConsent ) 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 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 } } } // Get performs GET request for DataSharingConsent collection func (r *DeviceManagementDataSharingConsentsCollectionRequest) Get(ctx context.Context) ([]DataSharingConsent, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DataSharingConsent collection func (r *DeviceManagementDataSharingConsentsCollectionRequest) Add(ctx context.Context, reqObj *DataSharingConsent) (resObj *DataSharingConsent, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DepOnboardingSettings returns request builder for DepOnboardingSetting collection func (b *DeviceManagementRequestBuilder) DepOnboardingSettings() *DeviceManagementDepOnboardingSettingsCollectionRequestBuilder { bb := &DeviceManagementDepOnboardingSettingsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/depOnboardingSettings" return bb } // DeviceManagementDepOnboardingSettingsCollectionRequestBuilder is request builder for DepOnboardingSetting collection type DeviceManagementDepOnboardingSettingsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DepOnboardingSetting collection func (b *DeviceManagementDepOnboardingSettingsCollectionRequestBuilder) Request() *DeviceManagementDepOnboardingSettingsCollectionRequest { return &DeviceManagementDepOnboardingSettingsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DepOnboardingSetting item func (b *DeviceManagementDepOnboardingSettingsCollectionRequestBuilder) ID(id string) *DepOnboardingSettingRequestBuilder { bb := &DepOnboardingSettingRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDepOnboardingSettingsCollectionRequest is request for DepOnboardingSetting collection type DeviceManagementDepOnboardingSettingsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DepOnboardingSetting collection func (r *DeviceManagementDepOnboardingSettingsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DepOnboardingSetting, 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 []DepOnboardingSetting 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 []DepOnboardingSetting ) 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 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 } } } // Get performs GET request for DepOnboardingSetting collection func (r *DeviceManagementDepOnboardingSettingsCollectionRequest) Get(ctx context.Context) ([]DepOnboardingSetting, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DepOnboardingSetting collection func (r *DeviceManagementDepOnboardingSettingsCollectionRequest) Add(ctx context.Context, reqObj *DepOnboardingSetting) (resObj *DepOnboardingSetting, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DerivedCredentials returns request builder for DeviceManagementDerivedCredentialSettings collection func (b *DeviceManagementRequestBuilder) DerivedCredentials() *DeviceManagementDerivedCredentialsCollectionRequestBuilder { bb := &DeviceManagementDerivedCredentialsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/derivedCredentials" return bb } // DeviceManagementDerivedCredentialsCollectionRequestBuilder is request builder for DeviceManagementDerivedCredentialSettings collection type DeviceManagementDerivedCredentialsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementDerivedCredentialSettings collection func (b *DeviceManagementDerivedCredentialsCollectionRequestBuilder) Request() *DeviceManagementDerivedCredentialsCollectionRequest { return &DeviceManagementDerivedCredentialsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementDerivedCredentialSettings item func (b *DeviceManagementDerivedCredentialsCollectionRequestBuilder) ID(id string) *DeviceManagementDerivedCredentialSettingsRequestBuilder { bb := &DeviceManagementDerivedCredentialSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDerivedCredentialsCollectionRequest is request for DeviceManagementDerivedCredentialSettings collection type DeviceManagementDerivedCredentialsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementDerivedCredentialSettings collection func (r *DeviceManagementDerivedCredentialsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementDerivedCredentialSettings, 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 []DeviceManagementDerivedCredentialSettings 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 []DeviceManagementDerivedCredentialSettings ) 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 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 } } } // Get performs GET request for DeviceManagementDerivedCredentialSettings collection func (r *DeviceManagementDerivedCredentialsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementDerivedCredentialSettings, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementDerivedCredentialSettings collection func (r *DeviceManagementDerivedCredentialsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementDerivedCredentialSettings) (resObj *DeviceManagementDerivedCredentialSettings, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DetectedApps returns request builder for DetectedApp collection func (b *DeviceManagementRequestBuilder) DetectedApps() *DeviceManagementDetectedAppsCollectionRequestBuilder { bb := &DeviceManagementDetectedAppsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/detectedApps" return bb } // DeviceManagementDetectedAppsCollectionRequestBuilder is request builder for DetectedApp collection type DeviceManagementDetectedAppsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DetectedApp collection func (b *DeviceManagementDetectedAppsCollectionRequestBuilder) Request() *DeviceManagementDetectedAppsCollectionRequest { return &DeviceManagementDetectedAppsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DetectedApp item func (b *DeviceManagementDetectedAppsCollectionRequestBuilder) ID(id string) *DetectedAppRequestBuilder { bb := &DetectedAppRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDetectedAppsCollectionRequest is request for DetectedApp collection type DeviceManagementDetectedAppsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DetectedApp collection func (r *DeviceManagementDetectedAppsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DetectedApp, 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 []DetectedApp 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 []DetectedApp ) 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 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 } } } // Get performs GET request for DetectedApp collection func (r *DeviceManagementDetectedAppsCollectionRequest) Get(ctx context.Context) ([]DetectedApp, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DetectedApp collection func (r *DeviceManagementDetectedAppsCollectionRequest) Add(ctx context.Context, reqObj *DetectedApp) (resObj *DetectedApp, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceCategories returns request builder for DeviceCategory collection func (b *DeviceManagementRequestBuilder) DeviceCategories() *DeviceManagementDeviceCategoriesCollectionRequestBuilder { bb := &DeviceManagementDeviceCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceCategories" return bb } // DeviceManagementDeviceCategoriesCollectionRequestBuilder is request builder for DeviceCategory collection type DeviceManagementDeviceCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceCategory collection func (b *DeviceManagementDeviceCategoriesCollectionRequestBuilder) Request() *DeviceManagementDeviceCategoriesCollectionRequest { return &DeviceManagementDeviceCategoriesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceCategory item func (b *DeviceManagementDeviceCategoriesCollectionRequestBuilder) ID(id string) *DeviceCategoryRequestBuilder { bb := &DeviceCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceCategoriesCollectionRequest is request for DeviceCategory collection type DeviceManagementDeviceCategoriesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceCategory collection func (r *DeviceManagementDeviceCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceCategory, 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 []DeviceCategory 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 []DeviceCategory ) 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 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 } } } // Get performs GET request for DeviceCategory collection func (r *DeviceManagementDeviceCategoriesCollectionRequest) Get(ctx context.Context) ([]DeviceCategory, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceCategory collection func (r *DeviceManagementDeviceCategoriesCollectionRequest) Add(ctx context.Context, reqObj *DeviceCategory) (resObj *DeviceCategory, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceCompliancePolicies returns request builder for DeviceCompliancePolicy collection func (b *DeviceManagementRequestBuilder) DeviceCompliancePolicies() *DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder { bb := &DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceCompliancePolicies" return bb } // DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder is request builder for DeviceCompliancePolicy collection type DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceCompliancePolicy collection func (b *DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder) Request() *DeviceManagementDeviceCompliancePoliciesCollectionRequest { return &DeviceManagementDeviceCompliancePoliciesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceCompliancePolicy item func (b *DeviceManagementDeviceCompliancePoliciesCollectionRequestBuilder) ID(id string) *DeviceCompliancePolicyRequestBuilder { bb := &DeviceCompliancePolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceCompliancePoliciesCollectionRequest is request for DeviceCompliancePolicy collection type DeviceManagementDeviceCompliancePoliciesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceCompliancePolicy collection func (r *DeviceManagementDeviceCompliancePoliciesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceCompliancePolicy, 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 []DeviceCompliancePolicy 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 []DeviceCompliancePolicy ) 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 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 } } } // Get performs GET request for DeviceCompliancePolicy collection func (r *DeviceManagementDeviceCompliancePoliciesCollectionRequest) Get(ctx context.Context) ([]DeviceCompliancePolicy, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceCompliancePolicy collection func (r *DeviceManagementDeviceCompliancePoliciesCollectionRequest) Add(ctx context.Context, reqObj *DeviceCompliancePolicy) (resObj *DeviceCompliancePolicy, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceCompliancePolicyDeviceStateSummary is navigation property func (b *DeviceManagementRequestBuilder) DeviceCompliancePolicyDeviceStateSummary() *DeviceCompliancePolicyDeviceStateSummaryRequestBuilder { bb := &DeviceCompliancePolicyDeviceStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceCompliancePolicyDeviceStateSummary" return bb } // DeviceCompliancePolicySettingStateSummaries returns request builder for DeviceCompliancePolicySettingStateSummary collection func (b *DeviceManagementRequestBuilder) DeviceCompliancePolicySettingStateSummaries() *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder { bb := &DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceCompliancePolicySettingStateSummaries" return bb } // DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder is request builder for DeviceCompliancePolicySettingStateSummary collection type DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceCompliancePolicySettingStateSummary collection func (b *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder) Request() *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest { return &DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceCompliancePolicySettingStateSummary item func (b *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequestBuilder) ID(id string) *DeviceCompliancePolicySettingStateSummaryRequestBuilder { bb := &DeviceCompliancePolicySettingStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest is request for DeviceCompliancePolicySettingStateSummary collection type DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceCompliancePolicySettingStateSummary collection func (r *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceCompliancePolicySettingStateSummary, 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 []DeviceCompliancePolicySettingStateSummary 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 []DeviceCompliancePolicySettingStateSummary ) 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 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 } } } // Get performs GET request for DeviceCompliancePolicySettingStateSummary collection func (r *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest) Get(ctx context.Context) ([]DeviceCompliancePolicySettingStateSummary, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceCompliancePolicySettingStateSummary collection func (r *DeviceManagementDeviceCompliancePolicySettingStateSummariesCollectionRequest) Add(ctx context.Context, reqObj *DeviceCompliancePolicySettingStateSummary) (resObj *DeviceCompliancePolicySettingStateSummary, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceConfigurationConflictSummary returns request builder for DeviceConfigurationConflictSummary collection func (b *DeviceManagementRequestBuilder) DeviceConfigurationConflictSummary() *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder { bb := &DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceConfigurationConflictSummary" return bb } // DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder is request builder for DeviceConfigurationConflictSummary collection type DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceConfigurationConflictSummary collection func (b *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder) Request() *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest { return &DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceConfigurationConflictSummary item func (b *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequestBuilder) ID(id string) *DeviceConfigurationConflictSummaryRequestBuilder { bb := &DeviceConfigurationConflictSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest is request for DeviceConfigurationConflictSummary collection type DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceConfigurationConflictSummary collection func (r *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceConfigurationConflictSummary, 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 []DeviceConfigurationConflictSummary 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 []DeviceConfigurationConflictSummary ) 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 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 } } } // Get performs GET request for DeviceConfigurationConflictSummary collection func (r *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest) Get(ctx context.Context) ([]DeviceConfigurationConflictSummary, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceConfigurationConflictSummary collection func (r *DeviceManagementDeviceConfigurationConflictSummaryCollectionRequest) Add(ctx context.Context, reqObj *DeviceConfigurationConflictSummary) (resObj *DeviceConfigurationConflictSummary, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceConfigurationDeviceStateSummaries is navigation property func (b *DeviceManagementRequestBuilder) DeviceConfigurationDeviceStateSummaries() *DeviceConfigurationDeviceStateSummaryRequestBuilder { bb := &DeviceConfigurationDeviceStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceConfigurationDeviceStateSummaries" return bb } // DeviceConfigurationRestrictedAppsViolations returns request builder for RestrictedAppsViolation collection func (b *DeviceManagementRequestBuilder) DeviceConfigurationRestrictedAppsViolations() *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder { bb := &DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceConfigurationRestrictedAppsViolations" return bb } // DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder is request builder for RestrictedAppsViolation collection type DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for RestrictedAppsViolation collection func (b *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder) Request() *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest { return &DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for RestrictedAppsViolation item func (b *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequestBuilder) ID(id string) *RestrictedAppsViolationRequestBuilder { bb := &RestrictedAppsViolationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest is request for RestrictedAppsViolation collection type DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for RestrictedAppsViolation collection func (r *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]RestrictedAppsViolation, 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 []RestrictedAppsViolation 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 []RestrictedAppsViolation ) 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 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 } } } // Get performs GET request for RestrictedAppsViolation collection func (r *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest) Get(ctx context.Context) ([]RestrictedAppsViolation, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for RestrictedAppsViolation collection func (r *DeviceManagementDeviceConfigurationRestrictedAppsViolationsCollectionRequest) Add(ctx context.Context, reqObj *RestrictedAppsViolation) (resObj *RestrictedAppsViolation, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceConfigurationUserStateSummaries is navigation property func (b *DeviceManagementRequestBuilder) DeviceConfigurationUserStateSummaries() *DeviceConfigurationUserStateSummaryRequestBuilder { bb := &DeviceConfigurationUserStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceConfigurationUserStateSummaries" return bb } // DeviceConfigurations returns request builder for DeviceConfiguration collection func (b *DeviceManagementRequestBuilder) DeviceConfigurations() *DeviceManagementDeviceConfigurationsCollectionRequestBuilder { bb := &DeviceManagementDeviceConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceConfigurations" return bb } // DeviceManagementDeviceConfigurationsCollectionRequestBuilder is request builder for DeviceConfiguration collection type DeviceManagementDeviceConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceConfiguration collection func (b *DeviceManagementDeviceConfigurationsCollectionRequestBuilder) Request() *DeviceManagementDeviceConfigurationsCollectionRequest { return &DeviceManagementDeviceConfigurationsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceConfiguration item func (b *DeviceManagementDeviceConfigurationsCollectionRequestBuilder) ID(id string) *DeviceConfigurationRequestBuilder { bb := &DeviceConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceConfigurationsCollectionRequest is request for DeviceConfiguration collection type DeviceManagementDeviceConfigurationsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceConfiguration collection func (r *DeviceManagementDeviceConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceConfiguration, 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 []DeviceConfiguration 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 []DeviceConfiguration ) 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 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 } } } // Get performs GET request for DeviceConfiguration collection func (r *DeviceManagementDeviceConfigurationsCollectionRequest) Get(ctx context.Context) ([]DeviceConfiguration, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceConfiguration collection func (r *DeviceManagementDeviceConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *DeviceConfiguration) (resObj *DeviceConfiguration, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceConfigurationsAllManagedDeviceCertificateStates returns request builder for ManagedAllDeviceCertificateState collection func (b *DeviceManagementRequestBuilder) DeviceConfigurationsAllManagedDeviceCertificateStates() *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder { bb := &DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceConfigurationsAllManagedDeviceCertificateStates" return bb } // DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder is request builder for ManagedAllDeviceCertificateState collection type DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for ManagedAllDeviceCertificateState collection func (b *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder) Request() *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest { return &DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for ManagedAllDeviceCertificateState item func (b *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequestBuilder) ID(id string) *ManagedAllDeviceCertificateStateRequestBuilder { bb := &ManagedAllDeviceCertificateStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest is request for ManagedAllDeviceCertificateState collection type DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for ManagedAllDeviceCertificateState collection func (r *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]ManagedAllDeviceCertificateState, 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 []ManagedAllDeviceCertificateState 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 []ManagedAllDeviceCertificateState ) 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 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 } } } // Get performs GET request for ManagedAllDeviceCertificateState collection func (r *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest) Get(ctx context.Context) ([]ManagedAllDeviceCertificateState, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for ManagedAllDeviceCertificateState collection func (r *DeviceManagementDeviceConfigurationsAllManagedDeviceCertificateStatesCollectionRequest) Add(ctx context.Context, reqObj *ManagedAllDeviceCertificateState) (resObj *ManagedAllDeviceCertificateState, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceEnrollmentConfigurations returns request builder for DeviceEnrollmentConfiguration collection func (b *DeviceManagementRequestBuilder) DeviceEnrollmentConfigurations() *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder { bb := &DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceEnrollmentConfigurations" return bb } // DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder is request builder for DeviceEnrollmentConfiguration collection type DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceEnrollmentConfiguration collection func (b *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder) Request() *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest { return &DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceEnrollmentConfiguration item func (b *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequestBuilder) ID(id string) *DeviceEnrollmentConfigurationRequestBuilder { bb := &DeviceEnrollmentConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest is request for DeviceEnrollmentConfiguration collection type DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceEnrollmentConfiguration collection func (r *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceEnrollmentConfiguration, 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 []DeviceEnrollmentConfiguration 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 []DeviceEnrollmentConfiguration ) 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 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 } } } // Get performs GET request for DeviceEnrollmentConfiguration collection func (r *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest) Get(ctx context.Context) ([]DeviceEnrollmentConfiguration, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceEnrollmentConfiguration collection func (r *DeviceManagementDeviceEnrollmentConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *DeviceEnrollmentConfiguration) (resObj *DeviceEnrollmentConfiguration, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceHealthScripts returns request builder for DeviceHealthScript collection func (b *DeviceManagementRequestBuilder) DeviceHealthScripts() *DeviceManagementDeviceHealthScriptsCollectionRequestBuilder { bb := &DeviceManagementDeviceHealthScriptsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceHealthScripts" return bb } // DeviceManagementDeviceHealthScriptsCollectionRequestBuilder is request builder for DeviceHealthScript collection type DeviceManagementDeviceHealthScriptsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceHealthScript collection func (b *DeviceManagementDeviceHealthScriptsCollectionRequestBuilder) Request() *DeviceManagementDeviceHealthScriptsCollectionRequest { return &DeviceManagementDeviceHealthScriptsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceHealthScript item func (b *DeviceManagementDeviceHealthScriptsCollectionRequestBuilder) ID(id string) *DeviceHealthScriptRequestBuilder { bb := &DeviceHealthScriptRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceHealthScriptsCollectionRequest is request for DeviceHealthScript collection type DeviceManagementDeviceHealthScriptsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceHealthScript collection func (r *DeviceManagementDeviceHealthScriptsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceHealthScript, 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 []DeviceHealthScript 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 []DeviceHealthScript ) 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 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 } } } // Get performs GET request for DeviceHealthScript collection func (r *DeviceManagementDeviceHealthScriptsCollectionRequest) Get(ctx context.Context) ([]DeviceHealthScript, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceHealthScript collection func (r *DeviceManagementDeviceHealthScriptsCollectionRequest) Add(ctx context.Context, reqObj *DeviceHealthScript) (resObj *DeviceHealthScript, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceManagementPartners returns request builder for DeviceManagementPartner collection func (b *DeviceManagementRequestBuilder) DeviceManagementPartners() *DeviceManagementDeviceManagementPartnersCollectionRequestBuilder { bb := &DeviceManagementDeviceManagementPartnersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceManagementPartners" return bb } // DeviceManagementDeviceManagementPartnersCollectionRequestBuilder is request builder for DeviceManagementPartner collection type DeviceManagementDeviceManagementPartnersCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementPartner collection func (b *DeviceManagementDeviceManagementPartnersCollectionRequestBuilder) Request() *DeviceManagementDeviceManagementPartnersCollectionRequest { return &DeviceManagementDeviceManagementPartnersCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementPartner item func (b *DeviceManagementDeviceManagementPartnersCollectionRequestBuilder) ID(id string) *DeviceManagementPartnerRequestBuilder { bb := &DeviceManagementPartnerRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceManagementPartnersCollectionRequest is request for DeviceManagementPartner collection type DeviceManagementDeviceManagementPartnersCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementPartner collection func (r *DeviceManagementDeviceManagementPartnersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementPartner, 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 []DeviceManagementPartner 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 []DeviceManagementPartner ) 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 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 } } } // Get performs GET request for DeviceManagementPartner collection func (r *DeviceManagementDeviceManagementPartnersCollectionRequest) Get(ctx context.Context) ([]DeviceManagementPartner, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementPartner collection func (r *DeviceManagementDeviceManagementPartnersCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementPartner) (resObj *DeviceManagementPartner, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DeviceManagementScripts returns request builder for DeviceManagementScript collection func (b *DeviceManagementRequestBuilder) DeviceManagementScripts() *DeviceManagementDeviceManagementScriptsCollectionRequestBuilder { bb := &DeviceManagementDeviceManagementScriptsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/deviceManagementScripts" return bb } // DeviceManagementDeviceManagementScriptsCollectionRequestBuilder is request builder for DeviceManagementScript collection type DeviceManagementDeviceManagementScriptsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementScript collection func (b *DeviceManagementDeviceManagementScriptsCollectionRequestBuilder) Request() *DeviceManagementDeviceManagementScriptsCollectionRequest { return &DeviceManagementDeviceManagementScriptsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementScript item func (b *DeviceManagementDeviceManagementScriptsCollectionRequestBuilder) ID(id string) *DeviceManagementScriptRequestBuilder { bb := &DeviceManagementScriptRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDeviceManagementScriptsCollectionRequest is request for DeviceManagementScript collection type DeviceManagementDeviceManagementScriptsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementScript collection func (r *DeviceManagementDeviceManagementScriptsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementScript, 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 []DeviceManagementScript 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 []DeviceManagementScript ) 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 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 } } } // Get performs GET request for DeviceManagementScript collection func (r *DeviceManagementDeviceManagementScriptsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementScript, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementScript collection func (r *DeviceManagementDeviceManagementScriptsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementScript) (resObj *DeviceManagementScript, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // DomainJoinConnectors returns request builder for DeviceManagementDomainJoinConnector collection func (b *DeviceManagementRequestBuilder) DomainJoinConnectors() *DeviceManagementDomainJoinConnectorsCollectionRequestBuilder { bb := &DeviceManagementDomainJoinConnectorsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/domainJoinConnectors" return bb } // DeviceManagementDomainJoinConnectorsCollectionRequestBuilder is request builder for DeviceManagementDomainJoinConnector collection type DeviceManagementDomainJoinConnectorsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementDomainJoinConnector collection func (b *DeviceManagementDomainJoinConnectorsCollectionRequestBuilder) Request() *DeviceManagementDomainJoinConnectorsCollectionRequest { return &DeviceManagementDomainJoinConnectorsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementDomainJoinConnector item func (b *DeviceManagementDomainJoinConnectorsCollectionRequestBuilder) ID(id string) *DeviceManagementDomainJoinConnectorRequestBuilder { bb := &DeviceManagementDomainJoinConnectorRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementDomainJoinConnectorsCollectionRequest is request for DeviceManagementDomainJoinConnector collection type DeviceManagementDomainJoinConnectorsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementDomainJoinConnector collection func (r *DeviceManagementDomainJoinConnectorsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementDomainJoinConnector, 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 []DeviceManagementDomainJoinConnector 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 []DeviceManagementDomainJoinConnector ) 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 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 } } } // Get performs GET request for DeviceManagementDomainJoinConnector collection func (r *DeviceManagementDomainJoinConnectorsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementDomainJoinConnector, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementDomainJoinConnector collection func (r *DeviceManagementDomainJoinConnectorsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementDomainJoinConnector) (resObj *DeviceManagementDomainJoinConnector, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // EmbeddedSIMActivationCodePools returns request builder for EmbeddedSIMActivationCodePool collection func (b *DeviceManagementRequestBuilder) EmbeddedSIMActivationCodePools() *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder { bb := &DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/embeddedSIMActivationCodePools" return bb } // DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder is request builder for EmbeddedSIMActivationCodePool collection type DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for EmbeddedSIMActivationCodePool collection func (b *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder) Request() *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest { return &DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for EmbeddedSIMActivationCodePool item func (b *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequestBuilder) ID(id string) *EmbeddedSIMActivationCodePoolRequestBuilder { bb := &EmbeddedSIMActivationCodePoolRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest is request for EmbeddedSIMActivationCodePool collection type DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for EmbeddedSIMActivationCodePool collection func (r *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]EmbeddedSIMActivationCodePool, 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 []EmbeddedSIMActivationCodePool 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 []EmbeddedSIMActivationCodePool ) 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 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 } } } // Get performs GET request for EmbeddedSIMActivationCodePool collection func (r *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest) Get(ctx context.Context) ([]EmbeddedSIMActivationCodePool, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for EmbeddedSIMActivationCodePool collection func (r *DeviceManagementEmbeddedSIMActivationCodePoolsCollectionRequest) Add(ctx context.Context, reqObj *EmbeddedSIMActivationCodePool) (resObj *EmbeddedSIMActivationCodePool, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ExchangeConnectors returns request builder for DeviceManagementExchangeConnector collection func (b *DeviceManagementRequestBuilder) ExchangeConnectors() *DeviceManagementExchangeConnectorsCollectionRequestBuilder { bb := &DeviceManagementExchangeConnectorsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/exchangeConnectors" return bb } // DeviceManagementExchangeConnectorsCollectionRequestBuilder is request builder for DeviceManagementExchangeConnector collection type DeviceManagementExchangeConnectorsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementExchangeConnector collection func (b *DeviceManagementExchangeConnectorsCollectionRequestBuilder) Request() *DeviceManagementExchangeConnectorsCollectionRequest { return &DeviceManagementExchangeConnectorsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementExchangeConnector item func (b *DeviceManagementExchangeConnectorsCollectionRequestBuilder) ID(id string) *DeviceManagementExchangeConnectorRequestBuilder { bb := &DeviceManagementExchangeConnectorRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementExchangeConnectorsCollectionRequest is request for DeviceManagementExchangeConnector collection type DeviceManagementExchangeConnectorsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementExchangeConnector collection func (r *DeviceManagementExchangeConnectorsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementExchangeConnector, 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 []DeviceManagementExchangeConnector 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 []DeviceManagementExchangeConnector ) 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 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 } } } // Get performs GET request for DeviceManagementExchangeConnector collection func (r *DeviceManagementExchangeConnectorsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementExchangeConnector, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementExchangeConnector collection func (r *DeviceManagementExchangeConnectorsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementExchangeConnector) (resObj *DeviceManagementExchangeConnector, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ExchangeOnPremisesPolicies returns request builder for DeviceManagementExchangeOnPremisesPolicy collection func (b *DeviceManagementRequestBuilder) ExchangeOnPremisesPolicies() *DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder { bb := &DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/exchangeOnPremisesPolicies" return bb } // DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder is request builder for DeviceManagementExchangeOnPremisesPolicy collection type DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementExchangeOnPremisesPolicy collection func (b *DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder) Request() *DeviceManagementExchangeOnPremisesPoliciesCollectionRequest { return &DeviceManagementExchangeOnPremisesPoliciesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementExchangeOnPremisesPolicy item func (b *DeviceManagementExchangeOnPremisesPoliciesCollectionRequestBuilder) ID(id string) *DeviceManagementExchangeOnPremisesPolicyRequestBuilder { bb := &DeviceManagementExchangeOnPremisesPolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementExchangeOnPremisesPoliciesCollectionRequest is request for DeviceManagementExchangeOnPremisesPolicy collection type DeviceManagementExchangeOnPremisesPoliciesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementExchangeOnPremisesPolicy collection func (r *DeviceManagementExchangeOnPremisesPoliciesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementExchangeOnPremisesPolicy, 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 []DeviceManagementExchangeOnPremisesPolicy 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 []DeviceManagementExchangeOnPremisesPolicy ) 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 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 } } } // Get performs GET request for DeviceManagementExchangeOnPremisesPolicy collection func (r *DeviceManagementExchangeOnPremisesPoliciesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementExchangeOnPremisesPolicy, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementExchangeOnPremisesPolicy collection func (r *DeviceManagementExchangeOnPremisesPoliciesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementExchangeOnPremisesPolicy) (resObj *DeviceManagementExchangeOnPremisesPolicy, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ExchangeOnPremisesPolicy is navigation property func (b *DeviceManagementRequestBuilder) ExchangeOnPremisesPolicy() *DeviceManagementExchangeOnPremisesPolicyRequestBuilder { bb := &DeviceManagementExchangeOnPremisesPolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/exchangeOnPremisesPolicy" return bb } // GroupPolicyConfigurations returns request builder for GroupPolicyConfiguration collection func (b *DeviceManagementRequestBuilder) GroupPolicyConfigurations() *DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder { bb := &DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/groupPolicyConfigurations" return bb } // DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder is request builder for GroupPolicyConfiguration collection type DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for GroupPolicyConfiguration collection func (b *DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder) Request() *DeviceManagementGroupPolicyConfigurationsCollectionRequest { return &DeviceManagementGroupPolicyConfigurationsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for GroupPolicyConfiguration item func (b *DeviceManagementGroupPolicyConfigurationsCollectionRequestBuilder) ID(id string) *GroupPolicyConfigurationRequestBuilder { bb := &GroupPolicyConfigurationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementGroupPolicyConfigurationsCollectionRequest is request for GroupPolicyConfiguration collection type DeviceManagementGroupPolicyConfigurationsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for GroupPolicyConfiguration collection func (r *DeviceManagementGroupPolicyConfigurationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]GroupPolicyConfiguration, 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 []GroupPolicyConfiguration 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 []GroupPolicyConfiguration ) 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 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 } } } // Get performs GET request for GroupPolicyConfiguration collection func (r *DeviceManagementGroupPolicyConfigurationsCollectionRequest) Get(ctx context.Context) ([]GroupPolicyConfiguration, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for GroupPolicyConfiguration collection func (r *DeviceManagementGroupPolicyConfigurationsCollectionRequest) Add(ctx context.Context, reqObj *GroupPolicyConfiguration) (resObj *GroupPolicyConfiguration, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // GroupPolicyDefinitionFiles returns request builder for GroupPolicyDefinitionFile collection func (b *DeviceManagementRequestBuilder) GroupPolicyDefinitionFiles() *DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder { bb := &DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/groupPolicyDefinitionFiles" return bb } // DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder is request builder for GroupPolicyDefinitionFile collection type DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for GroupPolicyDefinitionFile collection func (b *DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder) Request() *DeviceManagementGroupPolicyDefinitionFilesCollectionRequest { return &DeviceManagementGroupPolicyDefinitionFilesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for GroupPolicyDefinitionFile item func (b *DeviceManagementGroupPolicyDefinitionFilesCollectionRequestBuilder) ID(id string) *GroupPolicyDefinitionFileRequestBuilder { bb := &GroupPolicyDefinitionFileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementGroupPolicyDefinitionFilesCollectionRequest is request for GroupPolicyDefinitionFile collection type DeviceManagementGroupPolicyDefinitionFilesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for GroupPolicyDefinitionFile collection func (r *DeviceManagementGroupPolicyDefinitionFilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]GroupPolicyDefinitionFile, 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 []GroupPolicyDefinitionFile 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 []GroupPolicyDefinitionFile ) 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 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 } } } // Get performs GET request for GroupPolicyDefinitionFile collection func (r *DeviceManagementGroupPolicyDefinitionFilesCollectionRequest) Get(ctx context.Context) ([]GroupPolicyDefinitionFile, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for GroupPolicyDefinitionFile collection func (r *DeviceManagementGroupPolicyDefinitionFilesCollectionRequest) Add(ctx context.Context, reqObj *GroupPolicyDefinitionFile) (resObj *GroupPolicyDefinitionFile, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // GroupPolicyDefinitions returns request builder for GroupPolicyDefinition collection func (b *DeviceManagementRequestBuilder) GroupPolicyDefinitions() *DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder { bb := &DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/groupPolicyDefinitions" return bb } // DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder is request builder for GroupPolicyDefinition collection type DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for GroupPolicyDefinition collection func (b *DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder) Request() *DeviceManagementGroupPolicyDefinitionsCollectionRequest { return &DeviceManagementGroupPolicyDefinitionsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for GroupPolicyDefinition item func (b *DeviceManagementGroupPolicyDefinitionsCollectionRequestBuilder) ID(id string) *GroupPolicyDefinitionRequestBuilder { bb := &GroupPolicyDefinitionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementGroupPolicyDefinitionsCollectionRequest is request for GroupPolicyDefinition collection type DeviceManagementGroupPolicyDefinitionsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for GroupPolicyDefinition collection func (r *DeviceManagementGroupPolicyDefinitionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]GroupPolicyDefinition, 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 []GroupPolicyDefinition 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 []GroupPolicyDefinition ) 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 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 } } } // Get performs GET request for GroupPolicyDefinition collection func (r *DeviceManagementGroupPolicyDefinitionsCollectionRequest) Get(ctx context.Context) ([]GroupPolicyDefinition, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for GroupPolicyDefinition collection func (r *DeviceManagementGroupPolicyDefinitionsCollectionRequest) Add(ctx context.Context, reqObj *GroupPolicyDefinition) (resObj *GroupPolicyDefinition, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // GroupPolicyMigrationReports returns request builder for GroupPolicyMigrationReport collection func (b *DeviceManagementRequestBuilder) GroupPolicyMigrationReports() *DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder { bb := &DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/groupPolicyMigrationReports" return bb } // DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder is request builder for GroupPolicyMigrationReport collection type DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for GroupPolicyMigrationReport collection func (b *DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder) Request() *DeviceManagementGroupPolicyMigrationReportsCollectionRequest { return &DeviceManagementGroupPolicyMigrationReportsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for GroupPolicyMigrationReport item func (b *DeviceManagementGroupPolicyMigrationReportsCollectionRequestBuilder) ID(id string) *GroupPolicyMigrationReportRequestBuilder { bb := &GroupPolicyMigrationReportRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementGroupPolicyMigrationReportsCollectionRequest is request for GroupPolicyMigrationReport collection type DeviceManagementGroupPolicyMigrationReportsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for GroupPolicyMigrationReport collection func (r *DeviceManagementGroupPolicyMigrationReportsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]GroupPolicyMigrationReport, 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 []GroupPolicyMigrationReport 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 []GroupPolicyMigrationReport ) 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 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 } } } // Get performs GET request for GroupPolicyMigrationReport collection func (r *DeviceManagementGroupPolicyMigrationReportsCollectionRequest) Get(ctx context.Context) ([]GroupPolicyMigrationReport, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for GroupPolicyMigrationReport collection func (r *DeviceManagementGroupPolicyMigrationReportsCollectionRequest) Add(ctx context.Context, reqObj *GroupPolicyMigrationReport) (resObj *GroupPolicyMigrationReport, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ImportedDeviceIdentities returns request builder for ImportedDeviceIdentity collection func (b *DeviceManagementRequestBuilder) ImportedDeviceIdentities() *DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder { bb := &DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/importedDeviceIdentities" return bb } // DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder is request builder for ImportedDeviceIdentity collection type DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for ImportedDeviceIdentity collection func (b *DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder) Request() *DeviceManagementImportedDeviceIdentitiesCollectionRequest { return &DeviceManagementImportedDeviceIdentitiesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for ImportedDeviceIdentity item func (b *DeviceManagementImportedDeviceIdentitiesCollectionRequestBuilder) ID(id string) *ImportedDeviceIdentityRequestBuilder { bb := &ImportedDeviceIdentityRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementImportedDeviceIdentitiesCollectionRequest is request for ImportedDeviceIdentity collection type DeviceManagementImportedDeviceIdentitiesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for ImportedDeviceIdentity collection func (r *DeviceManagementImportedDeviceIdentitiesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]ImportedDeviceIdentity, 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 []ImportedDeviceIdentity 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 []ImportedDeviceIdentity ) 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 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 } } } // Get performs GET request for ImportedDeviceIdentity collection func (r *DeviceManagementImportedDeviceIdentitiesCollectionRequest) Get(ctx context.Context) ([]ImportedDeviceIdentity, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for ImportedDeviceIdentity collection func (r *DeviceManagementImportedDeviceIdentitiesCollectionRequest) Add(ctx context.Context, reqObj *ImportedDeviceIdentity) (resObj *ImportedDeviceIdentity, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ImportedWindowsAutopilotDeviceIdentities returns request builder for ImportedWindowsAutopilotDeviceIdentity collection func (b *DeviceManagementRequestBuilder) ImportedWindowsAutopilotDeviceIdentities() *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder { bb := &DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/importedWindowsAutopilotDeviceIdentities" return bb } // DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder is request builder for ImportedWindowsAutopilotDeviceIdentity collection type DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for ImportedWindowsAutopilotDeviceIdentity collection func (b *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder) Request() *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest { return &DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for ImportedWindowsAutopilotDeviceIdentity item func (b *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder) ID(id string) *ImportedWindowsAutopilotDeviceIdentityRequestBuilder { bb := &ImportedWindowsAutopilotDeviceIdentityRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest is request for ImportedWindowsAutopilotDeviceIdentity collection type DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for ImportedWindowsAutopilotDeviceIdentity collection func (r *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]ImportedWindowsAutopilotDeviceIdentity, 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 []ImportedWindowsAutopilotDeviceIdentity 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 []ImportedWindowsAutopilotDeviceIdentity ) 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 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 } } } // Get performs GET request for ImportedWindowsAutopilotDeviceIdentity collection func (r *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest) Get(ctx context.Context) ([]ImportedWindowsAutopilotDeviceIdentity, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for ImportedWindowsAutopilotDeviceIdentity collection func (r *DeviceManagementImportedWindowsAutopilotDeviceIdentitiesCollectionRequest) Add(ctx context.Context, reqObj *ImportedWindowsAutopilotDeviceIdentity) (resObj *ImportedWindowsAutopilotDeviceIdentity, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // Intents returns request builder for DeviceManagementIntent collection func (b *DeviceManagementRequestBuilder) Intents() *DeviceManagementIntentsCollectionRequestBuilder { bb := &DeviceManagementIntentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/intents" return bb } // DeviceManagementIntentsCollectionRequestBuilder is request builder for DeviceManagementIntent collection type DeviceManagementIntentsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementIntent collection func (b *DeviceManagementIntentsCollectionRequestBuilder) Request() *DeviceManagementIntentsCollectionRequest { return &DeviceManagementIntentsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementIntent item func (b *DeviceManagementIntentsCollectionRequestBuilder) ID(id string) *DeviceManagementIntentRequestBuilder { bb := &DeviceManagementIntentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementIntentsCollectionRequest is request for DeviceManagementIntent collection type DeviceManagementIntentsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementIntent collection func (r *DeviceManagementIntentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementIntent, 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 []DeviceManagementIntent 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 []DeviceManagementIntent ) 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 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 } } } // Get performs GET request for DeviceManagementIntent collection func (r *DeviceManagementIntentsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementIntent, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementIntent collection func (r *DeviceManagementIntentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementIntent) (resObj *DeviceManagementIntent, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // IntuneBrandingProfiles returns request builder for IntuneBrandingProfile collection func (b *DeviceManagementRequestBuilder) IntuneBrandingProfiles() *DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder { bb := &DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/intuneBrandingProfiles" return bb } // DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder is request builder for IntuneBrandingProfile collection type DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for IntuneBrandingProfile collection func (b *DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder) Request() *DeviceManagementIntuneBrandingProfilesCollectionRequest { return &DeviceManagementIntuneBrandingProfilesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for IntuneBrandingProfile item func (b *DeviceManagementIntuneBrandingProfilesCollectionRequestBuilder) ID(id string) *IntuneBrandingProfileRequestBuilder { bb := &IntuneBrandingProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementIntuneBrandingProfilesCollectionRequest is request for IntuneBrandingProfile collection type DeviceManagementIntuneBrandingProfilesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for IntuneBrandingProfile collection func (r *DeviceManagementIntuneBrandingProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]IntuneBrandingProfile, 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 []IntuneBrandingProfile 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 []IntuneBrandingProfile ) 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 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 } } } // Get performs GET request for IntuneBrandingProfile collection func (r *DeviceManagementIntuneBrandingProfilesCollectionRequest) Get(ctx context.Context) ([]IntuneBrandingProfile, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for IntuneBrandingProfile collection func (r *DeviceManagementIntuneBrandingProfilesCollectionRequest) Add(ctx context.Context, reqObj *IntuneBrandingProfile) (resObj *IntuneBrandingProfile, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // IOSUpdateStatuses returns request builder for IOSUpdateDeviceStatus collection func (b *DeviceManagementRequestBuilder) IOSUpdateStatuses() *DeviceManagementIOSUpdateStatusesCollectionRequestBuilder { bb := &DeviceManagementIOSUpdateStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/iosUpdateStatuses" return bb } // DeviceManagementIOSUpdateStatusesCollectionRequestBuilder is request builder for IOSUpdateDeviceStatus collection type DeviceManagementIOSUpdateStatusesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for IOSUpdateDeviceStatus collection func (b *DeviceManagementIOSUpdateStatusesCollectionRequestBuilder) Request() *DeviceManagementIOSUpdateStatusesCollectionRequest { return &DeviceManagementIOSUpdateStatusesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for IOSUpdateDeviceStatus item func (b *DeviceManagementIOSUpdateStatusesCollectionRequestBuilder) ID(id string) *IOSUpdateDeviceStatusRequestBuilder { bb := &IOSUpdateDeviceStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementIOSUpdateStatusesCollectionRequest is request for IOSUpdateDeviceStatus collection type DeviceManagementIOSUpdateStatusesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for IOSUpdateDeviceStatus collection func (r *DeviceManagementIOSUpdateStatusesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]IOSUpdateDeviceStatus, 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 []IOSUpdateDeviceStatus 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 []IOSUpdateDeviceStatus ) 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 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 } } } // Get performs GET request for IOSUpdateDeviceStatus collection func (r *DeviceManagementIOSUpdateStatusesCollectionRequest) Get(ctx context.Context) ([]IOSUpdateDeviceStatus, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for IOSUpdateDeviceStatus collection func (r *DeviceManagementIOSUpdateStatusesCollectionRequest) Add(ctx context.Context, reqObj *IOSUpdateDeviceStatus) (resObj *IOSUpdateDeviceStatus, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ManagedDeviceEncryptionStates returns request builder for ManagedDeviceEncryptionState collection func (b *DeviceManagementRequestBuilder) ManagedDeviceEncryptionStates() *DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder { bb := &DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/managedDeviceEncryptionStates" return bb } // DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder is request builder for ManagedDeviceEncryptionState collection type DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for ManagedDeviceEncryptionState collection func (b *DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder) Request() *DeviceManagementManagedDeviceEncryptionStatesCollectionRequest { return &DeviceManagementManagedDeviceEncryptionStatesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for ManagedDeviceEncryptionState item func (b *DeviceManagementManagedDeviceEncryptionStatesCollectionRequestBuilder) ID(id string) *ManagedDeviceEncryptionStateRequestBuilder { bb := &ManagedDeviceEncryptionStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementManagedDeviceEncryptionStatesCollectionRequest is request for ManagedDeviceEncryptionState collection type DeviceManagementManagedDeviceEncryptionStatesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for ManagedDeviceEncryptionState collection func (r *DeviceManagementManagedDeviceEncryptionStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]ManagedDeviceEncryptionState, 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 []ManagedDeviceEncryptionState 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 []ManagedDeviceEncryptionState ) 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 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 } } } // Get performs GET request for ManagedDeviceEncryptionState collection func (r *DeviceManagementManagedDeviceEncryptionStatesCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceEncryptionState, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for ManagedDeviceEncryptionState collection func (r *DeviceManagementManagedDeviceEncryptionStatesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceEncryptionState) (resObj *ManagedDeviceEncryptionState, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ManagedDeviceOverview is navigation property func (b *DeviceManagementRequestBuilder) ManagedDeviceOverview() *ManagedDeviceOverviewRequestBuilder { bb := &ManagedDeviceOverviewRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/managedDeviceOverview" return bb } // ManagedDevices returns request builder for ManagedDevice collection func (b *DeviceManagementRequestBuilder) ManagedDevices() *DeviceManagementManagedDevicesCollectionRequestBuilder { bb := &DeviceManagementManagedDevicesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/managedDevices" return bb } // DeviceManagementManagedDevicesCollectionRequestBuilder is request builder for ManagedDevice collection type DeviceManagementManagedDevicesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for ManagedDevice collection func (b *DeviceManagementManagedDevicesCollectionRequestBuilder) Request() *DeviceManagementManagedDevicesCollectionRequest { return &DeviceManagementManagedDevicesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for ManagedDevice item func (b *DeviceManagementManagedDevicesCollectionRequestBuilder) ID(id string) *ManagedDeviceRequestBuilder { bb := &ManagedDeviceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementManagedDevicesCollectionRequest is request for ManagedDevice collection type DeviceManagementManagedDevicesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for ManagedDevice collection func (r *DeviceManagementManagedDevicesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]ManagedDevice, 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 []ManagedDevice 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 []ManagedDevice ) 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 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 } } } // Get performs GET request for ManagedDevice collection func (r *DeviceManagementManagedDevicesCollectionRequest) Get(ctx context.Context) ([]ManagedDevice, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for ManagedDevice collection func (r *DeviceManagementManagedDevicesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDevice) (resObj *ManagedDevice, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ManagementConditionStatements returns request builder for ManagementConditionStatement collection func (b *DeviceManagementRequestBuilder) ManagementConditionStatements() *DeviceManagementManagementConditionStatementsCollectionRequestBuilder { bb := &DeviceManagementManagementConditionStatementsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/managementConditionStatements" return bb } // DeviceManagementManagementConditionStatementsCollectionRequestBuilder is request builder for ManagementConditionStatement collection type DeviceManagementManagementConditionStatementsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for ManagementConditionStatement collection func (b *DeviceManagementManagementConditionStatementsCollectionRequestBuilder) Request() *DeviceManagementManagementConditionStatementsCollectionRequest { return &DeviceManagementManagementConditionStatementsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for ManagementConditionStatement item func (b *DeviceManagementManagementConditionStatementsCollectionRequestBuilder) ID(id string) *ManagementConditionStatementRequestBuilder { bb := &ManagementConditionStatementRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementManagementConditionStatementsCollectionRequest is request for ManagementConditionStatement collection type DeviceManagementManagementConditionStatementsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for ManagementConditionStatement collection func (r *DeviceManagementManagementConditionStatementsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]ManagementConditionStatement, 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 []ManagementConditionStatement 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 []ManagementConditionStatement ) 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 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 } } } // Get performs GET request for ManagementConditionStatement collection func (r *DeviceManagementManagementConditionStatementsCollectionRequest) Get(ctx context.Context) ([]ManagementConditionStatement, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for ManagementConditionStatement collection func (r *DeviceManagementManagementConditionStatementsCollectionRequest) Add(ctx context.Context, reqObj *ManagementConditionStatement) (resObj *ManagementConditionStatement, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // ManagementConditions returns request builder for ManagementCondition collection func (b *DeviceManagementRequestBuilder) ManagementConditions() *DeviceManagementManagementConditionsCollectionRequestBuilder { bb := &DeviceManagementManagementConditionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/managementConditions" return bb } // DeviceManagementManagementConditionsCollectionRequestBuilder is request builder for ManagementCondition collection type DeviceManagementManagementConditionsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for ManagementCondition collection func (b *DeviceManagementManagementConditionsCollectionRequestBuilder) Request() *DeviceManagementManagementConditionsCollectionRequest { return &DeviceManagementManagementConditionsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for ManagementCondition item func (b *DeviceManagementManagementConditionsCollectionRequestBuilder) ID(id string) *ManagementConditionRequestBuilder { bb := &ManagementConditionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementManagementConditionsCollectionRequest is request for ManagementCondition collection type DeviceManagementManagementConditionsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for ManagementCondition collection func (r *DeviceManagementManagementConditionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]ManagementCondition, 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 []ManagementCondition 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 []ManagementCondition ) 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 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 } } } // Get performs GET request for ManagementCondition collection func (r *DeviceManagementManagementConditionsCollectionRequest) Get(ctx context.Context) ([]ManagementCondition, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for ManagementCondition collection func (r *DeviceManagementManagementConditionsCollectionRequest) Add(ctx context.Context, reqObj *ManagementCondition) (resObj *ManagementCondition, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // MobileAppTroubleshootingEvents returns request builder for MobileAppTroubleshootingEvent collection func (b *DeviceManagementRequestBuilder) MobileAppTroubleshootingEvents() *DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder { bb := &DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/mobileAppTroubleshootingEvents" return bb } // DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder is request builder for MobileAppTroubleshootingEvent collection type DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for MobileAppTroubleshootingEvent collection func (b *DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder) Request() *DeviceManagementMobileAppTroubleshootingEventsCollectionRequest { return &DeviceManagementMobileAppTroubleshootingEventsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for MobileAppTroubleshootingEvent item func (b *DeviceManagementMobileAppTroubleshootingEventsCollectionRequestBuilder) ID(id string) *MobileAppTroubleshootingEventRequestBuilder { bb := &MobileAppTroubleshootingEventRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementMobileAppTroubleshootingEventsCollectionRequest is request for MobileAppTroubleshootingEvent collection type DeviceManagementMobileAppTroubleshootingEventsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for MobileAppTroubleshootingEvent collection func (r *DeviceManagementMobileAppTroubleshootingEventsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]MobileAppTroubleshootingEvent, 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 []MobileAppTroubleshootingEvent 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 []MobileAppTroubleshootingEvent ) 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 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 } } } // Get performs GET request for MobileAppTroubleshootingEvent collection func (r *DeviceManagementMobileAppTroubleshootingEventsCollectionRequest) Get(ctx context.Context) ([]MobileAppTroubleshootingEvent, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for MobileAppTroubleshootingEvent collection func (r *DeviceManagementMobileAppTroubleshootingEventsCollectionRequest) Add(ctx context.Context, reqObj *MobileAppTroubleshootingEvent) (resObj *MobileAppTroubleshootingEvent, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // MobileThreatDefenseConnectors returns request builder for MobileThreatDefenseConnector collection func (b *DeviceManagementRequestBuilder) MobileThreatDefenseConnectors() *DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder { bb := &DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/mobileThreatDefenseConnectors" return bb } // DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder is request builder for MobileThreatDefenseConnector collection type DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for MobileThreatDefenseConnector collection func (b *DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder) Request() *DeviceManagementMobileThreatDefenseConnectorsCollectionRequest { return &DeviceManagementMobileThreatDefenseConnectorsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for MobileThreatDefenseConnector item func (b *DeviceManagementMobileThreatDefenseConnectorsCollectionRequestBuilder) ID(id string) *MobileThreatDefenseConnectorRequestBuilder { bb := &MobileThreatDefenseConnectorRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementMobileThreatDefenseConnectorsCollectionRequest is request for MobileThreatDefenseConnector collection type DeviceManagementMobileThreatDefenseConnectorsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for MobileThreatDefenseConnector collection func (r *DeviceManagementMobileThreatDefenseConnectorsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]MobileThreatDefenseConnector, 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 []MobileThreatDefenseConnector 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 []MobileThreatDefenseConnector ) 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 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 } } } // Get performs GET request for MobileThreatDefenseConnector collection func (r *DeviceManagementMobileThreatDefenseConnectorsCollectionRequest) Get(ctx context.Context) ([]MobileThreatDefenseConnector, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for MobileThreatDefenseConnector collection func (r *DeviceManagementMobileThreatDefenseConnectorsCollectionRequest) Add(ctx context.Context, reqObj *MobileThreatDefenseConnector) (resObj *MobileThreatDefenseConnector, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // NdesConnectors returns request builder for NdesConnector collection func (b *DeviceManagementRequestBuilder) NdesConnectors() *DeviceManagementNdesConnectorsCollectionRequestBuilder { bb := &DeviceManagementNdesConnectorsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/ndesConnectors" return bb } // DeviceManagementNdesConnectorsCollectionRequestBuilder is request builder for NdesConnector collection type DeviceManagementNdesConnectorsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for NdesConnector collection func (b *DeviceManagementNdesConnectorsCollectionRequestBuilder) Request() *DeviceManagementNdesConnectorsCollectionRequest { return &DeviceManagementNdesConnectorsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for NdesConnector item func (b *DeviceManagementNdesConnectorsCollectionRequestBuilder) ID(id string) *NdesConnectorRequestBuilder { bb := &NdesConnectorRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementNdesConnectorsCollectionRequest is request for NdesConnector collection type DeviceManagementNdesConnectorsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for NdesConnector collection func (r *DeviceManagementNdesConnectorsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]NdesConnector, 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 []NdesConnector 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 []NdesConnector ) 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 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 } } } // Get performs GET request for NdesConnector collection func (r *DeviceManagementNdesConnectorsCollectionRequest) Get(ctx context.Context) ([]NdesConnector, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for NdesConnector collection func (r *DeviceManagementNdesConnectorsCollectionRequest) Add(ctx context.Context, reqObj *NdesConnector) (resObj *NdesConnector, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // NotificationMessageTemplates returns request builder for NotificationMessageTemplate collection func (b *DeviceManagementRequestBuilder) NotificationMessageTemplates() *DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder { bb := &DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/notificationMessageTemplates" return bb } // DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder is request builder for NotificationMessageTemplate collection type DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for NotificationMessageTemplate collection func (b *DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder) Request() *DeviceManagementNotificationMessageTemplatesCollectionRequest { return &DeviceManagementNotificationMessageTemplatesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for NotificationMessageTemplate item func (b *DeviceManagementNotificationMessageTemplatesCollectionRequestBuilder) ID(id string) *NotificationMessageTemplateRequestBuilder { bb := &NotificationMessageTemplateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementNotificationMessageTemplatesCollectionRequest is request for NotificationMessageTemplate collection type DeviceManagementNotificationMessageTemplatesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for NotificationMessageTemplate collection func (r *DeviceManagementNotificationMessageTemplatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]NotificationMessageTemplate, 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 []NotificationMessageTemplate 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 []NotificationMessageTemplate ) 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 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 } } } // Get performs GET request for NotificationMessageTemplate collection func (r *DeviceManagementNotificationMessageTemplatesCollectionRequest) Get(ctx context.Context) ([]NotificationMessageTemplate, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for NotificationMessageTemplate collection func (r *DeviceManagementNotificationMessageTemplatesCollectionRequest) Add(ctx context.Context, reqObj *NotificationMessageTemplate) (resObj *NotificationMessageTemplate, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // RemoteActionAudits returns request builder for RemoteActionAudit collection func (b *DeviceManagementRequestBuilder) RemoteActionAudits() *DeviceManagementRemoteActionAuditsCollectionRequestBuilder { bb := &DeviceManagementRemoteActionAuditsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/remoteActionAudits" return bb } // DeviceManagementRemoteActionAuditsCollectionRequestBuilder is request builder for RemoteActionAudit collection type DeviceManagementRemoteActionAuditsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for RemoteActionAudit collection func (b *DeviceManagementRemoteActionAuditsCollectionRequestBuilder) Request() *DeviceManagementRemoteActionAuditsCollectionRequest { return &DeviceManagementRemoteActionAuditsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for RemoteActionAudit item func (b *DeviceManagementRemoteActionAuditsCollectionRequestBuilder) ID(id string) *RemoteActionAuditRequestBuilder { bb := &RemoteActionAuditRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementRemoteActionAuditsCollectionRequest is request for RemoteActionAudit collection type DeviceManagementRemoteActionAuditsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for RemoteActionAudit collection func (r *DeviceManagementRemoteActionAuditsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]RemoteActionAudit, 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 []RemoteActionAudit 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 []RemoteActionAudit ) 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 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 } } } // Get performs GET request for RemoteActionAudit collection func (r *DeviceManagementRemoteActionAuditsCollectionRequest) Get(ctx context.Context) ([]RemoteActionAudit, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for RemoteActionAudit collection func (r *DeviceManagementRemoteActionAuditsCollectionRequest) Add(ctx context.Context, reqObj *RemoteActionAudit) (resObj *RemoteActionAudit, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // RemoteAssistancePartners returns request builder for RemoteAssistancePartner collection func (b *DeviceManagementRequestBuilder) RemoteAssistancePartners() *DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder { bb := &DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/remoteAssistancePartners" return bb } // DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder is request builder for RemoteAssistancePartner collection type DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for RemoteAssistancePartner collection func (b *DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder) Request() *DeviceManagementRemoteAssistancePartnersCollectionRequest { return &DeviceManagementRemoteAssistancePartnersCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for RemoteAssistancePartner item func (b *DeviceManagementRemoteAssistancePartnersCollectionRequestBuilder) ID(id string) *RemoteAssistancePartnerRequestBuilder { bb := &RemoteAssistancePartnerRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementRemoteAssistancePartnersCollectionRequest is request for RemoteAssistancePartner collection type DeviceManagementRemoteAssistancePartnersCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for RemoteAssistancePartner collection func (r *DeviceManagementRemoteAssistancePartnersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]RemoteAssistancePartner, 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 []RemoteAssistancePartner 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 []RemoteAssistancePartner ) 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 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 } } } // Get performs GET request for RemoteAssistancePartner collection func (r *DeviceManagementRemoteAssistancePartnersCollectionRequest) Get(ctx context.Context) ([]RemoteAssistancePartner, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for RemoteAssistancePartner collection func (r *DeviceManagementRemoteAssistancePartnersCollectionRequest) Add(ctx context.Context, reqObj *RemoteAssistancePartner) (resObj *RemoteAssistancePartner, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // Reports is navigation property func (b *DeviceManagementRequestBuilder) Reports() *DeviceManagementReportsRequestBuilder { bb := &DeviceManagementReportsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/reports" return bb } // ResourceOperations returns request builder for ResourceOperation collection func (b *DeviceManagementRequestBuilder) ResourceOperations() *DeviceManagementResourceOperationsCollectionRequestBuilder { bb := &DeviceManagementResourceOperationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/resourceOperations" return bb } // DeviceManagementResourceOperationsCollectionRequestBuilder is request builder for ResourceOperation collection type DeviceManagementResourceOperationsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for ResourceOperation collection func (b *DeviceManagementResourceOperationsCollectionRequestBuilder) Request() *DeviceManagementResourceOperationsCollectionRequest { return &DeviceManagementResourceOperationsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for ResourceOperation item func (b *DeviceManagementResourceOperationsCollectionRequestBuilder) ID(id string) *ResourceOperationRequestBuilder { bb := &ResourceOperationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementResourceOperationsCollectionRequest is request for ResourceOperation collection type DeviceManagementResourceOperationsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for ResourceOperation collection func (r *DeviceManagementResourceOperationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]ResourceOperation, 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 []ResourceOperation 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 []ResourceOperation ) 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 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 } } } // Get performs GET request for ResourceOperation collection func (r *DeviceManagementResourceOperationsCollectionRequest) Get(ctx context.Context) ([]ResourceOperation, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for ResourceOperation collection func (r *DeviceManagementResourceOperationsCollectionRequest) Add(ctx context.Context, reqObj *ResourceOperation) (resObj *ResourceOperation, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // RoleAssignments returns request builder for DeviceAndAppManagementRoleAssignment collection func (b *DeviceManagementRequestBuilder) RoleAssignments() *DeviceManagementRoleAssignmentsCollectionRequestBuilder { bb := &DeviceManagementRoleAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/roleAssignments" return bb } // DeviceManagementRoleAssignmentsCollectionRequestBuilder is request builder for DeviceAndAppManagementRoleAssignment collection type DeviceManagementRoleAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceAndAppManagementRoleAssignment collection func (b *DeviceManagementRoleAssignmentsCollectionRequestBuilder) Request() *DeviceManagementRoleAssignmentsCollectionRequest { return &DeviceManagementRoleAssignmentsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceAndAppManagementRoleAssignment item func (b *DeviceManagementRoleAssignmentsCollectionRequestBuilder) ID(id string) *DeviceAndAppManagementRoleAssignmentRequestBuilder { bb := &DeviceAndAppManagementRoleAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementRoleAssignmentsCollectionRequest is request for DeviceAndAppManagementRoleAssignment collection type DeviceManagementRoleAssignmentsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceAndAppManagementRoleAssignment collection func (r *DeviceManagementRoleAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceAndAppManagementRoleAssignment, 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 []DeviceAndAppManagementRoleAssignment 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 []DeviceAndAppManagementRoleAssignment ) 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 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 } } } // Get performs GET request for DeviceAndAppManagementRoleAssignment collection func (r *DeviceManagementRoleAssignmentsCollectionRequest) Get(ctx context.Context) ([]DeviceAndAppManagementRoleAssignment, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceAndAppManagementRoleAssignment collection func (r *DeviceManagementRoleAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *DeviceAndAppManagementRoleAssignment) (resObj *DeviceAndAppManagementRoleAssignment, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // RoleDefinitions returns request builder for RoleDefinition collection func (b *DeviceManagementRequestBuilder) RoleDefinitions() *DeviceManagementRoleDefinitionsCollectionRequestBuilder { bb := &DeviceManagementRoleDefinitionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/roleDefinitions" return bb } // DeviceManagementRoleDefinitionsCollectionRequestBuilder is request builder for RoleDefinition collection type DeviceManagementRoleDefinitionsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for RoleDefinition collection func (b *DeviceManagementRoleDefinitionsCollectionRequestBuilder) Request() *DeviceManagementRoleDefinitionsCollectionRequest { return &DeviceManagementRoleDefinitionsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for RoleDefinition item func (b *DeviceManagementRoleDefinitionsCollectionRequestBuilder) ID(id string) *RoleDefinitionRequestBuilder { bb := &RoleDefinitionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementRoleDefinitionsCollectionRequest is request for RoleDefinition collection type DeviceManagementRoleDefinitionsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for RoleDefinition collection func (r *DeviceManagementRoleDefinitionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]RoleDefinition, 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 []RoleDefinition 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 []RoleDefinition ) 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 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 } } } // Get performs GET request for RoleDefinition collection func (r *DeviceManagementRoleDefinitionsCollectionRequest) Get(ctx context.Context) ([]RoleDefinition, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for RoleDefinition collection func (r *DeviceManagementRoleDefinitionsCollectionRequest) Add(ctx context.Context, reqObj *RoleDefinition) (resObj *RoleDefinition, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // RoleScopeTags returns request builder for RoleScopeTag collection func (b *DeviceManagementRequestBuilder) RoleScopeTags() *DeviceManagementRoleScopeTagsCollectionRequestBuilder { bb := &DeviceManagementRoleScopeTagsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/roleScopeTags" return bb } // DeviceManagementRoleScopeTagsCollectionRequestBuilder is request builder for RoleScopeTag collection type DeviceManagementRoleScopeTagsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for RoleScopeTag collection func (b *DeviceManagementRoleScopeTagsCollectionRequestBuilder) Request() *DeviceManagementRoleScopeTagsCollectionRequest { return &DeviceManagementRoleScopeTagsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for RoleScopeTag item func (b *DeviceManagementRoleScopeTagsCollectionRequestBuilder) ID(id string) *RoleScopeTagRequestBuilder { bb := &RoleScopeTagRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementRoleScopeTagsCollectionRequest is request for RoleScopeTag collection type DeviceManagementRoleScopeTagsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for RoleScopeTag collection func (r *DeviceManagementRoleScopeTagsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]RoleScopeTag, 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 []RoleScopeTag 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 []RoleScopeTag ) 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 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 } } } // Get performs GET request for RoleScopeTag collection func (r *DeviceManagementRoleScopeTagsCollectionRequest) Get(ctx context.Context) ([]RoleScopeTag, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for RoleScopeTag collection func (r *DeviceManagementRoleScopeTagsCollectionRequest) Add(ctx context.Context, reqObj *RoleScopeTag) (resObj *RoleScopeTag, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // SettingDefinitions returns request builder for DeviceManagementSettingDefinition collection func (b *DeviceManagementRequestBuilder) SettingDefinitions() *DeviceManagementSettingDefinitionsCollectionRequestBuilder { bb := &DeviceManagementSettingDefinitionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/settingDefinitions" return bb } // DeviceManagementSettingDefinitionsCollectionRequestBuilder is request builder for DeviceManagementSettingDefinition collection type DeviceManagementSettingDefinitionsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementSettingDefinition collection func (b *DeviceManagementSettingDefinitionsCollectionRequestBuilder) Request() *DeviceManagementSettingDefinitionsCollectionRequest { return &DeviceManagementSettingDefinitionsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementSettingDefinition item func (b *DeviceManagementSettingDefinitionsCollectionRequestBuilder) ID(id string) *DeviceManagementSettingDefinitionRequestBuilder { bb := &DeviceManagementSettingDefinitionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementSettingDefinitionsCollectionRequest is request for DeviceManagementSettingDefinition collection type DeviceManagementSettingDefinitionsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementSettingDefinition collection func (r *DeviceManagementSettingDefinitionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementSettingDefinition, 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 []DeviceManagementSettingDefinition 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 []DeviceManagementSettingDefinition ) 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 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 } } } // Get performs GET request for DeviceManagementSettingDefinition collection func (r *DeviceManagementSettingDefinitionsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementSettingDefinition, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementSettingDefinition collection func (r *DeviceManagementSettingDefinitionsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementSettingDefinition) (resObj *DeviceManagementSettingDefinition, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // SoftwareUpdateStatusSummary is navigation property func (b *DeviceManagementRequestBuilder) SoftwareUpdateStatusSummary() *SoftwareUpdateStatusSummaryRequestBuilder { bb := &SoftwareUpdateStatusSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/softwareUpdateStatusSummary" return bb } // TelecomExpenseManagementPartners returns request builder for TelecomExpenseManagementPartner collection func (b *DeviceManagementRequestBuilder) TelecomExpenseManagementPartners() *DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder { bb := &DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/telecomExpenseManagementPartners" return bb } // DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder is request builder for TelecomExpenseManagementPartner collection type DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for TelecomExpenseManagementPartner collection func (b *DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder) Request() *DeviceManagementTelecomExpenseManagementPartnersCollectionRequest { return &DeviceManagementTelecomExpenseManagementPartnersCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for TelecomExpenseManagementPartner item func (b *DeviceManagementTelecomExpenseManagementPartnersCollectionRequestBuilder) ID(id string) *TelecomExpenseManagementPartnerRequestBuilder { bb := &TelecomExpenseManagementPartnerRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementTelecomExpenseManagementPartnersCollectionRequest is request for TelecomExpenseManagementPartner collection type DeviceManagementTelecomExpenseManagementPartnersCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for TelecomExpenseManagementPartner collection func (r *DeviceManagementTelecomExpenseManagementPartnersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]TelecomExpenseManagementPartner, 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 []TelecomExpenseManagementPartner 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 []TelecomExpenseManagementPartner ) 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 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 } } } // Get performs GET request for TelecomExpenseManagementPartner collection func (r *DeviceManagementTelecomExpenseManagementPartnersCollectionRequest) Get(ctx context.Context) ([]TelecomExpenseManagementPartner, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for TelecomExpenseManagementPartner collection func (r *DeviceManagementTelecomExpenseManagementPartnersCollectionRequest) Add(ctx context.Context, reqObj *TelecomExpenseManagementPartner) (resObj *TelecomExpenseManagementPartner, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // Templates returns request builder for DeviceManagementTemplate collection func (b *DeviceManagementRequestBuilder) Templates() *DeviceManagementTemplatesCollectionRequestBuilder { bb := &DeviceManagementTemplatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/templates" return bb } // DeviceManagementTemplatesCollectionRequestBuilder is request builder for DeviceManagementTemplate collection type DeviceManagementTemplatesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementTemplate collection func (b *DeviceManagementTemplatesCollectionRequestBuilder) Request() *DeviceManagementTemplatesCollectionRequest { return &DeviceManagementTemplatesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementTemplate item func (b *DeviceManagementTemplatesCollectionRequestBuilder) ID(id string) *DeviceManagementTemplateRequestBuilder { bb := &DeviceManagementTemplateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementTemplatesCollectionRequest is request for DeviceManagementTemplate collection type DeviceManagementTemplatesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementTemplate collection func (r *DeviceManagementTemplatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementTemplate, 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 []DeviceManagementTemplate 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 []DeviceManagementTemplate ) 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 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 } } } // Get performs GET request for DeviceManagementTemplate collection func (r *DeviceManagementTemplatesCollectionRequest) Get(ctx context.Context) ([]DeviceManagementTemplate, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementTemplate collection func (r *DeviceManagementTemplatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementTemplate) (resObj *DeviceManagementTemplate, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // TermsAndConditions returns request builder for TermsAndConditions collection func (b *DeviceManagementRequestBuilder) TermsAndConditions() *DeviceManagementTermsAndConditionsCollectionRequestBuilder { bb := &DeviceManagementTermsAndConditionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/termsAndConditions" return bb } // DeviceManagementTermsAndConditionsCollectionRequestBuilder is request builder for TermsAndConditions collection type DeviceManagementTermsAndConditionsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for TermsAndConditions collection func (b *DeviceManagementTermsAndConditionsCollectionRequestBuilder) Request() *DeviceManagementTermsAndConditionsCollectionRequest { return &DeviceManagementTermsAndConditionsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for TermsAndConditions item func (b *DeviceManagementTermsAndConditionsCollectionRequestBuilder) ID(id string) *TermsAndConditionsRequestBuilder { bb := &TermsAndConditionsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementTermsAndConditionsCollectionRequest is request for TermsAndConditions collection type DeviceManagementTermsAndConditionsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for TermsAndConditions collection func (r *DeviceManagementTermsAndConditionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]TermsAndConditions, 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 []TermsAndConditions 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 []TermsAndConditions ) 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 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 } } } // Get performs GET request for TermsAndConditions collection func (r *DeviceManagementTermsAndConditionsCollectionRequest) Get(ctx context.Context) ([]TermsAndConditions, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for TermsAndConditions collection func (r *DeviceManagementTermsAndConditionsCollectionRequest) Add(ctx context.Context, reqObj *TermsAndConditions) (resObj *TermsAndConditions, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // TroubleshootingEvents returns request builder for DeviceManagementTroubleshootingEvent collection func (b *DeviceManagementRequestBuilder) TroubleshootingEvents() *DeviceManagementTroubleshootingEventsCollectionRequestBuilder { bb := &DeviceManagementTroubleshootingEventsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/troubleshootingEvents" return bb } // DeviceManagementTroubleshootingEventsCollectionRequestBuilder is request builder for DeviceManagementTroubleshootingEvent collection type DeviceManagementTroubleshootingEventsCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for DeviceManagementTroubleshootingEvent collection func (b *DeviceManagementTroubleshootingEventsCollectionRequestBuilder) Request() *DeviceManagementTroubleshootingEventsCollectionRequest { return &DeviceManagementTroubleshootingEventsCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for DeviceManagementTroubleshootingEvent item func (b *DeviceManagementTroubleshootingEventsCollectionRequestBuilder) ID(id string) *DeviceManagementTroubleshootingEventRequestBuilder { bb := &DeviceManagementTroubleshootingEventRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementTroubleshootingEventsCollectionRequest is request for DeviceManagementTroubleshootingEvent collection type DeviceManagementTroubleshootingEventsCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for DeviceManagementTroubleshootingEvent collection func (r *DeviceManagementTroubleshootingEventsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]DeviceManagementTroubleshootingEvent, 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 []DeviceManagementTroubleshootingEvent 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 []DeviceManagementTroubleshootingEvent ) 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 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 } } } // Get performs GET request for DeviceManagementTroubleshootingEvent collection func (r *DeviceManagementTroubleshootingEventsCollectionRequest) Get(ctx context.Context) ([]DeviceManagementTroubleshootingEvent, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for DeviceManagementTroubleshootingEvent collection func (r *DeviceManagementTroubleshootingEventsCollectionRequest) Add(ctx context.Context, reqObj *DeviceManagementTroubleshootingEvent) (resObj *DeviceManagementTroubleshootingEvent, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // UserExperienceAnalyticsBaselines returns request builder for UserExperienceAnalyticsBaseline collection func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsBaselines() *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder { bb := &DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/userExperienceAnalyticsBaselines" return bb } // DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder is request builder for UserExperienceAnalyticsBaseline collection type DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for UserExperienceAnalyticsBaseline collection func (b *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder) Request() *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest { return &DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for UserExperienceAnalyticsBaseline item func (b *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder) ID(id string) *UserExperienceAnalyticsBaselineRequestBuilder { bb := &UserExperienceAnalyticsBaselineRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest is request for UserExperienceAnalyticsBaseline collection type DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for UserExperienceAnalyticsBaseline collection func (r *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]UserExperienceAnalyticsBaseline, 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 []UserExperienceAnalyticsBaseline 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 []UserExperienceAnalyticsBaseline ) 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 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 } } } // Get performs GET request for UserExperienceAnalyticsBaseline collection func (r *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest) Get(ctx context.Context) ([]UserExperienceAnalyticsBaseline, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for UserExperienceAnalyticsBaseline collection func (r *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequest) Add(ctx context.Context, reqObj *UserExperienceAnalyticsBaseline) (resObj *UserExperienceAnalyticsBaseline, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // UserExperienceAnalyticsCategories returns request builder for UserExperienceAnalyticsCategory collection func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsCategories() *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder { bb := &DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/userExperienceAnalyticsCategories" return bb } // DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder is request builder for UserExperienceAnalyticsCategory collection type DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for UserExperienceAnalyticsCategory collection func (b *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder) Request() *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest { return &DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for UserExperienceAnalyticsCategory item func (b *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequestBuilder) ID(id string) *UserExperienceAnalyticsCategoryRequestBuilder { bb := &UserExperienceAnalyticsCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest is request for UserExperienceAnalyticsCategory collection type DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for UserExperienceAnalyticsCategory collection func (r *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]UserExperienceAnalyticsCategory, 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 []UserExperienceAnalyticsCategory 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 []UserExperienceAnalyticsCategory ) 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 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 } } } // Get performs GET request for UserExperienceAnalyticsCategory collection func (r *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest) Get(ctx context.Context) ([]UserExperienceAnalyticsCategory, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for UserExperienceAnalyticsCategory collection func (r *DeviceManagementUserExperienceAnalyticsCategoriesCollectionRequest) Add(ctx context.Context, reqObj *UserExperienceAnalyticsCategory) (resObj *UserExperienceAnalyticsCategory, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // UserExperienceAnalyticsDevicePerformance returns request builder for UserExperienceAnalyticsDevicePerformance collection func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsDevicePerformance() *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder { bb := &DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/userExperienceAnalyticsDevicePerformance" return bb } // DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder is request builder for UserExperienceAnalyticsDevicePerformance collection type DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for UserExperienceAnalyticsDevicePerformance collection func (b *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder) Request() *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest { return &DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for UserExperienceAnalyticsDevicePerformance item func (b *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequestBuilder) ID(id string) *UserExperienceAnalyticsDevicePerformanceRequestBuilder { bb := &UserExperienceAnalyticsDevicePerformanceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest is request for UserExperienceAnalyticsDevicePerformance collection type DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for UserExperienceAnalyticsDevicePerformance collection func (r *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]UserExperienceAnalyticsDevicePerformance, 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 []UserExperienceAnalyticsDevicePerformance 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 []UserExperienceAnalyticsDevicePerformance ) 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 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 } } } // Get performs GET request for UserExperienceAnalyticsDevicePerformance collection func (r *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest) Get(ctx context.Context) ([]UserExperienceAnalyticsDevicePerformance, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for UserExperienceAnalyticsDevicePerformance collection func (r *DeviceManagementUserExperienceAnalyticsDevicePerformanceCollectionRequest) Add(ctx context.Context, reqObj *UserExperienceAnalyticsDevicePerformance) (resObj *UserExperienceAnalyticsDevicePerformance, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // UserExperienceAnalyticsDeviceStartupHistory returns request builder for UserExperienceAnalyticsDeviceStartupHistory collection func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsDeviceStartupHistory() *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder { bb := &DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/userExperienceAnalyticsDeviceStartupHistory" return bb } // DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder is request builder for UserExperienceAnalyticsDeviceStartupHistory collection type DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for UserExperienceAnalyticsDeviceStartupHistory collection func (b *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder) Request() *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest { return &DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for UserExperienceAnalyticsDeviceStartupHistory item func (b *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequestBuilder) ID(id string) *UserExperienceAnalyticsDeviceStartupHistoryRequestBuilder { bb := &UserExperienceAnalyticsDeviceStartupHistoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest is request for UserExperienceAnalyticsDeviceStartupHistory collection type DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for UserExperienceAnalyticsDeviceStartupHistory collection func (r *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]UserExperienceAnalyticsDeviceStartupHistory, 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 []UserExperienceAnalyticsDeviceStartupHistory 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 []UserExperienceAnalyticsDeviceStartupHistory ) 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 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 } } } // Get performs GET request for UserExperienceAnalyticsDeviceStartupHistory collection func (r *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest) Get(ctx context.Context) ([]UserExperienceAnalyticsDeviceStartupHistory, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for UserExperienceAnalyticsDeviceStartupHistory collection func (r *DeviceManagementUserExperienceAnalyticsDeviceStartupHistoryCollectionRequest) Add(ctx context.Context, reqObj *UserExperienceAnalyticsDeviceStartupHistory) (resObj *UserExperienceAnalyticsDeviceStartupHistory, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // UserExperienceAnalyticsOverview is navigation property func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsOverview() *UserExperienceAnalyticsOverviewRequestBuilder { bb := &UserExperienceAnalyticsOverviewRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/userExperienceAnalyticsOverview" return bb } // UserExperienceAnalyticsRegressionSummary is navigation property func (b *DeviceManagementRequestBuilder) UserExperienceAnalyticsRegressionSummary() *UserExperienceAnalyticsRegressionSummaryRequestBuilder { bb := &UserExperienceAnalyticsRegressionSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/userExperienceAnalyticsRegressionSummary" return bb } // UserPfxCertificates returns request builder for UserPFXCertificate collection func (b *DeviceManagementRequestBuilder) UserPfxCertificates() *DeviceManagementUserPfxCertificatesCollectionRequestBuilder { bb := &DeviceManagementUserPfxCertificatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/userPfxCertificates" return bb } // DeviceManagementUserPfxCertificatesCollectionRequestBuilder is request builder for UserPFXCertificate collection type DeviceManagementUserPfxCertificatesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for UserPFXCertificate collection func (b *DeviceManagementUserPfxCertificatesCollectionRequestBuilder) Request() *DeviceManagementUserPfxCertificatesCollectionRequest { return &DeviceManagementUserPfxCertificatesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for UserPFXCertificate item func (b *DeviceManagementUserPfxCertificatesCollectionRequestBuilder) ID(id string) *UserPFXCertificateRequestBuilder { bb := &UserPFXCertificateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementUserPfxCertificatesCollectionRequest is request for UserPFXCertificate collection type DeviceManagementUserPfxCertificatesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for UserPFXCertificate collection func (r *DeviceManagementUserPfxCertificatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]UserPFXCertificate, 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 []UserPFXCertificate 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 []UserPFXCertificate ) 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 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 } } } // Get performs GET request for UserPFXCertificate collection func (r *DeviceManagementUserPfxCertificatesCollectionRequest) Get(ctx context.Context) ([]UserPFXCertificate, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for UserPFXCertificate collection func (r *DeviceManagementUserPfxCertificatesCollectionRequest) Add(ctx context.Context, reqObj *UserPFXCertificate) (resObj *UserPFXCertificate, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // WindowsAutopilotDeploymentProfiles returns request builder for WindowsAutopilotDeploymentProfile collection func (b *DeviceManagementRequestBuilder) WindowsAutopilotDeploymentProfiles() *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder { bb := &DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/windowsAutopilotDeploymentProfiles" return bb } // DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder is request builder for WindowsAutopilotDeploymentProfile collection type DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for WindowsAutopilotDeploymentProfile collection func (b *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder) Request() *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest { return &DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for WindowsAutopilotDeploymentProfile item func (b *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequestBuilder) ID(id string) *WindowsAutopilotDeploymentProfileRequestBuilder { bb := &WindowsAutopilotDeploymentProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest is request for WindowsAutopilotDeploymentProfile collection type DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for WindowsAutopilotDeploymentProfile collection func (r *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]WindowsAutopilotDeploymentProfile, 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 []WindowsAutopilotDeploymentProfile 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 []WindowsAutopilotDeploymentProfile ) 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 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 } } } // Get performs GET request for WindowsAutopilotDeploymentProfile collection func (r *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest) Get(ctx context.Context) ([]WindowsAutopilotDeploymentProfile, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for WindowsAutopilotDeploymentProfile collection func (r *DeviceManagementWindowsAutopilotDeploymentProfilesCollectionRequest) Add(ctx context.Context, reqObj *WindowsAutopilotDeploymentProfile) (resObj *WindowsAutopilotDeploymentProfile, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // WindowsAutopilotDeviceIdentities returns request builder for WindowsAutopilotDeviceIdentity collection func (b *DeviceManagementRequestBuilder) WindowsAutopilotDeviceIdentities() *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder { bb := &DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/windowsAutopilotDeviceIdentities" return bb } // DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder is request builder for WindowsAutopilotDeviceIdentity collection type DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for WindowsAutopilotDeviceIdentity collection func (b *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder) Request() *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest { return &DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for WindowsAutopilotDeviceIdentity item func (b *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequestBuilder) ID(id string) *WindowsAutopilotDeviceIdentityRequestBuilder { bb := &WindowsAutopilotDeviceIdentityRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest is request for WindowsAutopilotDeviceIdentity collection type DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for WindowsAutopilotDeviceIdentity collection func (r *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]WindowsAutopilotDeviceIdentity, 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 []WindowsAutopilotDeviceIdentity 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 []WindowsAutopilotDeviceIdentity ) 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 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 } } } // Get performs GET request for WindowsAutopilotDeviceIdentity collection func (r *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest) Get(ctx context.Context) ([]WindowsAutopilotDeviceIdentity, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for WindowsAutopilotDeviceIdentity collection func (r *DeviceManagementWindowsAutopilotDeviceIdentitiesCollectionRequest) Add(ctx context.Context, reqObj *WindowsAutopilotDeviceIdentity) (resObj *WindowsAutopilotDeviceIdentity, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // WindowsAutopilotSettings is navigation property func (b *DeviceManagementRequestBuilder) WindowsAutopilotSettings() *WindowsAutopilotSettingsRequestBuilder { bb := &WindowsAutopilotSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/windowsAutopilotSettings" return bb } // WindowsFeatureUpdateProfiles returns request builder for WindowsFeatureUpdateProfile collection func (b *DeviceManagementRequestBuilder) WindowsFeatureUpdateProfiles() *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder { bb := &DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/windowsFeatureUpdateProfiles" return bb } // DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder is request builder for WindowsFeatureUpdateProfile collection type DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for WindowsFeatureUpdateProfile collection func (b *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder) Request() *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest { return &DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for WindowsFeatureUpdateProfile item func (b *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequestBuilder) ID(id string) *WindowsFeatureUpdateProfileRequestBuilder { bb := &WindowsFeatureUpdateProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest is request for WindowsFeatureUpdateProfile collection type DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for WindowsFeatureUpdateProfile collection func (r *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]WindowsFeatureUpdateProfile, 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 []WindowsFeatureUpdateProfile 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 []WindowsFeatureUpdateProfile ) 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 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 } } } // Get performs GET request for WindowsFeatureUpdateProfile collection func (r *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest) Get(ctx context.Context) ([]WindowsFeatureUpdateProfile, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for WindowsFeatureUpdateProfile collection func (r *DeviceManagementWindowsFeatureUpdateProfilesCollectionRequest) Add(ctx context.Context, reqObj *WindowsFeatureUpdateProfile) (resObj *WindowsFeatureUpdateProfile, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // WindowsInformationProtectionAppLearningSummaries returns request builder for WindowsInformationProtectionAppLearningSummary collection func (b *DeviceManagementRequestBuilder) WindowsInformationProtectionAppLearningSummaries() *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder { bb := &DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/windowsInformationProtectionAppLearningSummaries" return bb } // DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder is request builder for WindowsInformationProtectionAppLearningSummary collection type DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for WindowsInformationProtectionAppLearningSummary collection func (b *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder) Request() *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest { return &DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for WindowsInformationProtectionAppLearningSummary item func (b *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequestBuilder) ID(id string) *WindowsInformationProtectionAppLearningSummaryRequestBuilder { bb := &WindowsInformationProtectionAppLearningSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest is request for WindowsInformationProtectionAppLearningSummary collection type DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for WindowsInformationProtectionAppLearningSummary collection func (r *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]WindowsInformationProtectionAppLearningSummary, 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 []WindowsInformationProtectionAppLearningSummary 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 []WindowsInformationProtectionAppLearningSummary ) 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 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 } } } // Get performs GET request for WindowsInformationProtectionAppLearningSummary collection func (r *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest) Get(ctx context.Context) ([]WindowsInformationProtectionAppLearningSummary, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for WindowsInformationProtectionAppLearningSummary collection func (r *DeviceManagementWindowsInformationProtectionAppLearningSummariesCollectionRequest) Add(ctx context.Context, reqObj *WindowsInformationProtectionAppLearningSummary) (resObj *WindowsInformationProtectionAppLearningSummary, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // WindowsInformationProtectionNetworkLearningSummaries returns request builder for WindowsInformationProtectionNetworkLearningSummary collection func (b *DeviceManagementRequestBuilder) WindowsInformationProtectionNetworkLearningSummaries() *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder { bb := &DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/windowsInformationProtectionNetworkLearningSummaries" return bb } // DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder is request builder for WindowsInformationProtectionNetworkLearningSummary collection type DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for WindowsInformationProtectionNetworkLearningSummary collection func (b *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder) Request() *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest { return &DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for WindowsInformationProtectionNetworkLearningSummary item func (b *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequestBuilder) ID(id string) *WindowsInformationProtectionNetworkLearningSummaryRequestBuilder { bb := &WindowsInformationProtectionNetworkLearningSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest is request for WindowsInformationProtectionNetworkLearningSummary collection type DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for WindowsInformationProtectionNetworkLearningSummary collection func (r *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]WindowsInformationProtectionNetworkLearningSummary, 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 []WindowsInformationProtectionNetworkLearningSummary 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 []WindowsInformationProtectionNetworkLearningSummary ) 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 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 } } } // Get performs GET request for WindowsInformationProtectionNetworkLearningSummary collection func (r *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest) Get(ctx context.Context) ([]WindowsInformationProtectionNetworkLearningSummary, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for WindowsInformationProtectionNetworkLearningSummary collection func (r *DeviceManagementWindowsInformationProtectionNetworkLearningSummariesCollectionRequest) Add(ctx context.Context, reqObj *WindowsInformationProtectionNetworkLearningSummary) (resObj *WindowsInformationProtectionNetworkLearningSummary, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return } // WindowsMalwareInformation returns request builder for WindowsMalwareInformation collection func (b *DeviceManagementRequestBuilder) WindowsMalwareInformation() *DeviceManagementWindowsMalwareInformationCollectionRequestBuilder { bb := &DeviceManagementWindowsMalwareInformationCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/windowsMalwareInformation" return bb } // DeviceManagementWindowsMalwareInformationCollectionRequestBuilder is request builder for WindowsMalwareInformation collection type DeviceManagementWindowsMalwareInformationCollectionRequestBuilder struct{ BaseRequestBuilder } // Request returns request for WindowsMalwareInformation collection func (b *DeviceManagementWindowsMalwareInformationCollectionRequestBuilder) Request() *DeviceManagementWindowsMalwareInformationCollectionRequest { return &DeviceManagementWindowsMalwareInformationCollectionRequest{ BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client}, } } // ID returns request builder for WindowsMalwareInformation item func (b *DeviceManagementWindowsMalwareInformationCollectionRequestBuilder) ID(id string) *WindowsMalwareInformationRequestBuilder { bb := &WindowsMalwareInformationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder} bb.baseURL += "/" + id return bb } // DeviceManagementWindowsMalwareInformationCollectionRequest is request for WindowsMalwareInformation collection type DeviceManagementWindowsMalwareInformationCollectionRequest struct{ BaseRequest } // Paging perfoms paging operation for WindowsMalwareInformation collection func (r *DeviceManagementWindowsMalwareInformationCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}) ([]WindowsMalwareInformation, 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 []WindowsMalwareInformation 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 []WindowsMalwareInformation ) 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 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 } } } // Get performs GET request for WindowsMalwareInformation collection func (r *DeviceManagementWindowsMalwareInformationCollectionRequest) Get(ctx context.Context) ([]WindowsMalwareInformation, error) { var query string if r.query != nil { query = "?" + r.query.Encode() } return r.Paging(ctx, "GET", query, nil) } // Add performs POST request for WindowsMalwareInformation collection func (r *DeviceManagementWindowsMalwareInformationCollectionRequest) Add(ctx context.Context, reqObj *WindowsMalwareInformation) (resObj *WindowsMalwareInformation, err error) { err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj) return }