vendor: add github.com/Azure/azure-sdk-for-go and dependencies

This commit is contained in:
Nick Craig-Wood
2017-08-04 22:54:27 +01:00
parent 132f71d504
commit 91cfcc21ff
958 changed files with 320589 additions and 0 deletions
+875
View File
@@ -0,0 +1,875 @@
package intune
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
// AndroidClient is the microsoft.Intune Resource provider Api features in the
// swagger-2.0 specification
type AndroidClient struct {
ManagementClient
}
// NewAndroidClient creates an instance of the AndroidClient client.
func NewAndroidClient() AndroidClient {
return NewAndroidClientWithBaseURI(DefaultBaseURI)
}
// NewAndroidClientWithBaseURI creates an instance of the AndroidClient client.
func NewAndroidClientWithBaseURI(baseURI string) AndroidClient {
return AndroidClient{NewWithBaseURI(baseURI)}
}
// AddAppForMAMPolicy add app to an AndroidMAMPolicy.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy appName is application unique Name parameters is parameters
// supplied to the Create or update app to an android policy operation.
func (client AndroidClient) AddAppForMAMPolicy(hostName string, policyName string, appName string, parameters MAMPolicyAppIDOrGroupIDPayload) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.URL", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "intune.AndroidClient", "AddAppForMAMPolicy")
}
req, err := client.AddAppForMAMPolicyPreparer(hostName, policyName, appName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "AddAppForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.AddAppForMAMPolicySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "AddAppForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.AddAppForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "AddAppForMAMPolicy", resp, "Failure responding to request")
}
return
}
// AddAppForMAMPolicyPreparer prepares the AddAppForMAMPolicy request.
func (client AndroidClient) AddAppForMAMPolicyPreparer(hostName string, policyName string, appName string, parameters MAMPolicyAppIDOrGroupIDPayload) (*http.Request, error) {
pathParameters := map[string]interface{}{
"appName": autorest.Encode("path", appName),
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/apps/{appName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// AddAppForMAMPolicySender sends the AddAppForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) AddAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// AddAppForMAMPolicyResponder handles the response to the AddAppForMAMPolicy request. The method always
// closes the http.Response Body.
func (client AndroidClient) AddAppForMAMPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// AddGroupForMAMPolicy add group to an AndroidMAMPolicy.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy groupID is group Id parameters is parameters supplied to the
// Create or update app to an android policy operation.
func (client AndroidClient) AddGroupForMAMPolicy(hostName string, policyName string, groupID string, parameters MAMPolicyAppIDOrGroupIDPayload) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.URL", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "intune.AndroidClient", "AddGroupForMAMPolicy")
}
req, err := client.AddGroupForMAMPolicyPreparer(hostName, policyName, groupID, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "AddGroupForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.AddGroupForMAMPolicySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "AddGroupForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.AddGroupForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "AddGroupForMAMPolicy", resp, "Failure responding to request")
}
return
}
// AddGroupForMAMPolicyPreparer prepares the AddGroupForMAMPolicy request.
func (client AndroidClient) AddGroupForMAMPolicyPreparer(hostName string, policyName string, groupID string, parameters MAMPolicyAppIDOrGroupIDPayload) (*http.Request, error) {
pathParameters := map[string]interface{}{
"groupId": autorest.Encode("path", groupID),
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/groups/{groupId}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// AddGroupForMAMPolicySender sends the AddGroupForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) AddGroupForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// AddGroupForMAMPolicyResponder handles the response to the AddGroupForMAMPolicy request. The method always
// closes the http.Response Body.
func (client AndroidClient) AddGroupForMAMPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// CreateOrUpdateMAMPolicy creates or updates AndroidMAMPolicy.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy parameters is parameters supplied to the Create or update an
// android policy operation.
func (client AndroidClient) CreateOrUpdateMAMPolicy(hostName string, policyName string, parameters AndroidMAMPolicy) (result AndroidMAMPolicy, err error) {
req, err := client.CreateOrUpdateMAMPolicyPreparer(hostName, policyName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "CreateOrUpdateMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.CreateOrUpdateMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "CreateOrUpdateMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.CreateOrUpdateMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "CreateOrUpdateMAMPolicy", resp, "Failure responding to request")
}
return
}
// CreateOrUpdateMAMPolicyPreparer prepares the CreateOrUpdateMAMPolicy request.
func (client AndroidClient) CreateOrUpdateMAMPolicyPreparer(hostName string, policyName string, parameters AndroidMAMPolicy) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateMAMPolicySender sends the CreateOrUpdateMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) CreateOrUpdateMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// CreateOrUpdateMAMPolicyResponder handles the response to the CreateOrUpdateMAMPolicy request. The method always
// closes the http.Response Body.
func (client AndroidClient) CreateOrUpdateMAMPolicyResponder(resp *http.Response) (result AndroidMAMPolicy, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// DeleteAppForMAMPolicy delete App for Android Policy
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy appName is application unique Name
func (client AndroidClient) DeleteAppForMAMPolicy(hostName string, policyName string, appName string) (result autorest.Response, err error) {
req, err := client.DeleteAppForMAMPolicyPreparer(hostName, policyName, appName)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteAppForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.DeleteAppForMAMPolicySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteAppForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.DeleteAppForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteAppForMAMPolicy", resp, "Failure responding to request")
}
return
}
// DeleteAppForMAMPolicyPreparer prepares the DeleteAppForMAMPolicy request.
func (client AndroidClient) DeleteAppForMAMPolicyPreparer(hostName string, policyName string, appName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"appName": autorest.Encode("path", appName),
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/apps/{appName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteAppForMAMPolicySender sends the DeleteAppForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) DeleteAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DeleteAppForMAMPolicyResponder handles the response to the DeleteAppForMAMPolicy request. The method always
// closes the http.Response Body.
func (client AndroidClient) DeleteAppForMAMPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// DeleteGroupForMAMPolicy delete Group for Android Policy
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy groupID is application unique Name
func (client AndroidClient) DeleteGroupForMAMPolicy(hostName string, policyName string, groupID string) (result autorest.Response, err error) {
req, err := client.DeleteGroupForMAMPolicyPreparer(hostName, policyName, groupID)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteGroupForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.DeleteGroupForMAMPolicySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteGroupForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.DeleteGroupForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteGroupForMAMPolicy", resp, "Failure responding to request")
}
return
}
// DeleteGroupForMAMPolicyPreparer prepares the DeleteGroupForMAMPolicy request.
func (client AndroidClient) DeleteGroupForMAMPolicyPreparer(hostName string, policyName string, groupID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"groupId": autorest.Encode("path", groupID),
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/groups/{groupId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteGroupForMAMPolicySender sends the DeleteGroupForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) DeleteGroupForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DeleteGroupForMAMPolicyResponder handles the response to the DeleteGroupForMAMPolicy request. The method always
// closes the http.Response Body.
func (client AndroidClient) DeleteGroupForMAMPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// DeleteMAMPolicy delete Android Policy
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy
func (client AndroidClient) DeleteMAMPolicy(hostName string, policyName string) (result autorest.Response, err error) {
req, err := client.DeleteMAMPolicyPreparer(hostName, policyName)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.DeleteMAMPolicySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.DeleteMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteMAMPolicy", resp, "Failure responding to request")
}
return
}
// DeleteMAMPolicyPreparer prepares the DeleteMAMPolicy request.
func (client AndroidClient) DeleteMAMPolicyPreparer(hostName string, policyName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteMAMPolicySender sends the DeleteMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) DeleteMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DeleteMAMPolicyResponder handles the response to the DeleteMAMPolicy request. The method always
// closes the http.Response Body.
func (client AndroidClient) DeleteMAMPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// GetAppForMAMPolicy get apps for an AndroidMAMPolicy.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy filter is the filter to apply on the operation. selectParameter
// is select specific fields in entity.
func (client AndroidClient) GetAppForMAMPolicy(hostName string, policyName string, filter string, top *int32, selectParameter string) (result ApplicationCollection, err error) {
req, err := client.GetAppForMAMPolicyPreparer(hostName, policyName, filter, top, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.GetAppForMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.GetAppForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", resp, "Failure responding to request")
}
return
}
// GetAppForMAMPolicyPreparer prepares the GetAppForMAMPolicy request.
func (client AndroidClient) GetAppForMAMPolicyPreparer(hostName string, policyName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/AndroidPolicies/{policyName}/apps", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetAppForMAMPolicySender sends the GetAppForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) GetAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetAppForMAMPolicyResponder handles the response to the GetAppForMAMPolicy request. The method always
// closes the http.Response Body.
func (client AndroidClient) GetAppForMAMPolicyResponder(resp *http.Response) (result ApplicationCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetAppForMAMPolicyNextResults retrieves the next set of results, if any.
func (client AndroidClient) GetAppForMAMPolicyNextResults(lastResults ApplicationCollection) (result ApplicationCollection, err error) {
req, err := lastResults.ApplicationCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetAppForMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", resp, "Failure sending next results request")
}
result, err = client.GetAppForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", resp, "Failure responding to next results request")
}
return
}
// GetGroupsForMAMPolicy returns groups for a given AndroidMAMPolicy.
//
// hostName is location hostName for the tenant policyName is policy name for
// the tenant
func (client AndroidClient) GetGroupsForMAMPolicy(hostName string, policyName string) (result GroupsCollection, err error) {
req, err := client.GetGroupsForMAMPolicyPreparer(hostName, policyName)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.GetGroupsForMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.GetGroupsForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", resp, "Failure responding to request")
}
return
}
// GetGroupsForMAMPolicyPreparer prepares the GetGroupsForMAMPolicy request.
func (client AndroidClient) GetGroupsForMAMPolicyPreparer(hostName string, policyName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/groups", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetGroupsForMAMPolicySender sends the GetGroupsForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) GetGroupsForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetGroupsForMAMPolicyResponder handles the response to the GetGroupsForMAMPolicy request. The method always
// closes the http.Response Body.
func (client AndroidClient) GetGroupsForMAMPolicyResponder(resp *http.Response) (result GroupsCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetGroupsForMAMPolicyNextResults retrieves the next set of results, if any.
func (client AndroidClient) GetGroupsForMAMPolicyNextResults(lastResults GroupsCollection) (result GroupsCollection, err error) {
req, err := lastResults.GroupsCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetGroupsForMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", resp, "Failure sending next results request")
}
result, err = client.GetGroupsForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", resp, "Failure responding to next results request")
}
return
}
// GetMAMPolicies returns Intune Android policies.
//
// hostName is location hostName for the tenant filter is the filter to apply
// on the operation. selectParameter is select specific fields in entity.
func (client AndroidClient) GetMAMPolicies(hostName string, filter string, top *int32, selectParameter string) (result AndroidMAMPolicyCollection, err error) {
req, err := client.GetMAMPoliciesPreparer(hostName, filter, top, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", nil, "Failure preparing request")
return
}
resp, err := client.GetMAMPoliciesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", resp, "Failure sending request")
return
}
result, err = client.GetMAMPoliciesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", resp, "Failure responding to request")
}
return
}
// GetMAMPoliciesPreparer prepares the GetMAMPolicies request.
func (client AndroidClient) GetMAMPoliciesPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetMAMPoliciesSender sends the GetMAMPolicies request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) GetMAMPoliciesSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetMAMPoliciesResponder handles the response to the GetMAMPolicies request. The method always
// closes the http.Response Body.
func (client AndroidClient) GetMAMPoliciesResponder(resp *http.Response) (result AndroidMAMPolicyCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetMAMPoliciesNextResults retrieves the next set of results, if any.
func (client AndroidClient) GetMAMPoliciesNextResults(lastResults AndroidMAMPolicyCollection) (result AndroidMAMPolicyCollection, err error) {
req, err := lastResults.AndroidMAMPolicyCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetMAMPoliciesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", resp, "Failure sending next results request")
}
result, err = client.GetMAMPoliciesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", resp, "Failure responding to next results request")
}
return
}
// GetMAMPolicyByName returns AndroidMAMPolicy with given name.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy selectParameter is select specific fields in entity.
func (client AndroidClient) GetMAMPolicyByName(hostName string, policyName string, selectParameter string) (result AndroidMAMPolicy, err error) {
req, err := client.GetMAMPolicyByNamePreparer(hostName, policyName, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicyByName", nil, "Failure preparing request")
return
}
resp, err := client.GetMAMPolicyByNameSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicyByName", resp, "Failure sending request")
return
}
result, err = client.GetMAMPolicyByNameResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicyByName", resp, "Failure responding to request")
}
return
}
// GetMAMPolicyByNamePreparer prepares the GetMAMPolicyByName request.
func (client AndroidClient) GetMAMPolicyByNamePreparer(hostName string, policyName string, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetMAMPolicyByNameSender sends the GetMAMPolicyByName request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) GetMAMPolicyByNameSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetMAMPolicyByNameResponder handles the response to the GetMAMPolicyByName request. The method always
// closes the http.Response Body.
func (client AndroidClient) GetMAMPolicyByNameResponder(resp *http.Response) (result AndroidMAMPolicy, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// PatchMAMPolicy patch AndroidMAMPolicy.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy parameters is parameters supplied to the Create or update an
// android policy operation.
func (client AndroidClient) PatchMAMPolicy(hostName string, policyName string, parameters AndroidMAMPolicy) (result AndroidMAMPolicy, err error) {
req, err := client.PatchMAMPolicyPreparer(hostName, policyName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "PatchMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.PatchMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "PatchMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.PatchMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.AndroidClient", "PatchMAMPolicy", resp, "Failure responding to request")
}
return
}
// PatchMAMPolicyPreparer prepares the PatchMAMPolicy request.
func (client AndroidClient) PatchMAMPolicyPreparer(hostName string, policyName string, parameters AndroidMAMPolicy) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// PatchMAMPolicySender sends the PatchMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client AndroidClient) PatchMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// PatchMAMPolicyResponder handles the response to the PatchMAMPolicy request. The method always
// closes the http.Response Body.
func (client AndroidClient) PatchMAMPolicyResponder(resp *http.Response) (result AndroidMAMPolicy, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+973
View File
@@ -0,0 +1,973 @@
// Package intune implements the Azure ARM Intune service API version
// 2015-01-14-preview.
//
// Microsoft.Intune Resource provider Api features in the swagger-2.0
// specification
package intune
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
const (
// DefaultBaseURI is the default URI used for the service Intune
DefaultBaseURI = "https://management.azure.com"
)
// ManagementClient is the base client for Intune.
type ManagementClient struct {
autorest.Client
BaseURI string
}
// New creates an instance of the ManagementClient client.
func New() ManagementClient {
return NewWithBaseURI(DefaultBaseURI)
}
// NewWithBaseURI creates an instance of the ManagementClient client.
func NewWithBaseURI(baseURI string) ManagementClient {
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
}
}
// GetApps returns Intune Manageable apps.
//
// hostName is location hostName for the tenant filter is the filter to apply
// on the operation. selectParameter is select specific fields in entity.
func (client ManagementClient) GetApps(hostName string, filter string, top *int32, selectParameter string) (result ApplicationCollection, err error) {
req, err := client.GetAppsPreparer(hostName, filter, top, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", nil, "Failure preparing request")
return
}
resp, err := client.GetAppsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", resp, "Failure sending request")
return
}
result, err = client.GetAppsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", resp, "Failure responding to request")
}
return
}
// GetAppsPreparer prepares the GetApps request.
func (client ManagementClient) GetAppsPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/apps", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetAppsSender sends the GetApps request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetAppsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetAppsResponder handles the response to the GetApps request. The method always
// closes the http.Response Body.
func (client ManagementClient) GetAppsResponder(resp *http.Response) (result ApplicationCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetAppsNextResults retrieves the next set of results, if any.
func (client ManagementClient) GetAppsNextResults(lastResults ApplicationCollection) (result ApplicationCollection, err error) {
req, err := lastResults.ApplicationCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetAppsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", resp, "Failure sending next results request")
}
result, err = client.GetAppsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", resp, "Failure responding to next results request")
}
return
}
// GetLocationByHostName returns location for given tenant.
func (client ManagementClient) GetLocationByHostName() (result Location, err error) {
req, err := client.GetLocationByHostNamePreparer()
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocationByHostName", nil, "Failure preparing request")
return
}
resp, err := client.GetLocationByHostNameSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocationByHostName", resp, "Failure sending request")
return
}
result, err = client.GetLocationByHostNameResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocationByHostName", resp, "Failure responding to request")
}
return
}
// GetLocationByHostNamePreparer prepares the GetLocationByHostName request.
func (client ManagementClient) GetLocationByHostNamePreparer() (*http.Request, error) {
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Intune/locations/hostName"),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetLocationByHostNameSender sends the GetLocationByHostName request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetLocationByHostNameSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetLocationByHostNameResponder handles the response to the GetLocationByHostName request. The method always
// closes the http.Response Body.
func (client ManagementClient) GetLocationByHostNameResponder(resp *http.Response) (result Location, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetLocations returns location for user tenant.
func (client ManagementClient) GetLocations() (result LocationCollection, err error) {
req, err := client.GetLocationsPreparer()
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", nil, "Failure preparing request")
return
}
resp, err := client.GetLocationsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", resp, "Failure sending request")
return
}
result, err = client.GetLocationsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", resp, "Failure responding to request")
}
return
}
// GetLocationsPreparer prepares the GetLocations request.
func (client ManagementClient) GetLocationsPreparer() (*http.Request, error) {
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Intune/locations"),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetLocationsSender sends the GetLocations request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetLocationsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetLocationsResponder handles the response to the GetLocations request. The method always
// closes the http.Response Body.
func (client ManagementClient) GetLocationsResponder(resp *http.Response) (result LocationCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetLocationsNextResults retrieves the next set of results, if any.
func (client ManagementClient) GetLocationsNextResults(lastResults LocationCollection) (result LocationCollection, err error) {
req, err := lastResults.LocationCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetLocationsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", resp, "Failure sending next results request")
}
result, err = client.GetLocationsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", resp, "Failure responding to next results request")
}
return
}
// GetMAMFlaggedUserByName returns Intune flagged user details
//
// hostName is location hostName for the tenant userName is flagged userName
// selectParameter is select specific fields in entity.
func (client ManagementClient) GetMAMFlaggedUserByName(hostName string, userName string, selectParameter string) (result FlaggedUser, err error) {
req, err := client.GetMAMFlaggedUserByNamePreparer(hostName, userName, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUserByName", nil, "Failure preparing request")
return
}
resp, err := client.GetMAMFlaggedUserByNameSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUserByName", resp, "Failure sending request")
return
}
result, err = client.GetMAMFlaggedUserByNameResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUserByName", resp, "Failure responding to request")
}
return
}
// GetMAMFlaggedUserByNamePreparer prepares the GetMAMFlaggedUserByName request.
func (client ManagementClient) GetMAMFlaggedUserByNamePreparer(hostName string, userName string, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"userName": autorest.Encode("path", userName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/flaggedUsers/{userName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetMAMFlaggedUserByNameSender sends the GetMAMFlaggedUserByName request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetMAMFlaggedUserByNameSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetMAMFlaggedUserByNameResponder handles the response to the GetMAMFlaggedUserByName request. The method always
// closes the http.Response Body.
func (client ManagementClient) GetMAMFlaggedUserByNameResponder(resp *http.Response) (result FlaggedUser, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetMAMFlaggedUsers returns Intune flagged user collection
//
// hostName is location hostName for the tenant filter is the filter to apply
// on the operation. selectParameter is select specific fields in entity.
func (client ManagementClient) GetMAMFlaggedUsers(hostName string, filter string, top *int32, selectParameter string) (result FlaggedUserCollection, err error) {
req, err := client.GetMAMFlaggedUsersPreparer(hostName, filter, top, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", nil, "Failure preparing request")
return
}
resp, err := client.GetMAMFlaggedUsersSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", resp, "Failure sending request")
return
}
result, err = client.GetMAMFlaggedUsersResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", resp, "Failure responding to request")
}
return
}
// GetMAMFlaggedUsersPreparer prepares the GetMAMFlaggedUsers request.
func (client ManagementClient) GetMAMFlaggedUsersPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/flaggedUsers", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetMAMFlaggedUsersSender sends the GetMAMFlaggedUsers request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetMAMFlaggedUsersSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetMAMFlaggedUsersResponder handles the response to the GetMAMFlaggedUsers request. The method always
// closes the http.Response Body.
func (client ManagementClient) GetMAMFlaggedUsersResponder(resp *http.Response) (result FlaggedUserCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetMAMFlaggedUsersNextResults retrieves the next set of results, if any.
func (client ManagementClient) GetMAMFlaggedUsersNextResults(lastResults FlaggedUserCollection) (result FlaggedUserCollection, err error) {
req, err := lastResults.FlaggedUserCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetMAMFlaggedUsersSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", resp, "Failure sending next results request")
}
result, err = client.GetMAMFlaggedUsersResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", resp, "Failure responding to next results request")
}
return
}
// GetMAMStatuses returns Intune Tenant level statuses.
//
// hostName is location hostName for the tenant
func (client ManagementClient) GetMAMStatuses(hostName string) (result StatusesDefault, err error) {
req, err := client.GetMAMStatusesPreparer(hostName)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", nil, "Failure preparing request")
return
}
resp, err := client.GetMAMStatusesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", resp, "Failure sending request")
return
}
result, err = client.GetMAMStatusesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", resp, "Failure responding to request")
}
return
}
// GetMAMStatusesPreparer prepares the GetMAMStatuses request.
func (client ManagementClient) GetMAMStatusesPreparer(hostName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/statuses/default", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetMAMStatusesSender sends the GetMAMStatuses request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetMAMStatusesSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetMAMStatusesResponder handles the response to the GetMAMStatuses request. The method always
// closes the http.Response Body.
func (client ManagementClient) GetMAMStatusesResponder(resp *http.Response) (result StatusesDefault, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetMAMStatusesNextResults retrieves the next set of results, if any.
func (client ManagementClient) GetMAMStatusesNextResults(lastResults StatusesDefault) (result StatusesDefault, err error) {
req, err := lastResults.StatusesDefaultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetMAMStatusesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", resp, "Failure sending next results request")
}
result, err = client.GetMAMStatusesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", resp, "Failure responding to next results request")
}
return
}
// GetMAMUserDeviceByDeviceName get a unique device for a user.
//
// hostName is location hostName for the tenant userName is unique user name
// deviceName is device name selectParameter is select specific fields in
// entity.
func (client ManagementClient) GetMAMUserDeviceByDeviceName(hostName string, userName string, deviceName string, selectParameter string) (result Device, err error) {
req, err := client.GetMAMUserDeviceByDeviceNamePreparer(hostName, userName, deviceName, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDeviceByDeviceName", nil, "Failure preparing request")
return
}
resp, err := client.GetMAMUserDeviceByDeviceNameSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDeviceByDeviceName", resp, "Failure sending request")
return
}
result, err = client.GetMAMUserDeviceByDeviceNameResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDeviceByDeviceName", resp, "Failure responding to request")
}
return
}
// GetMAMUserDeviceByDeviceNamePreparer prepares the GetMAMUserDeviceByDeviceName request.
func (client ManagementClient) GetMAMUserDeviceByDeviceNamePreparer(hostName string, userName string, deviceName string, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deviceName": autorest.Encode("path", deviceName),
"hostName": autorest.Encode("path", hostName),
"userName": autorest.Encode("path", userName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/users/{userName}/devices/{deviceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetMAMUserDeviceByDeviceNameSender sends the GetMAMUserDeviceByDeviceName request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetMAMUserDeviceByDeviceNameSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetMAMUserDeviceByDeviceNameResponder handles the response to the GetMAMUserDeviceByDeviceName request. The method always
// closes the http.Response Body.
func (client ManagementClient) GetMAMUserDeviceByDeviceNameResponder(resp *http.Response) (result Device, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetMAMUserDevices get devices for a user.
//
// hostName is location hostName for the tenant userName is user unique Name
// filter is the filter to apply on the operation. selectParameter is select
// specific fields in entity.
func (client ManagementClient) GetMAMUserDevices(hostName string, userName string, filter string, top *int32, selectParameter string) (result DeviceCollection, err error) {
req, err := client.GetMAMUserDevicesPreparer(hostName, userName, filter, top, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", nil, "Failure preparing request")
return
}
resp, err := client.GetMAMUserDevicesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", resp, "Failure sending request")
return
}
result, err = client.GetMAMUserDevicesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", resp, "Failure responding to request")
}
return
}
// GetMAMUserDevicesPreparer prepares the GetMAMUserDevices request.
func (client ManagementClient) GetMAMUserDevicesPreparer(hostName string, userName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"userName": autorest.Encode("path", userName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/users/{userName}/devices", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetMAMUserDevicesSender sends the GetMAMUserDevices request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetMAMUserDevicesSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetMAMUserDevicesResponder handles the response to the GetMAMUserDevices request. The method always
// closes the http.Response Body.
func (client ManagementClient) GetMAMUserDevicesResponder(resp *http.Response) (result DeviceCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetMAMUserDevicesNextResults retrieves the next set of results, if any.
func (client ManagementClient) GetMAMUserDevicesNextResults(lastResults DeviceCollection) (result DeviceCollection, err error) {
req, err := lastResults.DeviceCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetMAMUserDevicesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", resp, "Failure sending next results request")
}
result, err = client.GetMAMUserDevicesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", resp, "Failure responding to next results request")
}
return
}
// GetMAMUserFlaggedEnrolledApps returns Intune flagged enrolled app collection
// for the User
//
// hostName is location hostName for the tenant userName is user name for the
// tenant filter is the filter to apply on the operation. selectParameter is
// select specific fields in entity.
func (client ManagementClient) GetMAMUserFlaggedEnrolledApps(hostName string, userName string, filter string, top *int32, selectParameter string) (result FlaggedEnrolledAppCollection, err error) {
req, err := client.GetMAMUserFlaggedEnrolledAppsPreparer(hostName, userName, filter, top, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", nil, "Failure preparing request")
return
}
resp, err := client.GetMAMUserFlaggedEnrolledAppsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", resp, "Failure sending request")
return
}
result, err = client.GetMAMUserFlaggedEnrolledAppsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", resp, "Failure responding to request")
}
return
}
// GetMAMUserFlaggedEnrolledAppsPreparer prepares the GetMAMUserFlaggedEnrolledApps request.
func (client ManagementClient) GetMAMUserFlaggedEnrolledAppsPreparer(hostName string, userName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"userName": autorest.Encode("path", userName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/flaggedUsers/{userName}/flaggedEnrolledApps", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetMAMUserFlaggedEnrolledAppsSender sends the GetMAMUserFlaggedEnrolledApps request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetMAMUserFlaggedEnrolledAppsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetMAMUserFlaggedEnrolledAppsResponder handles the response to the GetMAMUserFlaggedEnrolledApps request. The method always
// closes the http.Response Body.
func (client ManagementClient) GetMAMUserFlaggedEnrolledAppsResponder(resp *http.Response) (result FlaggedEnrolledAppCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetMAMUserFlaggedEnrolledAppsNextResults retrieves the next set of results, if any.
func (client ManagementClient) GetMAMUserFlaggedEnrolledAppsNextResults(lastResults FlaggedEnrolledAppCollection) (result FlaggedEnrolledAppCollection, err error) {
req, err := lastResults.FlaggedEnrolledAppCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetMAMUserFlaggedEnrolledAppsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", resp, "Failure sending next results request")
}
result, err = client.GetMAMUserFlaggedEnrolledAppsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", resp, "Failure responding to next results request")
}
return
}
// GetOperationResults returns operationResults.
//
// hostName is location hostName for the tenant filter is the filter to apply
// on the operation. selectParameter is select specific fields in entity.
func (client ManagementClient) GetOperationResults(hostName string, filter string, top *int32, selectParameter string) (result OperationResultCollection, err error) {
req, err := client.GetOperationResultsPreparer(hostName, filter, top, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", nil, "Failure preparing request")
return
}
resp, err := client.GetOperationResultsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", resp, "Failure sending request")
return
}
result, err = client.GetOperationResultsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", resp, "Failure responding to request")
}
return
}
// GetOperationResultsPreparer prepares the GetOperationResults request.
func (client ManagementClient) GetOperationResultsPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/operationResults", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetOperationResultsSender sends the GetOperationResults request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetOperationResultsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetOperationResultsResponder handles the response to the GetOperationResults request. The method always
// closes the http.Response Body.
func (client ManagementClient) GetOperationResultsResponder(resp *http.Response) (result OperationResultCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetOperationResultsNextResults retrieves the next set of results, if any.
func (client ManagementClient) GetOperationResultsNextResults(lastResults OperationResultCollection) (result OperationResultCollection, err error) {
req, err := lastResults.OperationResultCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetOperationResultsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", resp, "Failure sending next results request")
}
result, err = client.GetOperationResultsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", resp, "Failure responding to next results request")
}
return
}
// WipeMAMUserDevice wipe a device for a user.
//
// hostName is location hostName for the tenant userName is unique user name
// deviceName is device name
func (client ManagementClient) WipeMAMUserDevice(hostName string, userName string, deviceName string) (result WipeDeviceOperationResult, err error) {
req, err := client.WipeMAMUserDevicePreparer(hostName, userName, deviceName)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "WipeMAMUserDevice", nil, "Failure preparing request")
return
}
resp, err := client.WipeMAMUserDeviceSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "WipeMAMUserDevice", resp, "Failure sending request")
return
}
result, err = client.WipeMAMUserDeviceResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.ManagementClient", "WipeMAMUserDevice", resp, "Failure responding to request")
}
return
}
// WipeMAMUserDevicePreparer prepares the WipeMAMUserDevice request.
func (client ManagementClient) WipeMAMUserDevicePreparer(hostName string, userName string, deviceName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deviceName": autorest.Encode("path", deviceName),
"hostName": autorest.Encode("path", hostName),
"userName": autorest.Encode("path", userName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/users/{userName}/devices/{deviceName}/wipe", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// WipeMAMUserDeviceSender sends the WipeMAMUserDevice request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) WipeMAMUserDeviceSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// WipeMAMUserDeviceResponder handles the response to the WipeMAMUserDevice request. The method always
// closes the http.Response Body.
func (client ManagementClient) WipeMAMUserDeviceResponder(resp *http.Response) (result WipeDeviceOperationResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+875
View File
@@ -0,0 +1,875 @@
package intune
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
// IosClient is the microsoft.Intune Resource provider Api features in the
// swagger-2.0 specification
type IosClient struct {
ManagementClient
}
// NewIosClient creates an instance of the IosClient client.
func NewIosClient() IosClient {
return NewIosClientWithBaseURI(DefaultBaseURI)
}
// NewIosClientWithBaseURI creates an instance of the IosClient client.
func NewIosClientWithBaseURI(baseURI string) IosClient {
return IosClient{NewWithBaseURI(baseURI)}
}
// AddAppForMAMPolicy add app to an iOSMAMPolicy.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy appName is application unique Name parameters is parameters
// supplied to add an app to an ios policy.
func (client IosClient) AddAppForMAMPolicy(hostName string, policyName string, appName string, parameters MAMPolicyAppIDOrGroupIDPayload) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.URL", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "intune.IosClient", "AddAppForMAMPolicy")
}
req, err := client.AddAppForMAMPolicyPreparer(hostName, policyName, appName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "AddAppForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.AddAppForMAMPolicySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "intune.IosClient", "AddAppForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.AddAppForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "AddAppForMAMPolicy", resp, "Failure responding to request")
}
return
}
// AddAppForMAMPolicyPreparer prepares the AddAppForMAMPolicy request.
func (client IosClient) AddAppForMAMPolicyPreparer(hostName string, policyName string, appName string, parameters MAMPolicyAppIDOrGroupIDPayload) (*http.Request, error) {
pathParameters := map[string]interface{}{
"appName": autorest.Encode("path", appName),
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/apps/{appName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// AddAppForMAMPolicySender sends the AddAppForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) AddAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// AddAppForMAMPolicyResponder handles the response to the AddAppForMAMPolicy request. The method always
// closes the http.Response Body.
func (client IosClient) AddAppForMAMPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// AddGroupForMAMPolicy add group to an iOSMAMPolicy.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy groupID is group Id parameters is parameters supplied to the
// Create or update app to an android policy operation.
func (client IosClient) AddGroupForMAMPolicy(hostName string, policyName string, groupID string, parameters MAMPolicyAppIDOrGroupIDPayload) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.URL", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "intune.IosClient", "AddGroupForMAMPolicy")
}
req, err := client.AddGroupForMAMPolicyPreparer(hostName, policyName, groupID, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "AddGroupForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.AddGroupForMAMPolicySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "intune.IosClient", "AddGroupForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.AddGroupForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "AddGroupForMAMPolicy", resp, "Failure responding to request")
}
return
}
// AddGroupForMAMPolicyPreparer prepares the AddGroupForMAMPolicy request.
func (client IosClient) AddGroupForMAMPolicyPreparer(hostName string, policyName string, groupID string, parameters MAMPolicyAppIDOrGroupIDPayload) (*http.Request, error) {
pathParameters := map[string]interface{}{
"groupId": autorest.Encode("path", groupID),
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/groups/{groupId}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// AddGroupForMAMPolicySender sends the AddGroupForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) AddGroupForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// AddGroupForMAMPolicyResponder handles the response to the AddGroupForMAMPolicy request. The method always
// closes the http.Response Body.
func (client IosClient) AddGroupForMAMPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// CreateOrUpdateMAMPolicy creates or updates iOSMAMPolicy.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy parameters is parameters supplied to the Create or update an
// android policy operation.
func (client IosClient) CreateOrUpdateMAMPolicy(hostName string, policyName string, parameters IOSMAMPolicy) (result IOSMAMPolicy, err error) {
req, err := client.CreateOrUpdateMAMPolicyPreparer(hostName, policyName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "CreateOrUpdateMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.CreateOrUpdateMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.IosClient", "CreateOrUpdateMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.CreateOrUpdateMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "CreateOrUpdateMAMPolicy", resp, "Failure responding to request")
}
return
}
// CreateOrUpdateMAMPolicyPreparer prepares the CreateOrUpdateMAMPolicy request.
func (client IosClient) CreateOrUpdateMAMPolicyPreparer(hostName string, policyName string, parameters IOSMAMPolicy) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateMAMPolicySender sends the CreateOrUpdateMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) CreateOrUpdateMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// CreateOrUpdateMAMPolicyResponder handles the response to the CreateOrUpdateMAMPolicy request. The method always
// closes the http.Response Body.
func (client IosClient) CreateOrUpdateMAMPolicyResponder(resp *http.Response) (result IOSMAMPolicy, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// DeleteAppForMAMPolicy delete App for Ios Policy
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy appName is application unique Name
func (client IosClient) DeleteAppForMAMPolicy(hostName string, policyName string, appName string) (result autorest.Response, err error) {
req, err := client.DeleteAppForMAMPolicyPreparer(hostName, policyName, appName)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteAppForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.DeleteAppForMAMPolicySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteAppForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.DeleteAppForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteAppForMAMPolicy", resp, "Failure responding to request")
}
return
}
// DeleteAppForMAMPolicyPreparer prepares the DeleteAppForMAMPolicy request.
func (client IosClient) DeleteAppForMAMPolicyPreparer(hostName string, policyName string, appName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"appName": autorest.Encode("path", appName),
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/apps/{appName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteAppForMAMPolicySender sends the DeleteAppForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) DeleteAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DeleteAppForMAMPolicyResponder handles the response to the DeleteAppForMAMPolicy request. The method always
// closes the http.Response Body.
func (client IosClient) DeleteAppForMAMPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// DeleteGroupForMAMPolicy delete Group for iOS Policy
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy groupID is application unique Name
func (client IosClient) DeleteGroupForMAMPolicy(hostName string, policyName string, groupID string) (result autorest.Response, err error) {
req, err := client.DeleteGroupForMAMPolicyPreparer(hostName, policyName, groupID)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteGroupForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.DeleteGroupForMAMPolicySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteGroupForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.DeleteGroupForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteGroupForMAMPolicy", resp, "Failure responding to request")
}
return
}
// DeleteGroupForMAMPolicyPreparer prepares the DeleteGroupForMAMPolicy request.
func (client IosClient) DeleteGroupForMAMPolicyPreparer(hostName string, policyName string, groupID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"groupId": autorest.Encode("path", groupID),
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/groups/{groupId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteGroupForMAMPolicySender sends the DeleteGroupForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) DeleteGroupForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DeleteGroupForMAMPolicyResponder handles the response to the DeleteGroupForMAMPolicy request. The method always
// closes the http.Response Body.
func (client IosClient) DeleteGroupForMAMPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// DeleteMAMPolicy delete Ios Policy
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy
func (client IosClient) DeleteMAMPolicy(hostName string, policyName string) (result autorest.Response, err error) {
req, err := client.DeleteMAMPolicyPreparer(hostName, policyName)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.DeleteMAMPolicySender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.DeleteMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteMAMPolicy", resp, "Failure responding to request")
}
return
}
// DeleteMAMPolicyPreparer prepares the DeleteMAMPolicy request.
func (client IosClient) DeleteMAMPolicyPreparer(hostName string, policyName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteMAMPolicySender sends the DeleteMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) DeleteMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DeleteMAMPolicyResponder handles the response to the DeleteMAMPolicy request. The method always
// closes the http.Response Body.
func (client IosClient) DeleteMAMPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// GetAppForMAMPolicy get apps for an iOSMAMPolicy.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy filter is the filter to apply on the operation. selectParameter
// is select specific fields in entity.
func (client IosClient) GetAppForMAMPolicy(hostName string, policyName string, filter string, top *int32, selectParameter string) (result ApplicationCollection, err error) {
req, err := client.GetAppForMAMPolicyPreparer(hostName, policyName, filter, top, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.GetAppForMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.GetAppForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", resp, "Failure responding to request")
}
return
}
// GetAppForMAMPolicyPreparer prepares the GetAppForMAMPolicy request.
func (client IosClient) GetAppForMAMPolicyPreparer(hostName string, policyName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/apps", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetAppForMAMPolicySender sends the GetAppForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) GetAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetAppForMAMPolicyResponder handles the response to the GetAppForMAMPolicy request. The method always
// closes the http.Response Body.
func (client IosClient) GetAppForMAMPolicyResponder(resp *http.Response) (result ApplicationCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetAppForMAMPolicyNextResults retrieves the next set of results, if any.
func (client IosClient) GetAppForMAMPolicyNextResults(lastResults ApplicationCollection) (result ApplicationCollection, err error) {
req, err := lastResults.ApplicationCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetAppForMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", resp, "Failure sending next results request")
}
result, err = client.GetAppForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", resp, "Failure responding to next results request")
}
return
}
// GetGroupsForMAMPolicy returns groups for a given iOSMAMPolicy.
//
// hostName is location hostName for the tenant policyName is policy name for
// the tenant
func (client IosClient) GetGroupsForMAMPolicy(hostName string, policyName string) (result GroupsCollection, err error) {
req, err := client.GetGroupsForMAMPolicyPreparer(hostName, policyName)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.GetGroupsForMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.GetGroupsForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", resp, "Failure responding to request")
}
return
}
// GetGroupsForMAMPolicyPreparer prepares the GetGroupsForMAMPolicy request.
func (client IosClient) GetGroupsForMAMPolicyPreparer(hostName string, policyName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/groups", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetGroupsForMAMPolicySender sends the GetGroupsForMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) GetGroupsForMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetGroupsForMAMPolicyResponder handles the response to the GetGroupsForMAMPolicy request. The method always
// closes the http.Response Body.
func (client IosClient) GetGroupsForMAMPolicyResponder(resp *http.Response) (result GroupsCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetGroupsForMAMPolicyNextResults retrieves the next set of results, if any.
func (client IosClient) GetGroupsForMAMPolicyNextResults(lastResults GroupsCollection) (result GroupsCollection, err error) {
req, err := lastResults.GroupsCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetGroupsForMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", resp, "Failure sending next results request")
}
result, err = client.GetGroupsForMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", resp, "Failure responding to next results request")
}
return
}
// GetMAMPolicies returns Intune iOSPolicies.
//
// hostName is location hostName for the tenant filter is the filter to apply
// on the operation. selectParameter is select specific fields in entity.
func (client IosClient) GetMAMPolicies(hostName string, filter string, top *int32, selectParameter string) (result IOSMAMPolicyCollection, err error) {
req, err := client.GetMAMPoliciesPreparer(hostName, filter, top, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", nil, "Failure preparing request")
return
}
resp, err := client.GetMAMPoliciesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", resp, "Failure sending request")
return
}
result, err = client.GetMAMPoliciesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", resp, "Failure responding to request")
}
return
}
// GetMAMPoliciesPreparer prepares the GetMAMPolicies request.
func (client IosClient) GetMAMPoliciesPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetMAMPoliciesSender sends the GetMAMPolicies request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) GetMAMPoliciesSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetMAMPoliciesResponder handles the response to the GetMAMPolicies request. The method always
// closes the http.Response Body.
func (client IosClient) GetMAMPoliciesResponder(resp *http.Response) (result IOSMAMPolicyCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetMAMPoliciesNextResults retrieves the next set of results, if any.
func (client IosClient) GetMAMPoliciesNextResults(lastResults IOSMAMPolicyCollection) (result IOSMAMPolicyCollection, err error) {
req, err := lastResults.IOSMAMPolicyCollectionPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.GetMAMPoliciesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", resp, "Failure sending next results request")
}
result, err = client.GetMAMPoliciesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", resp, "Failure responding to next results request")
}
return
}
// GetMAMPolicyByName returns Intune iOS policies.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy selectParameter is select specific fields in entity.
func (client IosClient) GetMAMPolicyByName(hostName string, policyName string, selectParameter string) (result IOSMAMPolicy, err error) {
req, err := client.GetMAMPolicyByNamePreparer(hostName, policyName, selectParameter)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicyByName", nil, "Failure preparing request")
return
}
resp, err := client.GetMAMPolicyByNameSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicyByName", resp, "Failure sending request")
return
}
result, err = client.GetMAMPolicyByNameResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicyByName", resp, "Failure responding to request")
}
return
}
// GetMAMPolicyByNamePreparer prepares the GetMAMPolicyByName request.
func (client IosClient) GetMAMPolicyByNamePreparer(hostName string, policyName string, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetMAMPolicyByNameSender sends the GetMAMPolicyByName request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) GetMAMPolicyByNameSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetMAMPolicyByNameResponder handles the response to the GetMAMPolicyByName request. The method always
// closes the http.Response Body.
func (client IosClient) GetMAMPolicyByNameResponder(resp *http.Response) (result IOSMAMPolicy, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// PatchMAMPolicy patch an iOSMAMPolicy.
//
// hostName is location hostName for the tenant policyName is unique name for
// the policy parameters is parameters supplied to the Create or update an
// android policy operation.
func (client IosClient) PatchMAMPolicy(hostName string, policyName string, parameters IOSMAMPolicy) (result IOSMAMPolicy, err error) {
req, err := client.PatchMAMPolicyPreparer(hostName, policyName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "PatchMAMPolicy", nil, "Failure preparing request")
return
}
resp, err := client.PatchMAMPolicySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "intune.IosClient", "PatchMAMPolicy", resp, "Failure sending request")
return
}
result, err = client.PatchMAMPolicyResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "intune.IosClient", "PatchMAMPolicy", resp, "Failure responding to request")
}
return
}
// PatchMAMPolicyPreparer prepares the PatchMAMPolicy request.
func (client IosClient) PatchMAMPolicyPreparer(hostName string, policyName string, parameters IOSMAMPolicy) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
"policyName": autorest.Encode("path", policyName),
}
const APIVersion = "2015-01-14-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// PatchMAMPolicySender sends the PatchMAMPolicy request. The method will close the
// http.Response Body if it receives an error.
func (client IosClient) PatchMAMPolicySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// PatchMAMPolicyResponder handles the response to the PatchMAMPolicy request. The method always
// closes the http.Response Body.
func (client IosClient) PatchMAMPolicyResponder(resp *http.Response) (result IOSMAMPolicy, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+690
View File
@@ -0,0 +1,690 @@
package intune
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"net/http"
)
// AppSharingFromLevel enumerates the values for app sharing from level.
type AppSharingFromLevel string
const (
// AllApps specifies the all apps state for app sharing from level.
AllApps AppSharingFromLevel = "allApps"
// None specifies the none state for app sharing from level.
None AppSharingFromLevel = "none"
// PolicyManagedApps specifies the policy managed apps state for app
// sharing from level.
PolicyManagedApps AppSharingFromLevel = "policyManagedApps"
)
// AppSharingToLevel enumerates the values for app sharing to level.
type AppSharingToLevel string
const (
// AppSharingToLevelAllApps specifies the app sharing to level all apps
// state for app sharing to level.
AppSharingToLevelAllApps AppSharingToLevel = "allApps"
// AppSharingToLevelNone specifies the app sharing to level none state for
// app sharing to level.
AppSharingToLevelNone AppSharingToLevel = "none"
// AppSharingToLevelPolicyManagedApps specifies the app sharing to level
// policy managed apps state for app sharing to level.
AppSharingToLevelPolicyManagedApps AppSharingToLevel = "policyManagedApps"
)
// Authentication enumerates the values for authentication.
type Authentication string
const (
// NotRequired specifies the not required state for authentication.
NotRequired Authentication = "notRequired"
// Required specifies the required state for authentication.
Required Authentication = "required"
)
// ClipboardSharingLevel enumerates the values for clipboard sharing level.
type ClipboardSharingLevel string
const (
// ClipboardSharingLevelAllApps specifies the clipboard sharing level all
// apps state for clipboard sharing level.
ClipboardSharingLevelAllApps ClipboardSharingLevel = "allApps"
// ClipboardSharingLevelBlocked specifies the clipboard sharing level
// blocked state for clipboard sharing level.
ClipboardSharingLevelBlocked ClipboardSharingLevel = "blocked"
// ClipboardSharingLevelPolicyManagedApps specifies the clipboard sharing
// level policy managed apps state for clipboard sharing level.
ClipboardSharingLevelPolicyManagedApps ClipboardSharingLevel = "policyManagedApps"
// ClipboardSharingLevelPolicyManagedAppsWithPasteIn specifies the
// clipboard sharing level policy managed apps with paste in state for
// clipboard sharing level.
ClipboardSharingLevelPolicyManagedAppsWithPasteIn ClipboardSharingLevel = "policyManagedAppsWithPasteIn"
)
// DataBackup enumerates the values for data backup.
type DataBackup string
const (
// Allow specifies the allow state for data backup.
Allow DataBackup = "allow"
// Block specifies the block state for data backup.
Block DataBackup = "block"
)
// DeviceCompliance enumerates the values for device compliance.
type DeviceCompliance string
const (
// Disable specifies the disable state for device compliance.
Disable DeviceCompliance = "disable"
// Enable specifies the enable state for device compliance.
Enable DeviceCompliance = "enable"
)
// FileEncryption enumerates the values for file encryption.
type FileEncryption string
const (
// FileEncryptionNotRequired specifies the file encryption not required
// state for file encryption.
FileEncryptionNotRequired FileEncryption = "notRequired"
// FileEncryptionRequired specifies the file encryption required state for
// file encryption.
FileEncryptionRequired FileEncryption = "required"
)
// FileEncryptionLevel enumerates the values for file encryption level.
type FileEncryptionLevel string
const (
// AfterDeviceRestart specifies the after device restart state for file
// encryption level.
AfterDeviceRestart FileEncryptionLevel = "afterDeviceRestart"
// DeviceLocked specifies the device locked state for file encryption
// level.
DeviceLocked FileEncryptionLevel = "deviceLocked"
// DeviceLockedExceptFilesOpen specifies the device locked except files
// open state for file encryption level.
DeviceLockedExceptFilesOpen FileEncryptionLevel = "deviceLockedExceptFilesOpen"
// UseDeviceSettings specifies the use device settings state for file
// encryption level.
UseDeviceSettings FileEncryptionLevel = "useDeviceSettings"
)
// FileSharingSaveAs enumerates the values for file sharing save as.
type FileSharingSaveAs string
const (
// FileSharingSaveAsAllow specifies the file sharing save as allow state
// for file sharing save as.
FileSharingSaveAsAllow FileSharingSaveAs = "allow"
// FileSharingSaveAsBlock specifies the file sharing save as block state
// for file sharing save as.
FileSharingSaveAsBlock FileSharingSaveAs = "block"
)
// GroupStatus enumerates the values for group status.
type GroupStatus string
const (
// NotTargeted specifies the not targeted state for group status.
NotTargeted GroupStatus = "notTargeted"
// Targeted specifies the targeted state for group status.
Targeted GroupStatus = "targeted"
)
// ManagedBrowser enumerates the values for managed browser.
type ManagedBrowser string
const (
// ManagedBrowserNotRequired specifies the managed browser not required
// state for managed browser.
ManagedBrowserNotRequired ManagedBrowser = "notRequired"
// ManagedBrowserRequired specifies the managed browser required state for
// managed browser.
ManagedBrowserRequired ManagedBrowser = "required"
)
// Pin enumerates the values for pin.
type Pin string
const (
// PinNotRequired specifies the pin not required state for pin.
PinNotRequired Pin = "notRequired"
// PinRequired specifies the pin required state for pin.
PinRequired Pin = "required"
)
// Platform enumerates the values for platform.
type Platform string
const (
// Android specifies the android state for platform.
Android Platform = "android"
// Ios specifies the ios state for platform.
Ios Platform = "ios"
// Windows specifies the windows state for platform.
Windows Platform = "windows"
)
// ScreenCapture enumerates the values for screen capture.
type ScreenCapture string
const (
// ScreenCaptureAllow specifies the screen capture allow state for screen
// capture.
ScreenCaptureAllow ScreenCapture = "allow"
// ScreenCaptureBlock specifies the screen capture block state for screen
// capture.
ScreenCaptureBlock ScreenCapture = "block"
)
// TouchID enumerates the values for touch id.
type TouchID string
const (
// TouchIDDisable specifies the touch id disable state for touch id.
TouchIDDisable TouchID = "disable"
// TouchIDEnable specifies the touch id enable state for touch id.
TouchIDEnable TouchID = "enable"
)
// AndroidMAMPolicy is android Policy entity for Intune MAM.
type AndroidMAMPolicy struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*AndroidMAMPolicyProperties `json:"properties,omitempty"`
}
// AndroidMAMPolicyCollection is
type AndroidMAMPolicyCollection struct {
autorest.Response `json:"-"`
Value *[]AndroidMAMPolicy `json:"value,omitempty"`
Nextlink *string `json:"nextlink,omitempty"`
}
// AndroidMAMPolicyCollectionPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client AndroidMAMPolicyCollection) AndroidMAMPolicyCollectionPreparer() (*http.Request, error) {
if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.Nextlink)))
}
// AndroidMAMPolicyProperties is intune MAM iOS Policy Properties.
type AndroidMAMPolicyProperties struct {
FriendlyName *string `json:"friendlyName,omitempty"`
Description *string `json:"description,omitempty"`
AppSharingFromLevel AppSharingFromLevel `json:"appSharingFromLevel,omitempty"`
AppSharingToLevel AppSharingToLevel `json:"appSharingToLevel,omitempty"`
Authentication Authentication `json:"authentication,omitempty"`
ClipboardSharingLevel ClipboardSharingLevel `json:"clipboardSharingLevel,omitempty"`
DataBackup DataBackup `json:"dataBackup,omitempty"`
FileSharingSaveAs FileSharingSaveAs `json:"fileSharingSaveAs,omitempty"`
Pin Pin `json:"pin,omitempty"`
PinNumRetry *int32 `json:"pinNumRetry,omitempty"`
DeviceCompliance DeviceCompliance `json:"deviceCompliance,omitempty"`
ManagedBrowser ManagedBrowser `json:"managedBrowser,omitempty"`
AccessRecheckOfflineTimeout *string `json:"accessRecheckOfflineTimeout,omitempty"`
AccessRecheckOnlineTimeout *string `json:"accessRecheckOnlineTimeout,omitempty"`
OfflineWipeTimeout *string `json:"offlineWipeTimeout,omitempty"`
NumOfApps *int32 `json:"numOfApps,omitempty"`
GroupStatus GroupStatus `json:"groupStatus,omitempty"`
LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
ScreenCapture ScreenCapture `json:"screenCapture,omitempty"`
FileEncryption FileEncryption `json:"fileEncryption,omitempty"`
}
// Application is application entity for Intune MAM.
type Application struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*ApplicationProperties `json:"properties,omitempty"`
}
// ApplicationCollection is
type ApplicationCollection struct {
autorest.Response `json:"-"`
Value *[]Application `json:"value,omitempty"`
Nextlink *string `json:"nextlink,omitempty"`
}
// ApplicationCollectionPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client ApplicationCollection) ApplicationCollectionPreparer() (*http.Request, error) {
if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.Nextlink)))
}
// ApplicationProperties is
type ApplicationProperties struct {
FriendlyName *string `json:"friendlyName,omitempty"`
Platform Platform `json:"platform,omitempty"`
AppID *string `json:"appId,omitempty"`
}
// Device is device entity for Intune.
type Device struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*DeviceProperties `json:"properties,omitempty"`
}
// DeviceCollection is
type DeviceCollection struct {
autorest.Response `json:"-"`
Value *[]Device `json:"value,omitempty"`
Nextlink *string `json:"nextlink,omitempty"`
}
// DeviceCollectionPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client DeviceCollection) DeviceCollectionPreparer() (*http.Request, error) {
if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.Nextlink)))
}
// DeviceProperties is
type DeviceProperties struct {
UserID *string `json:"userId,omitempty"`
FriendlyName *string `json:"friendlyName,omitempty"`
Platform *string `json:"platform,omitempty"`
PlatformVersion *string `json:"platformVersion,omitempty"`
DeviceType *string `json:"deviceType,omitempty"`
}
// Error is
type Error struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
}
// FlaggedEnrolledApp is flagged Enrolled App for the given tenant.
type FlaggedEnrolledApp struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*FlaggedEnrolledAppProperties `json:"properties,omitempty"`
}
// FlaggedEnrolledAppCollection is flagged Enrolled App collection for the
// given tenant.
type FlaggedEnrolledAppCollection struct {
autorest.Response `json:"-"`
Value *[]FlaggedEnrolledApp `json:"value,omitempty"`
Nextlink *string `json:"nextlink,omitempty"`
}
// FlaggedEnrolledAppCollectionPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client FlaggedEnrolledAppCollection) FlaggedEnrolledAppCollectionPreparer() (*http.Request, error) {
if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.Nextlink)))
}
// FlaggedEnrolledAppError is
type FlaggedEnrolledAppError struct {
ErrorCode *string `json:"errorCode,omitempty"`
Severity *string `json:"severity,omitempty"`
}
// FlaggedEnrolledAppProperties is
type FlaggedEnrolledAppProperties struct {
DeviceType *string `json:"deviceType,omitempty"`
FriendlyName *string `json:"friendlyName,omitempty"`
LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
Platform *string `json:"platform,omitempty"`
Errors *[]FlaggedEnrolledAppError `json:"errors,omitempty"`
}
// FlaggedUser is flagged user for the given tenant.
type FlaggedUser struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*FlaggedUserProperties `json:"properties,omitempty"`
}
// FlaggedUserCollection is flagged user collection for the given tenant.
type FlaggedUserCollection struct {
autorest.Response `json:"-"`
Value *[]FlaggedUser `json:"value,omitempty"`
Nextlink *string `json:"nextlink,omitempty"`
}
// FlaggedUserCollectionPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client FlaggedUserCollection) FlaggedUserCollectionPreparer() (*http.Request, error) {
if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.Nextlink)))
}
// FlaggedUserProperties is
type FlaggedUserProperties struct {
ErrorCount *int32 `json:"errorCount,omitempty"`
FriendlyName *string `json:"friendlyName,omitempty"`
}
// GroupItem is group entity for Intune MAM.
type GroupItem struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*GroupProperties `json:"properties,omitempty"`
}
// GroupProperties is
type GroupProperties struct {
FriendlyName *string `json:"friendlyName,omitempty"`
}
// GroupsCollection is
type GroupsCollection struct {
autorest.Response `json:"-"`
Value *[]GroupItem `json:"value,omitempty"`
Nextlink *string `json:"nextlink,omitempty"`
}
// GroupsCollectionPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client GroupsCollection) GroupsCollectionPreparer() (*http.Request, error) {
if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.Nextlink)))
}
// IOSMAMPolicy is iOS Policy entity for Intune MAM.
type IOSMAMPolicy struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*IOSMAMPolicyProperties `json:"properties,omitempty"`
}
// IOSMAMPolicyCollection is
type IOSMAMPolicyCollection struct {
autorest.Response `json:"-"`
Value *[]IOSMAMPolicy `json:"value,omitempty"`
Nextlink *string `json:"nextlink,omitempty"`
}
// IOSMAMPolicyCollectionPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client IOSMAMPolicyCollection) IOSMAMPolicyCollectionPreparer() (*http.Request, error) {
if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.Nextlink)))
}
// IOSMAMPolicyProperties is intune MAM iOS Policy Properties.
type IOSMAMPolicyProperties struct {
FriendlyName *string `json:"friendlyName,omitempty"`
Description *string `json:"description,omitempty"`
AppSharingFromLevel AppSharingFromLevel `json:"appSharingFromLevel,omitempty"`
AppSharingToLevel AppSharingToLevel `json:"appSharingToLevel,omitempty"`
Authentication Authentication `json:"authentication,omitempty"`
ClipboardSharingLevel ClipboardSharingLevel `json:"clipboardSharingLevel,omitempty"`
DataBackup DataBackup `json:"dataBackup,omitempty"`
FileSharingSaveAs FileSharingSaveAs `json:"fileSharingSaveAs,omitempty"`
Pin Pin `json:"pin,omitempty"`
PinNumRetry *int32 `json:"pinNumRetry,omitempty"`
DeviceCompliance DeviceCompliance `json:"deviceCompliance,omitempty"`
ManagedBrowser ManagedBrowser `json:"managedBrowser,omitempty"`
AccessRecheckOfflineTimeout *string `json:"accessRecheckOfflineTimeout,omitempty"`
AccessRecheckOnlineTimeout *string `json:"accessRecheckOnlineTimeout,omitempty"`
OfflineWipeTimeout *string `json:"offlineWipeTimeout,omitempty"`
NumOfApps *int32 `json:"numOfApps,omitempty"`
GroupStatus GroupStatus `json:"groupStatus,omitempty"`
LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
FileEncryptionLevel FileEncryptionLevel `json:"fileEncryptionLevel,omitempty"`
TouchID TouchID `json:"touchId,omitempty"`
}
// Location is location entity for given tenant.
type Location struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*LocationProperties `json:"properties,omitempty"`
}
// LocationCollection is
type LocationCollection struct {
autorest.Response `json:"-"`
Value *[]Location `json:"value,omitempty"`
Nextlink *string `json:"nextlink,omitempty"`
}
// LocationCollectionPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client LocationCollection) LocationCollectionPreparer() (*http.Request, error) {
if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.Nextlink)))
}
// LocationProperties is
type LocationProperties struct {
HostName *string `json:"hostName,omitempty"`
}
// MAMPolicyAppIDOrGroupIDPayload is mAM Policy request body for properties
// Intune MAM.
type MAMPolicyAppIDOrGroupIDPayload struct {
Properties *MAMPolicyAppOrGroupIDProperties `json:"properties,omitempty"`
}
// MAMPolicyAppOrGroupIDProperties is android Policy request body for Intune
// MAM.
type MAMPolicyAppOrGroupIDProperties struct {
URL *string `json:"url,omitempty"`
}
// MAMPolicyProperties is
type MAMPolicyProperties struct {
FriendlyName *string `json:"friendlyName,omitempty"`
Description *string `json:"description,omitempty"`
AppSharingFromLevel AppSharingFromLevel `json:"appSharingFromLevel,omitempty"`
AppSharingToLevel AppSharingToLevel `json:"appSharingToLevel,omitempty"`
Authentication Authentication `json:"authentication,omitempty"`
ClipboardSharingLevel ClipboardSharingLevel `json:"clipboardSharingLevel,omitempty"`
DataBackup DataBackup `json:"dataBackup,omitempty"`
FileSharingSaveAs FileSharingSaveAs `json:"fileSharingSaveAs,omitempty"`
Pin Pin `json:"pin,omitempty"`
PinNumRetry *int32 `json:"pinNumRetry,omitempty"`
DeviceCompliance DeviceCompliance `json:"deviceCompliance,omitempty"`
ManagedBrowser ManagedBrowser `json:"managedBrowser,omitempty"`
AccessRecheckOfflineTimeout *string `json:"accessRecheckOfflineTimeout,omitempty"`
AccessRecheckOnlineTimeout *string `json:"accessRecheckOnlineTimeout,omitempty"`
OfflineWipeTimeout *string `json:"offlineWipeTimeout,omitempty"`
NumOfApps *int32 `json:"numOfApps,omitempty"`
GroupStatus GroupStatus `json:"groupStatus,omitempty"`
LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
}
// OperationMetadataProperties is
type OperationMetadataProperties struct {
Name *string `json:"name,omitempty"`
Value *string `json:"value,omitempty"`
}
// OperationResult is operationResult entity for Intune.
type OperationResult struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*OperationResultProperties `json:"properties,omitempty"`
}
// OperationResultCollection is
type OperationResultCollection struct {
autorest.Response `json:"-"`
Value *[]OperationResult `json:"value,omitempty"`
Nextlink *string `json:"nextlink,omitempty"`
}
// OperationResultCollectionPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client OperationResultCollection) OperationResultCollectionPreparer() (*http.Request, error) {
if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.Nextlink)))
}
// OperationResultProperties is
type OperationResultProperties struct {
FriendlyName *string `json:"friendlyName,omitempty"`
Category *string `json:"category,omitempty"`
LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
State *string `json:"state,omitempty"`
OperationMetadata *[]OperationMetadataProperties `json:"operationMetadata,omitempty"`
}
// Resource is
type Resource struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
}
// StatusesDefault is default Statuses entity for the given tenant.
type StatusesDefault struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*StatusesProperties `json:"properties,omitempty"`
Nextlink *string `json:"nextlink,omitempty"`
}
// StatusesDefaultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client StatusesDefault) StatusesDefaultPreparer() (*http.Request, error) {
if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.Nextlink)))
}
// StatusesProperties is
type StatusesProperties struct {
DeployedPolicies *int32 `json:"deployedPolicies,omitempty"`
EnrolledUsers *int32 `json:"enrolledUsers,omitempty"`
FlaggedUsers *int32 `json:"flaggedUsers,omitempty"`
LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
PolicyAppliedUsers *int32 `json:"policyAppliedUsers,omitempty"`
Status *string `json:"status,omitempty"`
WipeFailedApps *int32 `json:"wipeFailedApps,omitempty"`
WipePendingApps *int32 `json:"wipePendingApps,omitempty"`
WipeSucceededApps *int32 `json:"wipeSucceededApps,omitempty"`
}
// WipeDeviceOperationResult is device entity for Intune.
type WipeDeviceOperationResult struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Location *string `json:"location,omitempty"`
*WipeDeviceOperationResultProperties `json:"properties,omitempty"`
}
// WipeDeviceOperationResultProperties is
type WipeDeviceOperationResultProperties struct {
Value *string `json:"value,omitempty"`
}
+29
View File
@@ -0,0 +1,29 @@
package intune
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return "Azure-SDK-For-Go/v10.1.0-beta arm-intune/2015-01-14-preview"
}
// Version returns the semantic version (see http://semver.org) of the client.
func Version() string {
return "v10.1.0-beta"
}