5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-23 01:11:37 +00:00
matterbridge/vendor/github.com/yaegashi/msgraph.go/beta/ActionManaged.go

1981 lines
69 KiB
Go
Raw Normal View History

2020-09-04 21:29:13 +00:00
// Code generated by msgraph.go/gen DO NOT EDIT.
package msgraph
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"github.com/yaegashi/msgraph.go/jsonx"
)
// ManagedDeviceCollectionExecuteActionRequestParameter undocumented
type ManagedDeviceCollectionExecuteActionRequestParameter struct {
// ActionName undocumented
ActionName *ManagedDeviceRemoteAction `json:"actionName,omitempty"`
// KeepEnrollmentData undocumented
KeepEnrollmentData *bool `json:"keepEnrollmentData,omitempty"`
// KeepUserData undocumented
KeepUserData *bool `json:"keepUserData,omitempty"`
// DeviceIDs undocumented
DeviceIDs []string `json:"deviceIds,omitempty"`
// NotificationTitle undocumented
NotificationTitle *string `json:"notificationTitle,omitempty"`
// NotificationBody undocumented
NotificationBody *string `json:"notificationBody,omitempty"`
// DeviceName undocumented
DeviceName *string `json:"deviceName,omitempty"`
}
// ManagedAppPolicyTargetAppsRequestParameter undocumented
type ManagedAppPolicyTargetAppsRequestParameter struct {
// Apps undocumented
Apps []ManagedMobileApp `json:"apps,omitempty"`
}
// ManagedAppProtectionTargetAppsRequestParameter undocumented
type ManagedAppProtectionTargetAppsRequestParameter struct {
// Apps undocumented
Apps []ManagedMobileApp `json:"apps,omitempty"`
}
// ManagedDeviceOverrideComplianceStateRequestParameter undocumented
type ManagedDeviceOverrideComplianceStateRequestParameter struct {
// ComplianceState undocumented
ComplianceState *AdministratorConfiguredDeviceComplianceState `json:"complianceState,omitempty"`
// RemediationURL undocumented
RemediationURL *string `json:"remediationUrl,omitempty"`
}
// ManagedDeviceEnableLostModeRequestParameter undocumented
type ManagedDeviceEnableLostModeRequestParameter struct {
// Message undocumented
Message *string `json:"message,omitempty"`
// PhoneNumber undocumented
PhoneNumber *string `json:"phoneNumber,omitempty"`
// Footer undocumented
Footer *string `json:"footer,omitempty"`
}
// ManagedDevicePlayLostModeSoundRequestParameter undocumented
type ManagedDevicePlayLostModeSoundRequestParameter struct {
}
// ManagedDeviceSetDeviceNameRequestParameter undocumented
type ManagedDeviceSetDeviceNameRequestParameter struct {
// DeviceName undocumented
DeviceName *string `json:"deviceName,omitempty"`
}
// ManagedDeviceRotateFileVaultKeyRequestParameter undocumented
type ManagedDeviceRotateFileVaultKeyRequestParameter struct {
}
// ManagedDeviceRetireRequestParameter undocumented
type ManagedDeviceRetireRequestParameter struct {
}
// ManagedDeviceWipeRequestParameter undocumented
type ManagedDeviceWipeRequestParameter struct {
// KeepEnrollmentData undocumented
KeepEnrollmentData *bool `json:"keepEnrollmentData,omitempty"`
// KeepUserData undocumented
KeepUserData *bool `json:"keepUserData,omitempty"`
// MacOsUnlockCode undocumented
MacOsUnlockCode *string `json:"macOsUnlockCode,omitempty"`
}
// ManagedDeviceResetPasscodeRequestParameter undocumented
type ManagedDeviceResetPasscodeRequestParameter struct {
}
// ManagedDeviceRemoteLockRequestParameter undocumented
type ManagedDeviceRemoteLockRequestParameter struct {
}
// ManagedDeviceRequestRemoteAssistanceRequestParameter undocumented
type ManagedDeviceRequestRemoteAssistanceRequestParameter struct {
}
// ManagedDeviceDisableLostModeRequestParameter undocumented
type ManagedDeviceDisableLostModeRequestParameter struct {
}
// ManagedDeviceLocateDeviceRequestParameter undocumented
type ManagedDeviceLocateDeviceRequestParameter struct {
}
// ManagedDeviceBypassActivationLockRequestParameter undocumented
type ManagedDeviceBypassActivationLockRequestParameter struct {
}
// ManagedDeviceRebootNowRequestParameter undocumented
type ManagedDeviceRebootNowRequestParameter struct {
}
// ManagedDeviceShutDownRequestParameter undocumented
type ManagedDeviceShutDownRequestParameter struct {
}
// ManagedDeviceRecoverPasscodeRequestParameter undocumented
type ManagedDeviceRecoverPasscodeRequestParameter struct {
}
// ManagedDeviceCleanWindowsDeviceRequestParameter undocumented
type ManagedDeviceCleanWindowsDeviceRequestParameter struct {
// KeepUserData undocumented
KeepUserData *bool `json:"keepUserData,omitempty"`
}
// ManagedDeviceLogoutSharedAppleDeviceActiveUserRequestParameter undocumented
type ManagedDeviceLogoutSharedAppleDeviceActiveUserRequestParameter struct {
}
// ManagedDeviceDeleteUserFromSharedAppleDeviceRequestParameter undocumented
type ManagedDeviceDeleteUserFromSharedAppleDeviceRequestParameter struct {
// UserPrincipalName undocumented
UserPrincipalName *string `json:"userPrincipalName,omitempty"`
}
// ManagedDeviceSyncDeviceRequestParameter undocumented
type ManagedDeviceSyncDeviceRequestParameter struct {
}
// ManagedDeviceWindowsDefenderScanRequestParameter undocumented
type ManagedDeviceWindowsDefenderScanRequestParameter struct {
// QuickScan undocumented
QuickScan *bool `json:"quickScan,omitempty"`
}
// ManagedDeviceWindowsDefenderUpdateSignaturesRequestParameter undocumented
type ManagedDeviceWindowsDefenderUpdateSignaturesRequestParameter struct {
}
// ManagedDeviceUpdateWindowsDeviceAccountRequestParameter undocumented
type ManagedDeviceUpdateWindowsDeviceAccountRequestParameter struct {
// UpdateWindowsDeviceAccountActionParameter undocumented
UpdateWindowsDeviceAccountActionParameter *UpdateWindowsDeviceAccountActionParameter `json:"updateWindowsDeviceAccountActionParameter,omitempty"`
}
// ManagedDeviceRevokeAppleVPPLicensesRequestParameter undocumented
type ManagedDeviceRevokeAppleVPPLicensesRequestParameter struct {
}
// ManagedDeviceRotateBitLockerKeysRequestParameter undocumented
type ManagedDeviceRotateBitLockerKeysRequestParameter struct {
}
// ManagedDeviceSendCustomNotificationToCompanyPortalRequestParameter undocumented
type ManagedDeviceSendCustomNotificationToCompanyPortalRequestParameter struct {
// NotificationTitle undocumented
NotificationTitle *string `json:"notificationTitle,omitempty"`
// NotificationBody undocumented
NotificationBody *string `json:"notificationBody,omitempty"`
}
// ManagedDeviceTriggerConfigurationManagerActionRequestParameter undocumented
type ManagedDeviceTriggerConfigurationManagerActionRequestParameter struct {
// ConfigurationManagerAction undocumented
ConfigurationManagerAction *ConfigurationManagerAction `json:"configurationManagerAction,omitempty"`
}
// ManagedDeviceMobileAppConfigurationAssignRequestParameter undocumented
type ManagedDeviceMobileAppConfigurationAssignRequestParameter struct {
// Assignments undocumented
Assignments []ManagedDeviceMobileAppConfigurationAssignment `json:"assignments,omitempty"`
}
// ManagedEBookAssignRequestParameter undocumented
type ManagedEBookAssignRequestParameter struct {
// ManagedEBookAssignments undocumented
ManagedEBookAssignments []ManagedEBookAssignment `json:"managedEBookAssignments,omitempty"`
}
// AppliedPolicies returns request builder for ManagedAppPolicy collection
func (b *ManagedAppRegistrationRequestBuilder) AppliedPolicies() *ManagedAppRegistrationAppliedPoliciesCollectionRequestBuilder {
bb := &ManagedAppRegistrationAppliedPoliciesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/appliedPolicies"
return bb
}
// ManagedAppRegistrationAppliedPoliciesCollectionRequestBuilder is request builder for ManagedAppPolicy collection
type ManagedAppRegistrationAppliedPoliciesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedAppPolicy collection
func (b *ManagedAppRegistrationAppliedPoliciesCollectionRequestBuilder) Request() *ManagedAppRegistrationAppliedPoliciesCollectionRequest {
return &ManagedAppRegistrationAppliedPoliciesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedAppPolicy item
func (b *ManagedAppRegistrationAppliedPoliciesCollectionRequestBuilder) ID(id string) *ManagedAppPolicyRequestBuilder {
bb := &ManagedAppPolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedAppRegistrationAppliedPoliciesCollectionRequest is request for ManagedAppPolicy collection
type ManagedAppRegistrationAppliedPoliciesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedAppPolicy collection
func (r *ManagedAppRegistrationAppliedPoliciesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedAppPolicy, 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 []ManagedAppPolicy
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []ManagedAppPolicy
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedAppPolicy collection, max N pages
func (r *ManagedAppRegistrationAppliedPoliciesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedAppPolicy, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for ManagedAppPolicy collection
func (r *ManagedAppRegistrationAppliedPoliciesCollectionRequest) Get(ctx context.Context) ([]ManagedAppPolicy, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedAppPolicy collection
func (r *ManagedAppRegistrationAppliedPoliciesCollectionRequest) Add(ctx context.Context, reqObj *ManagedAppPolicy) (resObj *ManagedAppPolicy, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// IntendedPolicies returns request builder for ManagedAppPolicy collection
func (b *ManagedAppRegistrationRequestBuilder) IntendedPolicies() *ManagedAppRegistrationIntendedPoliciesCollectionRequestBuilder {
bb := &ManagedAppRegistrationIntendedPoliciesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/intendedPolicies"
return bb
}
// ManagedAppRegistrationIntendedPoliciesCollectionRequestBuilder is request builder for ManagedAppPolicy collection
type ManagedAppRegistrationIntendedPoliciesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedAppPolicy collection
func (b *ManagedAppRegistrationIntendedPoliciesCollectionRequestBuilder) Request() *ManagedAppRegistrationIntendedPoliciesCollectionRequest {
return &ManagedAppRegistrationIntendedPoliciesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedAppPolicy item
func (b *ManagedAppRegistrationIntendedPoliciesCollectionRequestBuilder) ID(id string) *ManagedAppPolicyRequestBuilder {
bb := &ManagedAppPolicyRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedAppRegistrationIntendedPoliciesCollectionRequest is request for ManagedAppPolicy collection
type ManagedAppRegistrationIntendedPoliciesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedAppPolicy collection
func (r *ManagedAppRegistrationIntendedPoliciesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedAppPolicy, 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 []ManagedAppPolicy
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []ManagedAppPolicy
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedAppPolicy collection, max N pages
func (r *ManagedAppRegistrationIntendedPoliciesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedAppPolicy, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for ManagedAppPolicy collection
func (r *ManagedAppRegistrationIntendedPoliciesCollectionRequest) Get(ctx context.Context) ([]ManagedAppPolicy, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedAppPolicy collection
func (r *ManagedAppRegistrationIntendedPoliciesCollectionRequest) Add(ctx context.Context, reqObj *ManagedAppPolicy) (resObj *ManagedAppPolicy, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// Operations returns request builder for ManagedAppOperation collection
func (b *ManagedAppRegistrationRequestBuilder) Operations() *ManagedAppRegistrationOperationsCollectionRequestBuilder {
bb := &ManagedAppRegistrationOperationsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/operations"
return bb
}
// ManagedAppRegistrationOperationsCollectionRequestBuilder is request builder for ManagedAppOperation collection
type ManagedAppRegistrationOperationsCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedAppOperation collection
func (b *ManagedAppRegistrationOperationsCollectionRequestBuilder) Request() *ManagedAppRegistrationOperationsCollectionRequest {
return &ManagedAppRegistrationOperationsCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedAppOperation item
func (b *ManagedAppRegistrationOperationsCollectionRequestBuilder) ID(id string) *ManagedAppOperationRequestBuilder {
bb := &ManagedAppOperationRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedAppRegistrationOperationsCollectionRequest is request for ManagedAppOperation collection
type ManagedAppRegistrationOperationsCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedAppOperation collection
func (r *ManagedAppRegistrationOperationsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedAppOperation, 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 []ManagedAppOperation
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []ManagedAppOperation
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedAppOperation collection, max N pages
func (r *ManagedAppRegistrationOperationsCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedAppOperation, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for ManagedAppOperation collection
func (r *ManagedAppRegistrationOperationsCollectionRequest) Get(ctx context.Context) ([]ManagedAppOperation, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedAppOperation collection
func (r *ManagedAppRegistrationOperationsCollectionRequest) Add(ctx context.Context, reqObj *ManagedAppOperation) (resObj *ManagedAppOperation, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// DetectedApps returns request builder for DetectedApp collection
func (b *ManagedDeviceRequestBuilder) DetectedApps() *ManagedDeviceDetectedAppsCollectionRequestBuilder {
bb := &ManagedDeviceDetectedAppsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/detectedApps"
return bb
}
// ManagedDeviceDetectedAppsCollectionRequestBuilder is request builder for DetectedApp collection
type ManagedDeviceDetectedAppsCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for DetectedApp collection
func (b *ManagedDeviceDetectedAppsCollectionRequestBuilder) Request() *ManagedDeviceDetectedAppsCollectionRequest {
return &ManagedDeviceDetectedAppsCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for DetectedApp item
func (b *ManagedDeviceDetectedAppsCollectionRequestBuilder) ID(id string) *DetectedAppRequestBuilder {
bb := &DetectedAppRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedDeviceDetectedAppsCollectionRequest is request for DetectedApp collection
type ManagedDeviceDetectedAppsCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for DetectedApp collection
func (r *ManagedDeviceDetectedAppsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]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 {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for DetectedApp collection, max N pages
func (r *ManagedDeviceDetectedAppsCollectionRequest) GetN(ctx context.Context, n int) ([]DetectedApp, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for DetectedApp collection
func (r *ManagedDeviceDetectedAppsCollectionRequest) Get(ctx context.Context) ([]DetectedApp, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for DetectedApp collection
func (r *ManagedDeviceDetectedAppsCollectionRequest) Add(ctx context.Context, reqObj *DetectedApp) (resObj *DetectedApp, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// DeviceCategory is navigation property
func (b *ManagedDeviceRequestBuilder) DeviceCategory() *DeviceCategoryRequestBuilder {
bb := &DeviceCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/deviceCategory"
return bb
}
// DeviceCompliancePolicyStates returns request builder for DeviceCompliancePolicyState collection
func (b *ManagedDeviceRequestBuilder) DeviceCompliancePolicyStates() *ManagedDeviceDeviceCompliancePolicyStatesCollectionRequestBuilder {
bb := &ManagedDeviceDeviceCompliancePolicyStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/deviceCompliancePolicyStates"
return bb
}
// ManagedDeviceDeviceCompliancePolicyStatesCollectionRequestBuilder is request builder for DeviceCompliancePolicyState collection
type ManagedDeviceDeviceCompliancePolicyStatesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for DeviceCompliancePolicyState collection
func (b *ManagedDeviceDeviceCompliancePolicyStatesCollectionRequestBuilder) Request() *ManagedDeviceDeviceCompliancePolicyStatesCollectionRequest {
return &ManagedDeviceDeviceCompliancePolicyStatesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for DeviceCompliancePolicyState item
func (b *ManagedDeviceDeviceCompliancePolicyStatesCollectionRequestBuilder) ID(id string) *DeviceCompliancePolicyStateRequestBuilder {
bb := &DeviceCompliancePolicyStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedDeviceDeviceCompliancePolicyStatesCollectionRequest is request for DeviceCompliancePolicyState collection
type ManagedDeviceDeviceCompliancePolicyStatesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for DeviceCompliancePolicyState collection
func (r *ManagedDeviceDeviceCompliancePolicyStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceCompliancePolicyState, 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 []DeviceCompliancePolicyState
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []DeviceCompliancePolicyState
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for DeviceCompliancePolicyState collection, max N pages
func (r *ManagedDeviceDeviceCompliancePolicyStatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceCompliancePolicyState, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for DeviceCompliancePolicyState collection
func (r *ManagedDeviceDeviceCompliancePolicyStatesCollectionRequest) Get(ctx context.Context) ([]DeviceCompliancePolicyState, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for DeviceCompliancePolicyState collection
func (r *ManagedDeviceDeviceCompliancePolicyStatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceCompliancePolicyState) (resObj *DeviceCompliancePolicyState, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// DeviceConfigurationStates returns request builder for DeviceConfigurationState collection
func (b *ManagedDeviceRequestBuilder) DeviceConfigurationStates() *ManagedDeviceDeviceConfigurationStatesCollectionRequestBuilder {
bb := &ManagedDeviceDeviceConfigurationStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/deviceConfigurationStates"
return bb
}
// ManagedDeviceDeviceConfigurationStatesCollectionRequestBuilder is request builder for DeviceConfigurationState collection
type ManagedDeviceDeviceConfigurationStatesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for DeviceConfigurationState collection
func (b *ManagedDeviceDeviceConfigurationStatesCollectionRequestBuilder) Request() *ManagedDeviceDeviceConfigurationStatesCollectionRequest {
return &ManagedDeviceDeviceConfigurationStatesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for DeviceConfigurationState item
func (b *ManagedDeviceDeviceConfigurationStatesCollectionRequestBuilder) ID(id string) *DeviceConfigurationStateRequestBuilder {
bb := &DeviceConfigurationStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedDeviceDeviceConfigurationStatesCollectionRequest is request for DeviceConfigurationState collection
type ManagedDeviceDeviceConfigurationStatesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for DeviceConfigurationState collection
func (r *ManagedDeviceDeviceConfigurationStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceConfigurationState, 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 []DeviceConfigurationState
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []DeviceConfigurationState
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for DeviceConfigurationState collection, max N pages
func (r *ManagedDeviceDeviceConfigurationStatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceConfigurationState, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for DeviceConfigurationState collection
func (r *ManagedDeviceDeviceConfigurationStatesCollectionRequest) Get(ctx context.Context) ([]DeviceConfigurationState, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for DeviceConfigurationState collection
func (r *ManagedDeviceDeviceConfigurationStatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceConfigurationState) (resObj *DeviceConfigurationState, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// ManagedDeviceMobileAppConfigurationStates returns request builder for ManagedDeviceMobileAppConfigurationState collection
func (b *ManagedDeviceRequestBuilder) ManagedDeviceMobileAppConfigurationStates() *ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequestBuilder {
bb := &ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/managedDeviceMobileAppConfigurationStates"
return bb
}
// ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequestBuilder is request builder for ManagedDeviceMobileAppConfigurationState collection
type ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedDeviceMobileAppConfigurationState collection
func (b *ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequestBuilder) Request() *ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequest {
return &ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedDeviceMobileAppConfigurationState item
func (b *ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequestBuilder) ID(id string) *ManagedDeviceMobileAppConfigurationStateRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequest is request for ManagedDeviceMobileAppConfigurationState collection
type ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedDeviceMobileAppConfigurationState collection
func (r *ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedDeviceMobileAppConfigurationState, 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 []ManagedDeviceMobileAppConfigurationState
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []ManagedDeviceMobileAppConfigurationState
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedDeviceMobileAppConfigurationState collection, max N pages
func (r *ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedDeviceMobileAppConfigurationState, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for ManagedDeviceMobileAppConfigurationState collection
func (r *ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceMobileAppConfigurationState, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedDeviceMobileAppConfigurationState collection
func (r *ManagedDeviceManagedDeviceMobileAppConfigurationStatesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceMobileAppConfigurationState) (resObj *ManagedDeviceMobileAppConfigurationState, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// SecurityBaselineStates returns request builder for SecurityBaselineState collection
func (b *ManagedDeviceRequestBuilder) SecurityBaselineStates() *ManagedDeviceSecurityBaselineStatesCollectionRequestBuilder {
bb := &ManagedDeviceSecurityBaselineStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/securityBaselineStates"
return bb
}
// ManagedDeviceSecurityBaselineStatesCollectionRequestBuilder is request builder for SecurityBaselineState collection
type ManagedDeviceSecurityBaselineStatesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for SecurityBaselineState collection
func (b *ManagedDeviceSecurityBaselineStatesCollectionRequestBuilder) Request() *ManagedDeviceSecurityBaselineStatesCollectionRequest {
return &ManagedDeviceSecurityBaselineStatesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for SecurityBaselineState item
func (b *ManagedDeviceSecurityBaselineStatesCollectionRequestBuilder) ID(id string) *SecurityBaselineStateRequestBuilder {
bb := &SecurityBaselineStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedDeviceSecurityBaselineStatesCollectionRequest is request for SecurityBaselineState collection
type ManagedDeviceSecurityBaselineStatesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for SecurityBaselineState collection
func (r *ManagedDeviceSecurityBaselineStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]SecurityBaselineState, 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 []SecurityBaselineState
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []SecurityBaselineState
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for SecurityBaselineState collection, max N pages
func (r *ManagedDeviceSecurityBaselineStatesCollectionRequest) GetN(ctx context.Context, n int) ([]SecurityBaselineState, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for SecurityBaselineState collection
func (r *ManagedDeviceSecurityBaselineStatesCollectionRequest) Get(ctx context.Context) ([]SecurityBaselineState, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for SecurityBaselineState collection
func (r *ManagedDeviceSecurityBaselineStatesCollectionRequest) Add(ctx context.Context, reqObj *SecurityBaselineState) (resObj *SecurityBaselineState, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// Users returns request builder for User collection
func (b *ManagedDeviceRequestBuilder) Users() *ManagedDeviceUsersCollectionRequestBuilder {
bb := &ManagedDeviceUsersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/users"
return bb
}
// ManagedDeviceUsersCollectionRequestBuilder is request builder for User collection
type ManagedDeviceUsersCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for User collection
func (b *ManagedDeviceUsersCollectionRequestBuilder) Request() *ManagedDeviceUsersCollectionRequest {
return &ManagedDeviceUsersCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for User item
func (b *ManagedDeviceUsersCollectionRequestBuilder) ID(id string) *UserRequestBuilder {
bb := &UserRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedDeviceUsersCollectionRequest is request for User collection
type ManagedDeviceUsersCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for User collection
func (r *ManagedDeviceUsersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]User, 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 []User
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []User
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for User collection, max N pages
func (r *ManagedDeviceUsersCollectionRequest) GetN(ctx context.Context, n int) ([]User, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for User collection
func (r *ManagedDeviceUsersCollectionRequest) Get(ctx context.Context) ([]User, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for User collection
func (r *ManagedDeviceUsersCollectionRequest) Add(ctx context.Context, reqObj *User) (resObj *User, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// WindowsProtectionState is navigation property
func (b *ManagedDeviceRequestBuilder) WindowsProtectionState() *WindowsProtectionStateRequestBuilder {
bb := &WindowsProtectionStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/windowsProtectionState"
return bb
}
// Assignments returns request builder for ManagedDeviceMobileAppConfigurationAssignment collection
func (b *ManagedDeviceMobileAppConfigurationRequestBuilder) Assignments() *ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/assignments"
return bb
}
// ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequestBuilder is request builder for ManagedDeviceMobileAppConfigurationAssignment collection
type ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedDeviceMobileAppConfigurationAssignment collection
func (b *ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequestBuilder) Request() *ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequest {
return &ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedDeviceMobileAppConfigurationAssignment item
func (b *ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequestBuilder) ID(id string) *ManagedDeviceMobileAppConfigurationAssignmentRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequest is request for ManagedDeviceMobileAppConfigurationAssignment collection
type ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedDeviceMobileAppConfigurationAssignment collection
func (r *ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedDeviceMobileAppConfigurationAssignment, 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 []ManagedDeviceMobileAppConfigurationAssignment
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []ManagedDeviceMobileAppConfigurationAssignment
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedDeviceMobileAppConfigurationAssignment collection, max N pages
func (r *ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedDeviceMobileAppConfigurationAssignment, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for ManagedDeviceMobileAppConfigurationAssignment collection
func (r *ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceMobileAppConfigurationAssignment, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedDeviceMobileAppConfigurationAssignment collection
func (r *ManagedDeviceMobileAppConfigurationAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceMobileAppConfigurationAssignment) (resObj *ManagedDeviceMobileAppConfigurationAssignment, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// DeviceStatusSummary is navigation property
func (b *ManagedDeviceMobileAppConfigurationRequestBuilder) DeviceStatusSummary() *ManagedDeviceMobileAppConfigurationDeviceSummaryRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationDeviceSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/deviceStatusSummary"
return bb
}
// DeviceStatuses returns request builder for ManagedDeviceMobileAppConfigurationDeviceStatus collection
func (b *ManagedDeviceMobileAppConfigurationRequestBuilder) DeviceStatuses() *ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/deviceStatuses"
return bb
}
// ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequestBuilder is request builder for ManagedDeviceMobileAppConfigurationDeviceStatus collection
type ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedDeviceMobileAppConfigurationDeviceStatus collection
func (b *ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequestBuilder) Request() *ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequest {
return &ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedDeviceMobileAppConfigurationDeviceStatus item
func (b *ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequestBuilder) ID(id string) *ManagedDeviceMobileAppConfigurationDeviceStatusRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationDeviceStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequest is request for ManagedDeviceMobileAppConfigurationDeviceStatus collection
type ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedDeviceMobileAppConfigurationDeviceStatus collection
func (r *ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedDeviceMobileAppConfigurationDeviceStatus, 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 []ManagedDeviceMobileAppConfigurationDeviceStatus
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []ManagedDeviceMobileAppConfigurationDeviceStatus
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedDeviceMobileAppConfigurationDeviceStatus collection, max N pages
func (r *ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedDeviceMobileAppConfigurationDeviceStatus, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for ManagedDeviceMobileAppConfigurationDeviceStatus collection
func (r *ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceMobileAppConfigurationDeviceStatus, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedDeviceMobileAppConfigurationDeviceStatus collection
func (r *ManagedDeviceMobileAppConfigurationDeviceStatusesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceMobileAppConfigurationDeviceStatus) (resObj *ManagedDeviceMobileAppConfigurationDeviceStatus, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// UserStatusSummary is navigation property
func (b *ManagedDeviceMobileAppConfigurationRequestBuilder) UserStatusSummary() *ManagedDeviceMobileAppConfigurationUserSummaryRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationUserSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/userStatusSummary"
return bb
}
// UserStatuses returns request builder for ManagedDeviceMobileAppConfigurationUserStatus collection
func (b *ManagedDeviceMobileAppConfigurationRequestBuilder) UserStatuses() *ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/userStatuses"
return bb
}
// ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequestBuilder is request builder for ManagedDeviceMobileAppConfigurationUserStatus collection
type ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedDeviceMobileAppConfigurationUserStatus collection
func (b *ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequestBuilder) Request() *ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequest {
return &ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedDeviceMobileAppConfigurationUserStatus item
func (b *ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequestBuilder) ID(id string) *ManagedDeviceMobileAppConfigurationUserStatusRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationUserStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequest is request for ManagedDeviceMobileAppConfigurationUserStatus collection
type ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedDeviceMobileAppConfigurationUserStatus collection
func (r *ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedDeviceMobileAppConfigurationUserStatus, 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 []ManagedDeviceMobileAppConfigurationUserStatus
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []ManagedDeviceMobileAppConfigurationUserStatus
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedDeviceMobileAppConfigurationUserStatus collection, max N pages
func (r *ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedDeviceMobileAppConfigurationUserStatus, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for ManagedDeviceMobileAppConfigurationUserStatus collection
func (r *ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceMobileAppConfigurationUserStatus, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedDeviceMobileAppConfigurationUserStatus collection
func (r *ManagedDeviceMobileAppConfigurationUserStatusesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceMobileAppConfigurationUserStatus) (resObj *ManagedDeviceMobileAppConfigurationUserStatus, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// Assignments returns request builder for ManagedEBookAssignment collection
func (b *ManagedEBookRequestBuilder) Assignments() *ManagedEBookAssignmentsCollectionRequestBuilder {
bb := &ManagedEBookAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/assignments"
return bb
}
// ManagedEBookAssignmentsCollectionRequestBuilder is request builder for ManagedEBookAssignment collection
type ManagedEBookAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedEBookAssignment collection
func (b *ManagedEBookAssignmentsCollectionRequestBuilder) Request() *ManagedEBookAssignmentsCollectionRequest {
return &ManagedEBookAssignmentsCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedEBookAssignment item
func (b *ManagedEBookAssignmentsCollectionRequestBuilder) ID(id string) *ManagedEBookAssignmentRequestBuilder {
bb := &ManagedEBookAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedEBookAssignmentsCollectionRequest is request for ManagedEBookAssignment collection
type ManagedEBookAssignmentsCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedEBookAssignment collection
func (r *ManagedEBookAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedEBookAssignment, 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 []ManagedEBookAssignment
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []ManagedEBookAssignment
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedEBookAssignment collection, max N pages
func (r *ManagedEBookAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedEBookAssignment, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for ManagedEBookAssignment collection
func (r *ManagedEBookAssignmentsCollectionRequest) Get(ctx context.Context) ([]ManagedEBookAssignment, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedEBookAssignment collection
func (r *ManagedEBookAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *ManagedEBookAssignment) (resObj *ManagedEBookAssignment, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// Categories returns request builder for ManagedEBookCategory collection
func (b *ManagedEBookRequestBuilder) Categories() *ManagedEBookCategoriesCollectionRequestBuilder {
bb := &ManagedEBookCategoriesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/categories"
return bb
}
// ManagedEBookCategoriesCollectionRequestBuilder is request builder for ManagedEBookCategory collection
type ManagedEBookCategoriesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedEBookCategory collection
func (b *ManagedEBookCategoriesCollectionRequestBuilder) Request() *ManagedEBookCategoriesCollectionRequest {
return &ManagedEBookCategoriesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedEBookCategory item
func (b *ManagedEBookCategoriesCollectionRequestBuilder) ID(id string) *ManagedEBookCategoryRequestBuilder {
bb := &ManagedEBookCategoryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedEBookCategoriesCollectionRequest is request for ManagedEBookCategory collection
type ManagedEBookCategoriesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedEBookCategory collection
func (r *ManagedEBookCategoriesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedEBookCategory, 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 []ManagedEBookCategory
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []ManagedEBookCategory
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedEBookCategory collection, max N pages
func (r *ManagedEBookCategoriesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedEBookCategory, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for ManagedEBookCategory collection
func (r *ManagedEBookCategoriesCollectionRequest) Get(ctx context.Context) ([]ManagedEBookCategory, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedEBookCategory collection
func (r *ManagedEBookCategoriesCollectionRequest) Add(ctx context.Context, reqObj *ManagedEBookCategory) (resObj *ManagedEBookCategory, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// DeviceStates returns request builder for DeviceInstallState collection
func (b *ManagedEBookRequestBuilder) DeviceStates() *ManagedEBookDeviceStatesCollectionRequestBuilder {
bb := &ManagedEBookDeviceStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/deviceStates"
return bb
}
// ManagedEBookDeviceStatesCollectionRequestBuilder is request builder for DeviceInstallState collection
type ManagedEBookDeviceStatesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for DeviceInstallState collection
func (b *ManagedEBookDeviceStatesCollectionRequestBuilder) Request() *ManagedEBookDeviceStatesCollectionRequest {
return &ManagedEBookDeviceStatesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for DeviceInstallState item
func (b *ManagedEBookDeviceStatesCollectionRequestBuilder) ID(id string) *DeviceInstallStateRequestBuilder {
bb := &DeviceInstallStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedEBookDeviceStatesCollectionRequest is request for DeviceInstallState collection
type ManagedEBookDeviceStatesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for DeviceInstallState collection
func (r *ManagedEBookDeviceStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]DeviceInstallState, 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 []DeviceInstallState
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []DeviceInstallState
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for DeviceInstallState collection, max N pages
func (r *ManagedEBookDeviceStatesCollectionRequest) GetN(ctx context.Context, n int) ([]DeviceInstallState, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for DeviceInstallState collection
func (r *ManagedEBookDeviceStatesCollectionRequest) Get(ctx context.Context) ([]DeviceInstallState, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for DeviceInstallState collection
func (r *ManagedEBookDeviceStatesCollectionRequest) Add(ctx context.Context, reqObj *DeviceInstallState) (resObj *DeviceInstallState, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// InstallSummary is navigation property
func (b *ManagedEBookRequestBuilder) InstallSummary() *EBookInstallSummaryRequestBuilder {
bb := &EBookInstallSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/installSummary"
return bb
}
// UserStateSummary returns request builder for UserInstallStateSummary collection
func (b *ManagedEBookRequestBuilder) UserStateSummary() *ManagedEBookUserStateSummaryCollectionRequestBuilder {
bb := &ManagedEBookUserStateSummaryCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/userStateSummary"
return bb
}
// ManagedEBookUserStateSummaryCollectionRequestBuilder is request builder for UserInstallStateSummary collection
type ManagedEBookUserStateSummaryCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for UserInstallStateSummary collection
func (b *ManagedEBookUserStateSummaryCollectionRequestBuilder) Request() *ManagedEBookUserStateSummaryCollectionRequest {
return &ManagedEBookUserStateSummaryCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for UserInstallStateSummary item
func (b *ManagedEBookUserStateSummaryCollectionRequestBuilder) ID(id string) *UserInstallStateSummaryRequestBuilder {
bb := &UserInstallStateSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedEBookUserStateSummaryCollectionRequest is request for UserInstallStateSummary collection
type ManagedEBookUserStateSummaryCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for UserInstallStateSummary collection
func (r *ManagedEBookUserStateSummaryCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]UserInstallStateSummary, 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 []UserInstallStateSummary
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []UserInstallStateSummary
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for UserInstallStateSummary collection, max N pages
func (r *ManagedEBookUserStateSummaryCollectionRequest) GetN(ctx context.Context, n int) ([]UserInstallStateSummary, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for UserInstallStateSummary collection
func (r *ManagedEBookUserStateSummaryCollectionRequest) Get(ctx context.Context) ([]UserInstallStateSummary, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for UserInstallStateSummary collection
func (r *ManagedEBookUserStateSummaryCollectionRequest) Add(ctx context.Context, reqObj *UserInstallStateSummary) (resObj *UserInstallStateSummary, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// ContentVersions returns request builder for MobileAppContent collection
func (b *ManagedMobileLobAppRequestBuilder) ContentVersions() *ManagedMobileLobAppContentVersionsCollectionRequestBuilder {
bb := &ManagedMobileLobAppContentVersionsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/contentVersions"
return bb
}
// ManagedMobileLobAppContentVersionsCollectionRequestBuilder is request builder for MobileAppContent collection
type ManagedMobileLobAppContentVersionsCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for MobileAppContent collection
func (b *ManagedMobileLobAppContentVersionsCollectionRequestBuilder) Request() *ManagedMobileLobAppContentVersionsCollectionRequest {
return &ManagedMobileLobAppContentVersionsCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for MobileAppContent item
func (b *ManagedMobileLobAppContentVersionsCollectionRequestBuilder) ID(id string) *MobileAppContentRequestBuilder {
bb := &MobileAppContentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// ManagedMobileLobAppContentVersionsCollectionRequest is request for MobileAppContent collection
type ManagedMobileLobAppContentVersionsCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for MobileAppContent collection
func (r *ManagedMobileLobAppContentVersionsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]MobileAppContent, 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 []MobileAppContent
for {
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
2020-09-04 21:29:13 +00:00
res.Body.Close()
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 []MobileAppContent
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
2020-09-04 21:29:13 +00:00
res.Body.Close()
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for MobileAppContent collection, max N pages
func (r *ManagedMobileLobAppContentVersionsCollectionRequest) GetN(ctx context.Context, n int) ([]MobileAppContent, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for MobileAppContent collection
func (r *ManagedMobileLobAppContentVersionsCollectionRequest) Get(ctx context.Context) ([]MobileAppContent, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for MobileAppContent collection
func (r *ManagedMobileLobAppContentVersionsCollectionRequest) Add(ctx context.Context, reqObj *MobileAppContent) (resObj *MobileAppContent, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}