5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-30 02:41:36 +00:00
matterbridge/vendor/github.com/yaegashi/msgraph.go/beta/ActionIOS.go
2020-03-22 00:02:48 +01:00

1166 lines
45 KiB
Go

// Code generated by msgraph-generate.go DO NOT EDIT.
package msgraph
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"github.com/yaegashi/msgraph.go/jsonx"
)
// IOSLobAppProvisioningConfigurationCollectionHasPayloadLinksRequestParameter undocumented
type IOSLobAppProvisioningConfigurationCollectionHasPayloadLinksRequestParameter struct {
// PayloadIDs undocumented
PayloadIDs []string `json:"payloadIds,omitempty"`
}
// IOSManagedAppProtectionCollectionHasPayloadLinksRequestParameter undocumented
type IOSManagedAppProtectionCollectionHasPayloadLinksRequestParameter struct {
// PayloadIDs undocumented
PayloadIDs []string `json:"payloadIds,omitempty"`
}
// IOSLobAppProvisioningConfigurationAssignRequestParameter undocumented
type IOSLobAppProvisioningConfigurationAssignRequestParameter struct {
// AppProvisioningConfigurationGroupAssignments undocumented
AppProvisioningConfigurationGroupAssignments []MobileAppProvisioningConfigGroupAssignment `json:"appProvisioningConfigurationGroupAssignments,omitempty"`
// IOSLobAppProvisioningConfigAssignments undocumented
IOSLobAppProvisioningConfigAssignments []IOSLobAppProvisioningConfigurationAssignment `json:"iOSLobAppProvisioningConfigAssignments,omitempty"`
}
// IOSVPPAppRevokeAllLicensesRequestParameter undocumented
type IOSVPPAppRevokeAllLicensesRequestParameter struct {
// NotifyManagedDevices undocumented
NotifyManagedDevices *bool `json:"notifyManagedDevices,omitempty"`
}
// IOSVPPAppRevokeUserLicenseRequestParameter undocumented
type IOSVPPAppRevokeUserLicenseRequestParameter struct {
// UserID undocumented
UserID *string `json:"userId,omitempty"`
// NotifyManagedDevices undocumented
NotifyManagedDevices *bool `json:"notifyManagedDevices,omitempty"`
}
// IOSVPPAppRevokeDeviceLicenseRequestParameter undocumented
type IOSVPPAppRevokeDeviceLicenseRequestParameter struct {
// ManagedDeviceID undocumented
ManagedDeviceID *string `json:"managedDeviceId,omitempty"`
// NotifyManagedDevices undocumented
NotifyManagedDevices *bool `json:"notifyManagedDevices,omitempty"`
}
// DerivedCredentialSettings is navigation property
func (b *IOSDerivedCredentialAuthenticationConfigurationRequestBuilder) DerivedCredentialSettings() *DeviceManagementDerivedCredentialSettingsRequestBuilder {
bb := &DeviceManagementDerivedCredentialSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/derivedCredentialSettings"
return bb
}
// IdentityCertificateForClientAuthentication is navigation property
func (b *IOSDeviceFeaturesConfigurationRequestBuilder) IdentityCertificateForClientAuthentication() *IOSCertificateProfileBaseRequestBuilder {
bb := &IOSCertificateProfileBaseRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/identityCertificateForClientAuthentication"
return bb
}
// SingleSignOnExtensionPkinitCertificate is navigation property
func (b *IOSDeviceFeaturesConfigurationRequestBuilder) SingleSignOnExtensionPkinitCertificate() *IOSCertificateProfileBaseRequestBuilder {
bb := &IOSCertificateProfileBaseRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/singleSignOnExtensionPkinitCertificate"
return bb
}
// DerivedCredentialSettings is navigation property
func (b *IOSEasEmailProfileConfigurationRequestBuilder) DerivedCredentialSettings() *DeviceManagementDerivedCredentialSettingsRequestBuilder {
bb := &DeviceManagementDerivedCredentialSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/derivedCredentialSettings"
return bb
}
// IdentityCertificate is navigation property
func (b *IOSEasEmailProfileConfigurationRequestBuilder) IdentityCertificate() *IOSCertificateProfileBaseRequestBuilder {
bb := &IOSCertificateProfileBaseRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/identityCertificate"
return bb
}
// SmimeEncryptionCertificate is navigation property
func (b *IOSEasEmailProfileConfigurationRequestBuilder) SmimeEncryptionCertificate() *IOSCertificateProfileRequestBuilder {
bb := &IOSCertificateProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/smimeEncryptionCertificate"
return bb
}
// SmimeSigningCertificate is navigation property
func (b *IOSEasEmailProfileConfigurationRequestBuilder) SmimeSigningCertificate() *IOSCertificateProfileRequestBuilder {
bb := &IOSCertificateProfileRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/smimeSigningCertificate"
return bb
}
// DerivedCredentialSettings is navigation property
func (b *IOSEnterpriseWiFiConfigurationRequestBuilder) DerivedCredentialSettings() *DeviceManagementDerivedCredentialSettingsRequestBuilder {
bb := &DeviceManagementDerivedCredentialSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/derivedCredentialSettings"
return bb
}
// IdentityCertificateForClientAuthentication is navigation property
func (b *IOSEnterpriseWiFiConfigurationRequestBuilder) IdentityCertificateForClientAuthentication() *IOSCertificateProfileBaseRequestBuilder {
bb := &IOSCertificateProfileBaseRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/identityCertificateForClientAuthentication"
return bb
}
// RootCertificatesForServerValidation returns request builder for IOSTrustedRootCertificate collection
func (b *IOSEnterpriseWiFiConfigurationRequestBuilder) RootCertificatesForServerValidation() *IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequestBuilder {
bb := &IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/rootCertificatesForServerValidation"
return bb
}
// IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequestBuilder is request builder for IOSTrustedRootCertificate collection
type IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for IOSTrustedRootCertificate collection
func (b *IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequestBuilder) Request() *IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequest {
return &IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for IOSTrustedRootCertificate item
func (b *IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequestBuilder) ID(id string) *IOSTrustedRootCertificateRequestBuilder {
bb := &IOSTrustedRootCertificateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequest is request for IOSTrustedRootCertificate collection
type IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for IOSTrustedRootCertificate collection
func (r *IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]IOSTrustedRootCertificate, 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 []IOSTrustedRootCertificate
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 []IOSTrustedRootCertificate
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for IOSTrustedRootCertificate collection, max N pages
func (r *IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequest) GetN(ctx context.Context, n int) ([]IOSTrustedRootCertificate, 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 IOSTrustedRootCertificate collection
func (r *IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequest) Get(ctx context.Context) ([]IOSTrustedRootCertificate, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for IOSTrustedRootCertificate collection
func (r *IOSEnterpriseWiFiConfigurationRootCertificatesForServerValidationCollectionRequest) Add(ctx context.Context, reqObj *IOSTrustedRootCertificate) (resObj *IOSTrustedRootCertificate, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// ManagedDeviceCertificateStates returns request builder for ManagedDeviceCertificateState collection
func (b *IOSImportedPFXCertificateProfileRequestBuilder) ManagedDeviceCertificateStates() *IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder {
bb := &IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/managedDeviceCertificateStates"
return bb
}
// IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder is request builder for ManagedDeviceCertificateState collection
type IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedDeviceCertificateState collection
func (b *IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder) Request() *IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequest {
return &IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedDeviceCertificateState item
func (b *IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder) ID(id string) *ManagedDeviceCertificateStateRequestBuilder {
bb := &ManagedDeviceCertificateStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequest is request for ManagedDeviceCertificateState collection
type IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedDeviceCertificateState collection
func (r *IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedDeviceCertificateState, 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 []ManagedDeviceCertificateState
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 []ManagedDeviceCertificateState
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedDeviceCertificateState collection, max N pages
func (r *IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedDeviceCertificateState, 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 ManagedDeviceCertificateState collection
func (r *IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceCertificateState, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedDeviceCertificateState collection
func (r *IOSImportedPFXCertificateProfileManagedDeviceCertificateStatesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceCertificateState) (resObj *ManagedDeviceCertificateState, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// Assignments returns request builder for IOSLobAppProvisioningConfigurationAssignment collection
func (b *IOSLobAppProvisioningConfigurationRequestBuilder) Assignments() *IOSLobAppProvisioningConfigurationAssignmentsCollectionRequestBuilder {
bb := &IOSLobAppProvisioningConfigurationAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/assignments"
return bb
}
// IOSLobAppProvisioningConfigurationAssignmentsCollectionRequestBuilder is request builder for IOSLobAppProvisioningConfigurationAssignment collection
type IOSLobAppProvisioningConfigurationAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for IOSLobAppProvisioningConfigurationAssignment collection
func (b *IOSLobAppProvisioningConfigurationAssignmentsCollectionRequestBuilder) Request() *IOSLobAppProvisioningConfigurationAssignmentsCollectionRequest {
return &IOSLobAppProvisioningConfigurationAssignmentsCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for IOSLobAppProvisioningConfigurationAssignment item
func (b *IOSLobAppProvisioningConfigurationAssignmentsCollectionRequestBuilder) ID(id string) *IOSLobAppProvisioningConfigurationAssignmentRequestBuilder {
bb := &IOSLobAppProvisioningConfigurationAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// IOSLobAppProvisioningConfigurationAssignmentsCollectionRequest is request for IOSLobAppProvisioningConfigurationAssignment collection
type IOSLobAppProvisioningConfigurationAssignmentsCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for IOSLobAppProvisioningConfigurationAssignment collection
func (r *IOSLobAppProvisioningConfigurationAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]IOSLobAppProvisioningConfigurationAssignment, 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 []IOSLobAppProvisioningConfigurationAssignment
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 []IOSLobAppProvisioningConfigurationAssignment
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for IOSLobAppProvisioningConfigurationAssignment collection, max N pages
func (r *IOSLobAppProvisioningConfigurationAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]IOSLobAppProvisioningConfigurationAssignment, 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 IOSLobAppProvisioningConfigurationAssignment collection
func (r *IOSLobAppProvisioningConfigurationAssignmentsCollectionRequest) Get(ctx context.Context) ([]IOSLobAppProvisioningConfigurationAssignment, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for IOSLobAppProvisioningConfigurationAssignment collection
func (r *IOSLobAppProvisioningConfigurationAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *IOSLobAppProvisioningConfigurationAssignment) (resObj *IOSLobAppProvisioningConfigurationAssignment, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// DeviceStatuses returns request builder for ManagedDeviceMobileAppConfigurationDeviceStatus collection
func (b *IOSLobAppProvisioningConfigurationRequestBuilder) DeviceStatuses() *IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequestBuilder {
bb := &IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/deviceStatuses"
return bb
}
// IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequestBuilder is request builder for ManagedDeviceMobileAppConfigurationDeviceStatus collection
type IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedDeviceMobileAppConfigurationDeviceStatus collection
func (b *IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequestBuilder) Request() *IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequest {
return &IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedDeviceMobileAppConfigurationDeviceStatus item
func (b *IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequestBuilder) ID(id string) *ManagedDeviceMobileAppConfigurationDeviceStatusRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationDeviceStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequest is request for ManagedDeviceMobileAppConfigurationDeviceStatus collection
type IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedDeviceMobileAppConfigurationDeviceStatus collection
func (r *IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequest) 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 {
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 []ManagedDeviceMobileAppConfigurationDeviceStatus
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedDeviceMobileAppConfigurationDeviceStatus collection, max N pages
func (r *IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequest) 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 *IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceMobileAppConfigurationDeviceStatus, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedDeviceMobileAppConfigurationDeviceStatus collection
func (r *IOSLobAppProvisioningConfigurationDeviceStatusesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceMobileAppConfigurationDeviceStatus) (resObj *ManagedDeviceMobileAppConfigurationDeviceStatus, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// GroupAssignments returns request builder for MobileAppProvisioningConfigGroupAssignment collection
func (b *IOSLobAppProvisioningConfigurationRequestBuilder) GroupAssignments() *IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequestBuilder {
bb := &IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/groupAssignments"
return bb
}
// IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequestBuilder is request builder for MobileAppProvisioningConfigGroupAssignment collection
type IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for MobileAppProvisioningConfigGroupAssignment collection
func (b *IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequestBuilder) Request() *IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequest {
return &IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for MobileAppProvisioningConfigGroupAssignment item
func (b *IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequestBuilder) ID(id string) *MobileAppProvisioningConfigGroupAssignmentRequestBuilder {
bb := &MobileAppProvisioningConfigGroupAssignmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequest is request for MobileAppProvisioningConfigGroupAssignment collection
type IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for MobileAppProvisioningConfigGroupAssignment collection
func (r *IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]MobileAppProvisioningConfigGroupAssignment, 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 []MobileAppProvisioningConfigGroupAssignment
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 []MobileAppProvisioningConfigGroupAssignment
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for MobileAppProvisioningConfigGroupAssignment collection, max N pages
func (r *IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequest) GetN(ctx context.Context, n int) ([]MobileAppProvisioningConfigGroupAssignment, 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 MobileAppProvisioningConfigGroupAssignment collection
func (r *IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequest) Get(ctx context.Context) ([]MobileAppProvisioningConfigGroupAssignment, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for MobileAppProvisioningConfigGroupAssignment collection
func (r *IOSLobAppProvisioningConfigurationGroupAssignmentsCollectionRequest) Add(ctx context.Context, reqObj *MobileAppProvisioningConfigGroupAssignment) (resObj *MobileAppProvisioningConfigGroupAssignment, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// UserStatuses returns request builder for ManagedDeviceMobileAppConfigurationUserStatus collection
func (b *IOSLobAppProvisioningConfigurationRequestBuilder) UserStatuses() *IOSLobAppProvisioningConfigurationUserStatusesCollectionRequestBuilder {
bb := &IOSLobAppProvisioningConfigurationUserStatusesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/userStatuses"
return bb
}
// IOSLobAppProvisioningConfigurationUserStatusesCollectionRequestBuilder is request builder for ManagedDeviceMobileAppConfigurationUserStatus collection
type IOSLobAppProvisioningConfigurationUserStatusesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedDeviceMobileAppConfigurationUserStatus collection
func (b *IOSLobAppProvisioningConfigurationUserStatusesCollectionRequestBuilder) Request() *IOSLobAppProvisioningConfigurationUserStatusesCollectionRequest {
return &IOSLobAppProvisioningConfigurationUserStatusesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedDeviceMobileAppConfigurationUserStatus item
func (b *IOSLobAppProvisioningConfigurationUserStatusesCollectionRequestBuilder) ID(id string) *ManagedDeviceMobileAppConfigurationUserStatusRequestBuilder {
bb := &ManagedDeviceMobileAppConfigurationUserStatusRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// IOSLobAppProvisioningConfigurationUserStatusesCollectionRequest is request for ManagedDeviceMobileAppConfigurationUserStatus collection
type IOSLobAppProvisioningConfigurationUserStatusesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedDeviceMobileAppConfigurationUserStatus collection
func (r *IOSLobAppProvisioningConfigurationUserStatusesCollectionRequest) 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 {
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 []ManagedDeviceMobileAppConfigurationUserStatus
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedDeviceMobileAppConfigurationUserStatus collection, max N pages
func (r *IOSLobAppProvisioningConfigurationUserStatusesCollectionRequest) 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 *IOSLobAppProvisioningConfigurationUserStatusesCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceMobileAppConfigurationUserStatus, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedDeviceMobileAppConfigurationUserStatus collection
func (r *IOSLobAppProvisioningConfigurationUserStatusesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceMobileAppConfigurationUserStatus) (resObj *ManagedDeviceMobileAppConfigurationUserStatus, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// Apps returns request builder for ManagedMobileApp collection
func (b *IOSManagedAppProtectionRequestBuilder) Apps() *IOSManagedAppProtectionAppsCollectionRequestBuilder {
bb := &IOSManagedAppProtectionAppsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/apps"
return bb
}
// IOSManagedAppProtectionAppsCollectionRequestBuilder is request builder for ManagedMobileApp collection
type IOSManagedAppProtectionAppsCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedMobileApp collection
func (b *IOSManagedAppProtectionAppsCollectionRequestBuilder) Request() *IOSManagedAppProtectionAppsCollectionRequest {
return &IOSManagedAppProtectionAppsCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedMobileApp item
func (b *IOSManagedAppProtectionAppsCollectionRequestBuilder) ID(id string) *ManagedMobileAppRequestBuilder {
bb := &ManagedMobileAppRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// IOSManagedAppProtectionAppsCollectionRequest is request for ManagedMobileApp collection
type IOSManagedAppProtectionAppsCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedMobileApp collection
func (r *IOSManagedAppProtectionAppsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedMobileApp, 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 []ManagedMobileApp
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 []ManagedMobileApp
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedMobileApp collection, max N pages
func (r *IOSManagedAppProtectionAppsCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedMobileApp, 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 ManagedMobileApp collection
func (r *IOSManagedAppProtectionAppsCollectionRequest) Get(ctx context.Context) ([]ManagedMobileApp, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedMobileApp collection
func (r *IOSManagedAppProtectionAppsCollectionRequest) Add(ctx context.Context, reqObj *ManagedMobileApp) (resObj *ManagedMobileApp, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// DeploymentSummary is navigation property
func (b *IOSManagedAppProtectionRequestBuilder) DeploymentSummary() *ManagedAppPolicyDeploymentSummaryRequestBuilder {
bb := &ManagedAppPolicyDeploymentSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/deploymentSummary"
return bb
}
// ManagedDeviceCertificateStates returns request builder for ManagedDeviceCertificateState collection
func (b *IOSPkcsCertificateProfileRequestBuilder) ManagedDeviceCertificateStates() *IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder {
bb := &IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/managedDeviceCertificateStates"
return bb
}
// IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder is request builder for ManagedDeviceCertificateState collection
type IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedDeviceCertificateState collection
func (b *IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder) Request() *IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequest {
return &IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedDeviceCertificateState item
func (b *IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder) ID(id string) *ManagedDeviceCertificateStateRequestBuilder {
bb := &ManagedDeviceCertificateStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequest is request for ManagedDeviceCertificateState collection
type IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedDeviceCertificateState collection
func (r *IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedDeviceCertificateState, 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 []ManagedDeviceCertificateState
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 []ManagedDeviceCertificateState
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedDeviceCertificateState collection, max N pages
func (r *IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedDeviceCertificateState, 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 ManagedDeviceCertificateState collection
func (r *IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceCertificateState, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedDeviceCertificateState collection
func (r *IOSPkcsCertificateProfileManagedDeviceCertificateStatesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceCertificateState) (resObj *ManagedDeviceCertificateState, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// ManagedDeviceCertificateStates returns request builder for ManagedDeviceCertificateState collection
func (b *IOSScepCertificateProfileRequestBuilder) ManagedDeviceCertificateStates() *IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder {
bb := &IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/managedDeviceCertificateStates"
return bb
}
// IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder is request builder for ManagedDeviceCertificateState collection
type IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for ManagedDeviceCertificateState collection
func (b *IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder) Request() *IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequest {
return &IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for ManagedDeviceCertificateState item
func (b *IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequestBuilder) ID(id string) *ManagedDeviceCertificateStateRequestBuilder {
bb := &ManagedDeviceCertificateStateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequest is request for ManagedDeviceCertificateState collection
type IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for ManagedDeviceCertificateState collection
func (r *IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]ManagedDeviceCertificateState, 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 []ManagedDeviceCertificateState
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 []ManagedDeviceCertificateState
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for ManagedDeviceCertificateState collection, max N pages
func (r *IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequest) GetN(ctx context.Context, n int) ([]ManagedDeviceCertificateState, 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 ManagedDeviceCertificateState collection
func (r *IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequest) Get(ctx context.Context) ([]ManagedDeviceCertificateState, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for ManagedDeviceCertificateState collection
func (r *IOSScepCertificateProfileManagedDeviceCertificateStatesCollectionRequest) Add(ctx context.Context, reqObj *ManagedDeviceCertificateState) (resObj *ManagedDeviceCertificateState, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// RootCertificate is navigation property
func (b *IOSScepCertificateProfileRequestBuilder) RootCertificate() *IOSTrustedRootCertificateRequestBuilder {
bb := &IOSTrustedRootCertificateRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/rootCertificate"
return bb
}
// DerivedCredentialSettings is navigation property
func (b *IOSVPNConfigurationRequestBuilder) DerivedCredentialSettings() *DeviceManagementDerivedCredentialSettingsRequestBuilder {
bb := &DeviceManagementDerivedCredentialSettingsRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/derivedCredentialSettings"
return bb
}
// IdentityCertificate is navigation property
func (b *IOSVPNConfigurationRequestBuilder) IdentityCertificate() *IOSCertificateProfileBaseRequestBuilder {
bb := &IOSCertificateProfileBaseRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/identityCertificate"
return bb
}
// AssignedLicenses returns request builder for IOSVPPAppAssignedLicense collection
func (b *IOSVPPAppRequestBuilder) AssignedLicenses() *IOSVPPAppAssignedLicensesCollectionRequestBuilder {
bb := &IOSVPPAppAssignedLicensesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/assignedLicenses"
return bb
}
// IOSVPPAppAssignedLicensesCollectionRequestBuilder is request builder for IOSVPPAppAssignedLicense collection
type IOSVPPAppAssignedLicensesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for IOSVPPAppAssignedLicense collection
func (b *IOSVPPAppAssignedLicensesCollectionRequestBuilder) Request() *IOSVPPAppAssignedLicensesCollectionRequest {
return &IOSVPPAppAssignedLicensesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for IOSVPPAppAssignedLicense item
func (b *IOSVPPAppAssignedLicensesCollectionRequestBuilder) ID(id string) *IOSVPPAppAssignedLicenseRequestBuilder {
bb := &IOSVPPAppAssignedLicenseRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// IOSVPPAppAssignedLicensesCollectionRequest is request for IOSVPPAppAssignedLicense collection
type IOSVPPAppAssignedLicensesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for IOSVPPAppAssignedLicense collection
func (r *IOSVPPAppAssignedLicensesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]IOSVPPAppAssignedLicense, 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 []IOSVPPAppAssignedLicense
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 []IOSVPPAppAssignedLicense
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for IOSVPPAppAssignedLicense collection, max N pages
func (r *IOSVPPAppAssignedLicensesCollectionRequest) GetN(ctx context.Context, n int) ([]IOSVPPAppAssignedLicense, 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 IOSVPPAppAssignedLicense collection
func (r *IOSVPPAppAssignedLicensesCollectionRequest) Get(ctx context.Context) ([]IOSVPPAppAssignedLicense, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for IOSVPPAppAssignedLicense collection
func (r *IOSVPPAppAssignedLicensesCollectionRequest) Add(ctx context.Context, reqObj *IOSVPPAppAssignedLicense) (resObj *IOSVPPAppAssignedLicense, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}