From 7a9c6a33630ed9a8f097b21297a8e0fdacd1dd86 Mon Sep 17 00:00:00 2001 From: kt Date: Mon, 21 Jan 2019 21:24:42 -0800 Subject: [PATCH 1/2] Update azure go sdk from v21.3.0 to v24.0.0 --- .../resources/mgmt/resources/models.go | 84 +- .../graphrbac/1.6/graphrbac/applications.go | 257 +++- .../1.6/graphrbac/deletedapplications.go | 365 +++++ .../graphrbac/1.6/graphrbac/domains.go | 21 + .../graphrbac/1.6/graphrbac/groups.go | 424 ++++- .../graphrbac/1.6/graphrbac/models.go | 1359 +++++++++++------ .../graphrbac/1.6/graphrbac/oauth2.go | 51 +- .../graphrbac/1.6/graphrbac/objects.go | 121 +- .../1.6/graphrbac/serviceprincipals.go | 237 ++- .../graphrbac/1.6/graphrbac/signedinuser.go | 283 ++++ .../services/graphrbac/1.6/graphrbac/users.go | 83 +- .../resources/deploymentoperations.go | 39 +- .../mgmt/2016-02-01/resources/deployments.go | 111 +- .../mgmt/2016-02-01/resources/groups.go | 123 +- .../mgmt/2016-02-01/resources/models.go | 398 ++++- .../mgmt/2016-02-01/resources/providers.go | 55 +- .../mgmt/2016-02-01/resources/resources.go | 97 +- .../mgmt/2016-02-01/resources/tags.go | 65 +- .../Azure/azure-sdk-for-go/version/version.go | 2 +- vendor/vendor.json | 40 +- 20 files changed, 3500 insertions(+), 715 deletions(-) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go index c1e080fbdb..cbe939d82b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go @@ -19,16 +19,16 @@ package resources -import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources" +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources" +) const ( DefaultBaseURI = original.DefaultBaseURI ) -type BaseClient = original.BaseClient -type DeploymentOperationsClient = original.DeploymentOperationsClient -type DeploymentsClient = original.DeploymentsClient -type GroupsClient = original.GroupsClient type DeploymentMode = original.DeploymentMode const ( @@ -44,7 +44,9 @@ const ( type AliasPathType = original.AliasPathType type AliasType = original.AliasType +type BaseClient = original.BaseClient type BasicDependency = original.BasicDependency +type Client = original.Client type DebugSetting = original.DebugSetting type Dependency = original.Dependency type Deployment = original.Deployment @@ -56,14 +58,16 @@ type DeploymentListResultIterator = original.DeploymentListResultIterator type DeploymentListResultPage = original.DeploymentListResultPage type DeploymentOperation = original.DeploymentOperation type DeploymentOperationProperties = original.DeploymentOperationProperties +type DeploymentOperationsClient = original.DeploymentOperationsClient type DeploymentOperationsListResult = original.DeploymentOperationsListResult type DeploymentOperationsListResultIterator = original.DeploymentOperationsListResultIterator type DeploymentOperationsListResultPage = original.DeploymentOperationsListResultPage type DeploymentProperties = original.DeploymentProperties type DeploymentPropertiesExtended = original.DeploymentPropertiesExtended +type DeploymentValidateResult = original.DeploymentValidateResult +type DeploymentsClient = original.DeploymentsClient type DeploymentsCreateOrUpdateFuture = original.DeploymentsCreateOrUpdateFuture type DeploymentsDeleteFuture = original.DeploymentsDeleteFuture -type DeploymentValidateResult = original.DeploymentValidateResult type ExportTemplateRequest = original.ExportTemplateRequest type GenericResource = original.GenericResource type GenericResourceFilter = original.GenericResourceFilter @@ -74,6 +78,7 @@ type GroupListResult = original.GroupListResult type GroupListResultIterator = original.GroupListResultIterator type GroupListResultPage = original.GroupListResultPage type GroupProperties = original.GroupProperties +type GroupsClient = original.GroupsClient type GroupsDeleteFuture = original.GroupsDeleteFuture type HTTPMessage = original.HTTPMessage type Identity = original.Identity @@ -91,27 +96,35 @@ type ProviderListResultIterator = original.ProviderListResultIterator type ProviderListResultPage = original.ProviderListResultPage type ProviderOperationDisplayProperties = original.ProviderOperationDisplayProperties type ProviderResourceType = original.ProviderResourceType +type ProvidersClient = original.ProvidersClient type Resource = original.Resource type Sku = original.Sku type SubResource = original.SubResource type TagCount = original.TagCount type TagDetails = original.TagDetails +type TagValue = original.TagValue +type TagsClient = original.TagsClient type TagsListResult = original.TagsListResult type TagsListResultIterator = original.TagsListResultIterator type TagsListResultPage = original.TagsListResultPage -type TagValue = original.TagValue type TargetResource = original.TargetResource type TemplateLink = original.TemplateLink type UpdateFuture = original.UpdateFuture -type ProvidersClient = original.ProvidersClient -type Client = original.Client -type TagsClient = original.TagsClient func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID) +func NewClient(subscriptionID string) Client { + return original.NewClient(subscriptionID) +} +func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { + return original.NewClientWithBaseURI(baseURI, subscriptionID) +} +func NewDeploymentListResultIterator(page DeploymentListResultPage) DeploymentListResultIterator { + return original.NewDeploymentListResultIterator(page) +} +func NewDeploymentListResultPage(getNextPage func(context.Context, DeploymentListResult) (DeploymentListResult, error)) DeploymentListResultPage { + return original.NewDeploymentListResultPage(getNextPage) } func NewDeploymentOperationsClient(subscriptionID string) DeploymentOperationsClient { return original.NewDeploymentOperationsClient(subscriptionID) @@ -119,23 +132,41 @@ func NewDeploymentOperationsClient(subscriptionID string) DeploymentOperationsCl func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentOperationsClient { return original.NewDeploymentOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewDeploymentOperationsListResultIterator(page DeploymentOperationsListResultPage) DeploymentOperationsListResultIterator { + return original.NewDeploymentOperationsListResultIterator(page) +} +func NewDeploymentOperationsListResultPage(getNextPage func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)) DeploymentOperationsListResultPage { + return original.NewDeploymentOperationsListResultPage(getNextPage) +} func NewDeploymentsClient(subscriptionID string) DeploymentsClient { return original.NewDeploymentsClient(subscriptionID) } func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentsClient { return original.NewDeploymentsClientWithBaseURI(baseURI, subscriptionID) } +func NewGroupListResultIterator(page GroupListResultPage) GroupListResultIterator { + return original.NewGroupListResultIterator(page) +} +func NewGroupListResultPage(getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage { + return original.NewGroupListResultPage(getNextPage) +} func NewGroupsClient(subscriptionID string) GroupsClient { return original.NewGroupsClient(subscriptionID) } func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsClient { return original.NewGroupsClientWithBaseURI(baseURI, subscriptionID) } -func PossibleDeploymentModeValues() []DeploymentMode { - return original.PossibleDeploymentModeValues() +func NewListResultIterator(page ListResultPage) ListResultIterator { + return original.NewListResultIterator(page) } -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return original.PossibleResourceIdentityTypeValues() +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return original.NewListResultPage(getNextPage) +} +func NewProviderListResultIterator(page ProviderListResultPage) ProviderListResultIterator { + return original.NewProviderListResultIterator(page) +} +func NewProviderListResultPage(getNextPage func(context.Context, ProviderListResult) (ProviderListResult, error)) ProviderListResultPage { + return original.NewProviderListResultPage(getNextPage) } func NewProvidersClient(subscriptionID string) ProvidersClient { return original.NewProvidersClient(subscriptionID) @@ -143,18 +174,27 @@ func NewProvidersClient(subscriptionID string) ProvidersClient { func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) ProvidersClient { return original.NewProvidersClientWithBaseURI(baseURI, subscriptionID) } -func NewClient(subscriptionID string) Client { - return original.NewClient(subscriptionID) -} -func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { - return original.NewClientWithBaseURI(baseURI, subscriptionID) -} func NewTagsClient(subscriptionID string) TagsClient { return original.NewTagsClient(subscriptionID) } func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient { return original.NewTagsClientWithBaseURI(baseURI, subscriptionID) } +func NewTagsListResultIterator(page TagsListResultPage) TagsListResultIterator { + return original.NewTagsListResultIterator(page) +} +func NewTagsListResultPage(getNextPage func(context.Context, TagsListResult) (TagsListResult, error)) TagsListResultPage { + return original.NewTagsListResultPage(getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleDeploymentModeValues() []DeploymentMode { + return original.PossibleDeploymentModeValues() +} +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return original.PossibleResourceIdentityTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/2017-03-09" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go index 61c0c5313e..fc6dfc571d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go @@ -23,6 +23,7 @@ import ( "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -46,7 +47,17 @@ func NewApplicationsClientWithBaseURI(baseURI string, tenantID string) Applicati // applicationObjectID - the object ID of the application to which to add the owner. // parameters - the URL of the owner object, such as // https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. -func (client ApplicationsClient) AddOwner(ctx context.Context, applicationObjectID string, parameters ApplicationAddOwnerParameters) (result autorest.Response, err error) { +func (client ApplicationsClient) AddOwner(ctx context.Context, applicationObjectID string, parameters AddOwnerParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.AddOwner") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { @@ -75,7 +86,7 @@ func (client ApplicationsClient) AddOwner(ctx context.Context, applicationObject } // AddOwnerPreparer prepares the AddOwner request. -func (client ApplicationsClient) AddOwnerPreparer(ctx context.Context, applicationObjectID string, parameters ApplicationAddOwnerParameters) (*http.Request, error) { +func (client ApplicationsClient) AddOwnerPreparer(ctx context.Context, applicationObjectID string, parameters AddOwnerParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "applicationObjectId": autorest.Encode("path", applicationObjectID), "tenantID": autorest.Encode("path", client.TenantID), @@ -119,6 +130,16 @@ func (client ApplicationsClient) AddOwnerResponder(resp *http.Response) (result // Parameters: // parameters - the parameters for creating an application. func (client ApplicationsClient) Create(ctx context.Context, parameters ApplicationCreateParameters) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.AvailableToOtherTenants", Name: validation.Null, Rule: true, Chain: nil}, @@ -193,6 +214,16 @@ func (client ApplicationsClient) CreateResponder(resp *http.Response) (result Ap // Parameters: // applicationObjectID - application object ID. func (client ApplicationsClient) Delete(ctx context.Context, applicationObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.DeletePreparer(ctx, applicationObjectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Delete", nil, "Failure preparing request") @@ -257,6 +288,16 @@ func (client ApplicationsClient) DeleteResponder(resp *http.Response) (result au // Parameters: // applicationObjectID - application object ID. func (client ApplicationsClient) Get(ctx context.Context, applicationObjectID string) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.GetPreparer(ctx, applicationObjectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Get", nil, "Failure preparing request") @@ -322,7 +363,17 @@ func (client ApplicationsClient) GetResponder(resp *http.Response) (result Appli // Parameters: // filter - the filters to apply to the operation. func (client ApplicationsClient) List(ctx context.Context, filter string) (result ApplicationListResultPage, err error) { - result.fn = func(lastResult ApplicationListResult) (ApplicationListResult, error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.List") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult ApplicationListResult) (ApplicationListResult, error) { if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { return ApplicationListResult{}, nil } @@ -393,6 +444,16 @@ func (client ApplicationsClient) ListResponder(resp *http.Response) (result Appl // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client ApplicationsClient) ListComplete(ctx context.Context, filter string) (result ApplicationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.List(ctx, filter) return } @@ -401,6 +462,16 @@ func (client ApplicationsClient) ListComplete(ctx context.Context, filter string // Parameters: // applicationObjectID - application object ID. func (client ApplicationsClient) ListKeyCredentials(ctx context.Context, applicationObjectID string) (result KeyCredentialListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListKeyCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.ListKeyCredentialsPreparer(ctx, applicationObjectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListKeyCredentials", nil, "Failure preparing request") @@ -466,6 +537,16 @@ func (client ApplicationsClient) ListKeyCredentialsResponder(resp *http.Response // Parameters: // nextLink - next link for the list operation. func (client ApplicationsClient) ListNext(ctx context.Context, nextLink string) (result ApplicationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.ListNextPreparer(ctx, nextLink) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListNext", nil, "Failure preparing request") @@ -530,7 +611,18 @@ func (client ApplicationsClient) ListNextResponder(resp *http.Response) (result // ListOwners the owners are a set of non-admin users who are allowed to modify this object. // Parameters: // applicationObjectID - the object ID of the application for which to get owners. -func (client ApplicationsClient) ListOwners(ctx context.Context, applicationObjectID string) (result DirectoryObjectListResult, err error) { +func (client ApplicationsClient) ListOwners(ctx context.Context, applicationObjectID string) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListOwners") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOwnersNextResults req, err := client.ListOwnersPreparer(ctx, applicationObjectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListOwners", nil, "Failure preparing request") @@ -539,12 +631,12 @@ func (client ApplicationsClient) ListOwners(ctx context.Context, applicationObje resp, err := client.ListOwnersSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.dolr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListOwners", resp, "Failure sending request") return } - result, err = client.ListOwnersResponder(resp) + result.dolr, err = client.ListOwnersResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListOwners", resp, "Failure responding to request") } @@ -592,10 +684,57 @@ func (client ApplicationsClient) ListOwnersResponder(resp *http.Response) (resul return } +// listOwnersNextResults retrieves the next set of results, if any. +func (client ApplicationsClient) listOwnersNextResults(ctx context.Context, lastResults DirectoryObjectListResult) (result DirectoryObjectListResult, err error) { + req, err := lastResults.directoryObjectListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "listOwnersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOwnersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "listOwnersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOwnersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "listOwnersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOwnersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationsClient) ListOwnersComplete(ctx context.Context, applicationObjectID string) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListOwners") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOwners(ctx, applicationObjectID) + return +} + // ListPasswordCredentials get the passwordCredentials associated with an application. // Parameters: // applicationObjectID - application object ID. func (client ApplicationsClient) ListPasswordCredentials(ctx context.Context, applicationObjectID string) (result PasswordCredentialListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListPasswordCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.ListPasswordCredentialsPreparer(ctx, applicationObjectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListPasswordCredentials", nil, "Failure preparing request") @@ -662,6 +801,16 @@ func (client ApplicationsClient) ListPasswordCredentialsResponder(resp *http.Res // applicationObjectID - application object ID. // parameters - parameters to update an existing application. func (client ApplicationsClient) Patch(ctx context.Context, applicationObjectID string, parameters ApplicationUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Patch") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.PatchPreparer(ctx, applicationObjectID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Patch", nil, "Failure preparing request") @@ -724,11 +873,97 @@ func (client ApplicationsClient) PatchResponder(resp *http.Response) (result aut return } +// RemoveOwner remove a member from owners. +// Parameters: +// applicationObjectID - the object ID of the application from which to remove the owner. +// ownerObjectID - owner object id +func (client ApplicationsClient) RemoveOwner(ctx context.Context, applicationObjectID string, ownerObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.RemoveOwner") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveOwnerPreparer(ctx, applicationObjectID, ownerObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "RemoveOwner", nil, "Failure preparing request") + return + } + + resp, err := client.RemoveOwnerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "RemoveOwner", resp, "Failure sending request") + return + } + + result, err = client.RemoveOwnerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "RemoveOwner", resp, "Failure responding to request") + } + + return +} + +// RemoveOwnerPreparer prepares the RemoveOwner request. +func (client ApplicationsClient) RemoveOwnerPreparer(ctx context.Context, applicationObjectID string, ownerObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "ownerObjectId": autorest.Encode("path", ownerObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}/$links/owners/{ownerObjectId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveOwnerSender sends the RemoveOwner request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) RemoveOwnerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RemoveOwnerResponder handles the response to the RemoveOwner request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) RemoveOwnerResponder(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 +} + // UpdateKeyCredentials update the keyCredentials associated with an application. // Parameters: // applicationObjectID - application object ID. // parameters - parameters to update the keyCredentials of an existing application. func (client ApplicationsClient) UpdateKeyCredentials(ctx context.Context, applicationObjectID string, parameters KeyCredentialsUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.UpdateKeyCredentials") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.UpdateKeyCredentialsPreparer(ctx, applicationObjectID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "UpdateKeyCredentials", nil, "Failure preparing request") @@ -796,6 +1031,16 @@ func (client ApplicationsClient) UpdateKeyCredentialsResponder(resp *http.Respon // applicationObjectID - application object ID. // parameters - parameters to update passwordCredentials of an existing application. func (client ApplicationsClient) UpdatePasswordCredentials(ctx context.Context, applicationObjectID string, parameters PasswordCredentialsUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.UpdatePasswordCredentials") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.UpdatePasswordCredentialsPreparer(ctx, applicationObjectID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "UpdatePasswordCredentials", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go new file mode 100644 index 0000000000..1107dff959 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go @@ -0,0 +1,365 @@ +package graphrbac + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DeletedApplicationsClient is the the Graph RBAC Management Client +type DeletedApplicationsClient struct { + BaseClient +} + +// NewDeletedApplicationsClient creates an instance of the DeletedApplicationsClient client. +func NewDeletedApplicationsClient(tenantID string) DeletedApplicationsClient { + return NewDeletedApplicationsClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewDeletedApplicationsClientWithBaseURI creates an instance of the DeletedApplicationsClient client. +func NewDeletedApplicationsClientWithBaseURI(baseURI string, tenantID string) DeletedApplicationsClient { + return DeletedApplicationsClient{NewWithBaseURI(baseURI, tenantID)} +} + +// HardDelete hard-delete an application. +// Parameters: +// applicationObjectID - application object ID. +func (client DeletedApplicationsClient) HardDelete(ctx context.Context, applicationObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedApplicationsClient.HardDelete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.HardDeletePreparer(ctx, applicationObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "HardDelete", nil, "Failure preparing request") + return + } + + resp, err := client.HardDeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "HardDelete", resp, "Failure sending request") + return + } + + result, err = client.HardDeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "HardDelete", resp, "Failure responding to request") + } + + return +} + +// HardDeletePreparer prepares the HardDelete request. +func (client DeletedApplicationsClient) HardDeletePreparer(ctx context.Context, applicationObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/deletedApplications/{applicationObjectId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// HardDeleteSender sends the HardDelete request. The method will close the +// http.Response Body if it receives an error. +func (client DeletedApplicationsClient) HardDeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// HardDeleteResponder handles the response to the HardDelete request. The method always +// closes the http.Response Body. +func (client DeletedApplicationsClient) HardDeleteResponder(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 +} + +// List gets a list of deleted applications in the directory. +// Parameters: +// filter - the filter to apply to the operation. +func (client DeletedApplicationsClient) List(ctx context.Context, filter string) (result ApplicationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedApplicationsClient.List") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult ApplicationListResult) (ApplicationListResult, error) { + if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { + return ApplicationListResult{}, nil + } + return client.ListNext(ctx, *lastResult.OdataNextLink) + } + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "List", resp, "Failure sending request") + return + } + + result.alr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DeletedApplicationsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/deletedApplications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DeletedApplicationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DeletedApplicationsClient) ListResponder(resp *http.Response) (result ApplicationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DeletedApplicationsClient) ListComplete(ctx context.Context, filter string) (result ApplicationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedApplicationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// ListNext gets a list of deleted applications in the directory. +// Parameters: +// nextLink - next link for the list operation. +func (client DeletedApplicationsClient) ListNext(ctx context.Context, nextLink string) (result ApplicationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedApplicationsClient.ListNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListNextPreparer(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "ListNext", nil, "Failure preparing request") + return + } + + resp, err := client.ListNextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "ListNext", resp, "Failure sending request") + return + } + + result, err = client.ListNextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "ListNext", resp, "Failure responding to request") + } + + return +} + +// ListNextPreparer prepares the ListNext request. +func (client DeletedApplicationsClient) ListNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nextLink": nextLink, + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNextSender sends the ListNext request. The method will close the +// http.Response Body if it receives an error. +func (client DeletedApplicationsClient) ListNextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListNextResponder handles the response to the ListNext request. The method always +// closes the http.Response Body. +func (client DeletedApplicationsClient) ListNextResponder(resp *http.Response) (result ApplicationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Restore restores the deleted application in the directory. +// Parameters: +// objectID - application object ID. +func (client DeletedApplicationsClient) Restore(ctx context.Context, objectID string) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedApplicationsClient.Restore") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestorePreparer(ctx, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "Restore", nil, "Failure preparing request") + return + } + + resp, err := client.RestoreSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "Restore", resp, "Failure sending request") + return + } + + result, err = client.RestoreResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "Restore", resp, "Failure responding to request") + } + + return +} + +// RestorePreparer prepares the Restore request. +func (client DeletedApplicationsClient) RestorePreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/deletedApplications/{objectId}/restore", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreSender sends the Restore request. The method will close the +// http.Response Body if it receives an error. +func (client DeletedApplicationsClient) RestoreSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RestoreResponder handles the response to the Restore request. The method always +// closes the http.Response Body. +func (client DeletedApplicationsClient) RestoreResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/domains.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/domains.go index e6d990273f..e19a6fe06f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/domains.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/domains.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -43,6 +44,16 @@ func NewDomainsClientWithBaseURI(baseURI string, tenantID string) DomainsClient // Parameters: // domainName - name of the domain. func (client DomainsClient) Get(ctx context.Context, domainName string) (result Domain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.GetPreparer(ctx, domainName) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.DomainsClient", "Get", nil, "Failure preparing request") @@ -108,6 +119,16 @@ func (client DomainsClient) GetResponder(resp *http.Response) (result Domain, er // Parameters: // filter - the filter to apply to the operation. func (client DomainsClient) List(ctx context.Context, filter string) (result DomainListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.ListPreparer(ctx, filter) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.DomainsClient", "List", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go index 9fbe85cbbd..3f0e2097dd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go @@ -23,6 +23,7 @@ import ( "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -47,6 +48,16 @@ func NewGroupsClientWithBaseURI(baseURI string, tenantID string) GroupsClient { // parameters - the URL of the member object, such as // https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. func (client GroupsClient) AddMember(ctx context.Context, groupObjectID string, parameters GroupAddMemberParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.AddMember") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { @@ -115,10 +126,104 @@ func (client GroupsClient) AddMemberResponder(resp *http.Response) (result autor return } +// AddOwner add an owner to a group. +// Parameters: +// objectID - the object ID of the application to which to add the owner. +// parameters - the URL of the owner object, such as +// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. +func (client GroupsClient) AddOwner(ctx context.Context, objectID string, parameters AddOwnerParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.AddOwner") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.GroupsClient", "AddOwner", err.Error()) + } + + req, err := client.AddOwnerPreparer(ctx, objectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "AddOwner", nil, "Failure preparing request") + return + } + + resp, err := client.AddOwnerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "AddOwner", resp, "Failure sending request") + return + } + + result, err = client.AddOwnerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "AddOwner", resp, "Failure responding to request") + } + + return +} + +// AddOwnerPreparer prepares the AddOwner request. +func (client GroupsClient) AddOwnerPreparer(ctx context.Context, objectID string, parameters AddOwnerParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/groups/{objectId}/$links/owners", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddOwnerSender sends the AddOwner request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) AddOwnerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AddOwnerResponder handles the response to the AddOwner request. The method always +// closes the http.Response Body. +func (client GroupsClient) AddOwnerResponder(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 +} + // Create create a group in the directory. // Parameters: // parameters - the parameters for the group to create. func (client GroupsClient) Create(ctx context.Context, parameters GroupCreateParameters) (result ADGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, @@ -194,6 +299,16 @@ func (client GroupsClient) CreateResponder(resp *http.Response) (result ADGroup, // Parameters: // objectID - the object ID of the group to delete. func (client GroupsClient) Delete(ctx context.Context, objectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.DeletePreparer(ctx, objectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Delete", nil, "Failure preparing request") @@ -258,6 +373,16 @@ func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest // Parameters: // objectID - the object ID of the user for which to get group information. func (client GroupsClient) Get(ctx context.Context, objectID string) (result ADGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.GetPreparer(ctx, objectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Get", nil, "Failure preparing request") @@ -322,10 +447,20 @@ func (client GroupsClient) GetResponder(resp *http.Response) (result ADGroup, er // GetGroupMembers gets the members of a group. // Parameters: // objectID - the object ID of the group whose members should be retrieved. -func (client GroupsClient) GetGroupMembers(ctx context.Context, objectID string) (result GetObjectsResultPage, err error) { - result.fn = func(lastResult GetObjectsResult) (GetObjectsResult, error) { +func (client GroupsClient) GetGroupMembers(ctx context.Context, objectID string) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.GetGroupMembers") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult DirectoryObjectListResult) (DirectoryObjectListResult, error) { if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { - return GetObjectsResult{}, nil + return DirectoryObjectListResult{}, nil } return client.GetGroupMembersNext(ctx, *lastResult.OdataNextLink) } @@ -337,12 +472,12 @@ func (client GroupsClient) GetGroupMembers(ctx context.Context, objectID string) resp, err := client.GetGroupMembersSender(req) if err != nil { - result.gor.Response = autorest.Response{Response: resp} + result.dolr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetGroupMembers", resp, "Failure sending request") return } - result.gor, err = client.GetGroupMembersResponder(resp) + result.dolr, err = client.GetGroupMembersResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetGroupMembers", resp, "Failure responding to request") } @@ -379,7 +514,7 @@ func (client GroupsClient) GetGroupMembersSender(req *http.Request) (*http.Respo // GetGroupMembersResponder handles the response to the GetGroupMembers request. The method always // closes the http.Response Body. -func (client GroupsClient) GetGroupMembersResponder(resp *http.Response) (result GetObjectsResult, err error) { +func (client GroupsClient) GetGroupMembersResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -391,7 +526,17 @@ func (client GroupsClient) GetGroupMembersResponder(resp *http.Response) (result } // GetGroupMembersComplete enumerates all values, automatically crossing page boundaries as required. -func (client GroupsClient) GetGroupMembersComplete(ctx context.Context, objectID string) (result GetObjectsResultIterator, err error) { +func (client GroupsClient) GetGroupMembersComplete(ctx context.Context, objectID string) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.GetGroupMembers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.GetGroupMembers(ctx, objectID) return } @@ -399,7 +544,17 @@ func (client GroupsClient) GetGroupMembersComplete(ctx context.Context, objectID // GetGroupMembersNext gets the members of a group. // Parameters: // nextLink - next link for the list operation. -func (client GroupsClient) GetGroupMembersNext(ctx context.Context, nextLink string) (result GetObjectsResult, err error) { +func (client GroupsClient) GetGroupMembersNext(ctx context.Context, nextLink string) (result DirectoryObjectListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.GetGroupMembersNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.GetGroupMembersNextPreparer(ctx, nextLink) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetGroupMembersNext", nil, "Failure preparing request") @@ -450,7 +605,7 @@ func (client GroupsClient) GetGroupMembersNextSender(req *http.Request) (*http.R // GetGroupMembersNextResponder handles the response to the GetGroupMembersNext request. The method always // closes the http.Response Body. -func (client GroupsClient) GetGroupMembersNextResponder(resp *http.Response) (result GetObjectsResult, err error) { +func (client GroupsClient) GetGroupMembersNextResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -466,6 +621,16 @@ func (client GroupsClient) GetGroupMembersNextResponder(resp *http.Response) (re // objectID - the object ID of the group for which to get group membership. // parameters - group filtering parameters. func (client GroupsClient) GetMemberGroups(ctx context.Context, objectID string, parameters GroupGetMemberGroupsParameters) (result GroupGetMemberGroupsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.GetMemberGroups") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SecurityEnabledOnly", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { @@ -540,6 +705,16 @@ func (client GroupsClient) GetMemberGroupsResponder(resp *http.Response) (result // Parameters: // parameters - the check group membership parameters. func (client GroupsClient) IsMemberOf(ctx context.Context, parameters CheckGroupMembershipParameters) (result CheckGroupMembershipResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.IsMemberOf") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.GroupID", Name: validation.Null, Rule: true, Chain: nil}, @@ -613,7 +788,17 @@ func (client GroupsClient) IsMemberOfResponder(resp *http.Response) (result Chec // Parameters: // filter - the filter to apply to the operation. func (client GroupsClient) List(ctx context.Context, filter string) (result GroupListResultPage, err error) { - result.fn = func(lastResult GroupListResult) (GroupListResult, error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List") + defer func() { + sc := -1 + if result.glr.Response.Response != nil { + sc = result.glr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult GroupListResult) (GroupListResult, error) { if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { return GroupListResult{}, nil } @@ -684,6 +869,16 @@ func (client GroupsClient) ListResponder(resp *http.Response) (result GroupListR // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client GroupsClient) ListComplete(ctx context.Context, filter string) (result GroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.List(ctx, filter) return } @@ -692,6 +887,16 @@ func (client GroupsClient) ListComplete(ctx context.Context, filter string) (res // Parameters: // nextLink - next link for the list operation. func (client GroupsClient) ListNext(ctx context.Context, nextLink string) (result GroupListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.ListNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.ListNextPreparer(ctx, nextLink) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListNext", nil, "Failure preparing request") @@ -753,11 +958,134 @@ func (client GroupsClient) ListNextResponder(resp *http.Response) (result GroupL return } +// ListOwners the owners are a set of non-admin users who are allowed to modify this object. +// Parameters: +// objectID - the object ID of the group for which to get owners. +func (client GroupsClient) ListOwners(ctx context.Context, objectID string) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.ListOwners") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOwnersNextResults + req, err := client.ListOwnersPreparer(ctx, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListOwners", nil, "Failure preparing request") + return + } + + resp, err := client.ListOwnersSender(req) + if err != nil { + result.dolr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListOwners", resp, "Failure sending request") + return + } + + result.dolr, err = client.ListOwnersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListOwners", resp, "Failure responding to request") + } + + return +} + +// ListOwnersPreparer prepares the ListOwners request. +func (client GroupsClient) ListOwnersPreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/groups/{objectId}/owners", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOwnersSender sends the ListOwners request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) ListOwnersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOwnersResponder handles the response to the ListOwners request. The method always +// closes the http.Response Body. +func (client GroupsClient) ListOwnersResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOwnersNextResults retrieves the next set of results, if any. +func (client GroupsClient) listOwnersNextResults(ctx context.Context, lastResults DirectoryObjectListResult) (result DirectoryObjectListResult, err error) { + req, err := lastResults.directoryObjectListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "listOwnersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOwnersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "listOwnersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOwnersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "listOwnersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOwnersComplete enumerates all values, automatically crossing page boundaries as required. +func (client GroupsClient) ListOwnersComplete(ctx context.Context, objectID string) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.ListOwners") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOwners(ctx, objectID) + return +} + // RemoveMember remove a member from a group. // Parameters: // groupObjectID - the object ID of the group from which to remove the member. // memberObjectID - member object id func (client GroupsClient) RemoveMember(ctx context.Context, groupObjectID string, memberObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.RemoveMember") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.RemoveMemberPreparer(ctx, groupObjectID, memberObjectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "RemoveMember", nil, "Failure preparing request") @@ -818,3 +1146,79 @@ func (client GroupsClient) RemoveMemberResponder(resp *http.Response) (result au result.Response = resp return } + +// RemoveOwner remove a member from owners. +// Parameters: +// objectID - the object ID of the group from which to remove the owner. +// ownerObjectID - owner object id +func (client GroupsClient) RemoveOwner(ctx context.Context, objectID string, ownerObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.RemoveOwner") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveOwnerPreparer(ctx, objectID, ownerObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "RemoveOwner", nil, "Failure preparing request") + return + } + + resp, err := client.RemoveOwnerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "RemoveOwner", resp, "Failure sending request") + return + } + + result, err = client.RemoveOwnerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "RemoveOwner", resp, "Failure responding to request") + } + + return +} + +// RemoveOwnerPreparer prepares the RemoveOwner request. +func (client GroupsClient) RemoveOwnerPreparer(ctx context.Context, objectID string, ownerObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "ownerObjectId": autorest.Encode("path", ownerObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/groups/{objectId}/$links/owners/{ownerObjectId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveOwnerSender sends the RemoveOwner request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) RemoveOwnerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RemoveOwnerResponder handles the response to the RemoveOwner request. The method always +// closes the http.Response Body. +func (client GroupsClient) RemoveOwnerResponder(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 +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go index aad11b313a..66c76b8ef6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go @@ -18,11 +18,18 @@ package graphrbac // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "context" "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" ) +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac" + // ObjectType enumerates the values for object type. type ObjectType string @@ -59,114 +66,28 @@ func PossibleUserTypeValues() []UserType { return []UserType{Guest, Member} } -// AADObject the properties of an Active Directory object. -type AADObject struct { - autorest.Response `json:"-"` +// AddOwnerParameters request parameters for adding a owner to an application. +type AddOwnerParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // ObjectID - The ID of the object. - ObjectID *string `json:"objectId,omitempty"` - // ObjectType - The type of AAD object. - ObjectType *string `json:"objectType,omitempty"` - // DisplayName - The display name of the object. - DisplayName *string `json:"displayName,omitempty"` - // UserPrincipalName - The principal name of the object. - UserPrincipalName *string `json:"userPrincipalName,omitempty"` - // Mail - The primary email address of the object. - Mail *string `json:"mail,omitempty"` - // MailEnabled - Whether the AAD object is mail-enabled. - MailEnabled *bool `json:"mailEnabled,omitempty"` - // MailNickname - The mail alias for the user. - MailNickname *string `json:"mailNickname,omitempty"` - // SecurityEnabled - Whether the AAD object is security-enabled. - SecurityEnabled *bool `json:"securityEnabled,omitempty"` - // SignInName - The sign-in name of the object. - SignInName *string `json:"signInName,omitempty"` - // ServicePrincipalNames - A collection of service principal names associated with the object. - ServicePrincipalNames *[]string `json:"servicePrincipalNames,omitempty"` - // UserType - The user type of the object. - UserType *string `json:"userType,omitempty"` - // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". - UsageLocation *string `json:"usageLocation,omitempty"` - // AppID - The application ID. - AppID *string `json:"appId,omitempty"` - // AppPermissions - The application permissions. - AppPermissions *[]string `json:"appPermissions,omitempty"` - // AvailableToOtherTenants - Whether the application is be available to other tenants. - AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"` - // IdentifierUris - A collection of URIs for the application. - IdentifierUris *[]string `json:"identifierUris,omitempty"` - // ReplyUrls - A collection of reply URLs for the application. - ReplyUrls *[]string `json:"replyUrls,omitempty"` - // Homepage - The home page of the application. - Homepage *string `json:"homepage,omitempty"` + // URL - A owner object URL, such as "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the owner (user, application, servicePrincipal, group) to be added. + URL *string `json:"url,omitempty"` } -// MarshalJSON is the custom marshaler for AADObject. -func (ao AADObject) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for AddOwnerParameters. +func (aop AddOwnerParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ao.ObjectID != nil { - objectMap["objectId"] = ao.ObjectID - } - if ao.ObjectType != nil { - objectMap["objectType"] = ao.ObjectType - } - if ao.DisplayName != nil { - objectMap["displayName"] = ao.DisplayName - } - if ao.UserPrincipalName != nil { - objectMap["userPrincipalName"] = ao.UserPrincipalName - } - if ao.Mail != nil { - objectMap["mail"] = ao.Mail - } - if ao.MailEnabled != nil { - objectMap["mailEnabled"] = ao.MailEnabled - } - if ao.MailNickname != nil { - objectMap["mailNickname"] = ao.MailNickname - } - if ao.SecurityEnabled != nil { - objectMap["securityEnabled"] = ao.SecurityEnabled - } - if ao.SignInName != nil { - objectMap["signInName"] = ao.SignInName + if aop.URL != nil { + objectMap["url"] = aop.URL } - if ao.ServicePrincipalNames != nil { - objectMap["servicePrincipalNames"] = ao.ServicePrincipalNames - } - if ao.UserType != nil { - objectMap["userType"] = ao.UserType - } - if ao.UsageLocation != nil { - objectMap["usageLocation"] = ao.UsageLocation - } - if ao.AppID != nil { - objectMap["appId"] = ao.AppID - } - if ao.AppPermissions != nil { - objectMap["appPermissions"] = ao.AppPermissions - } - if ao.AvailableToOtherTenants != nil { - objectMap["availableToOtherTenants"] = ao.AvailableToOtherTenants - } - if ao.IdentifierUris != nil { - objectMap["identifierUris"] = ao.IdentifierUris - } - if ao.ReplyUrls != nil { - objectMap["replyUrls"] = ao.ReplyUrls - } - if ao.Homepage != nil { - objectMap["homepage"] = ao.Homepage - } - for k, v := range ao.AdditionalProperties { + for k, v := range aop.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for AADObject struct. -func (ao *AADObject) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for AddOwnerParameters struct. +func (aop *AddOwnerParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -181,172 +102,19 @@ func (ao *AADObject) UnmarshalJSON(body []byte) error { if err != nil { return err } - if ao.AdditionalProperties == nil { - ao.AdditionalProperties = make(map[string]interface{}) + if aop.AdditionalProperties == nil { + aop.AdditionalProperties = make(map[string]interface{}) } - ao.AdditionalProperties[k] = additionalProperties + aop.AdditionalProperties[k] = additionalProperties } - case "objectId": - if v != nil { - var objectID string - err = json.Unmarshal(*v, &objectID) - if err != nil { - return err - } - ao.ObjectID = &objectID - } - case "objectType": - if v != nil { - var objectType string - err = json.Unmarshal(*v, &objectType) - if err != nil { - return err - } - ao.ObjectType = &objectType - } - case "displayName": - if v != nil { - var displayName string - err = json.Unmarshal(*v, &displayName) - if err != nil { - return err - } - ao.DisplayName = &displayName - } - case "userPrincipalName": - if v != nil { - var userPrincipalName string - err = json.Unmarshal(*v, &userPrincipalName) - if err != nil { - return err - } - ao.UserPrincipalName = &userPrincipalName - } - case "mail": - if v != nil { - var mailVar string - err = json.Unmarshal(*v, &mailVar) - if err != nil { - return err - } - ao.Mail = &mailVar - } - case "mailEnabled": - if v != nil { - var mailEnabled bool - err = json.Unmarshal(*v, &mailEnabled) - if err != nil { - return err - } - ao.MailEnabled = &mailEnabled - } - case "mailNickname": - if v != nil { - var mailNickname string - err = json.Unmarshal(*v, &mailNickname) - if err != nil { - return err - } - ao.MailNickname = &mailNickname - } - case "securityEnabled": - if v != nil { - var securityEnabled bool - err = json.Unmarshal(*v, &securityEnabled) - if err != nil { - return err - } - ao.SecurityEnabled = &securityEnabled - } - case "signInName": - if v != nil { - var signInName string - err = json.Unmarshal(*v, &signInName) - if err != nil { - return err - } - ao.SignInName = &signInName - } - case "servicePrincipalNames": - if v != nil { - var servicePrincipalNames []string - err = json.Unmarshal(*v, &servicePrincipalNames) - if err != nil { - return err - } - ao.ServicePrincipalNames = &servicePrincipalNames - } - case "userType": - if v != nil { - var userType string - err = json.Unmarshal(*v, &userType) - if err != nil { - return err - } - ao.UserType = &userType - } - case "usageLocation": - if v != nil { - var usageLocation string - err = json.Unmarshal(*v, &usageLocation) - if err != nil { - return err - } - ao.UsageLocation = &usageLocation - } - case "appId": - if v != nil { - var appID string - err = json.Unmarshal(*v, &appID) - if err != nil { - return err - } - ao.AppID = &appID - } - case "appPermissions": - if v != nil { - var appPermissions []string - err = json.Unmarshal(*v, &appPermissions) - if err != nil { - return err - } - ao.AppPermissions = &appPermissions - } - case "availableToOtherTenants": - if v != nil { - var availableToOtherTenants bool - err = json.Unmarshal(*v, &availableToOtherTenants) - if err != nil { - return err - } - ao.AvailableToOtherTenants = &availableToOtherTenants - } - case "identifierUris": - if v != nil { - var identifierUris []string - err = json.Unmarshal(*v, &identifierUris) - if err != nil { - return err - } - ao.IdentifierUris = &identifierUris - } - case "replyUrls": - if v != nil { - var replyUrls []string - err = json.Unmarshal(*v, &replyUrls) - if err != nil { - return err - } - ao.ReplyUrls = &replyUrls - } - case "homepage": + case "url": if v != nil { - var homepage string - err = json.Unmarshal(*v, &homepage) + var URL string + err = json.Unmarshal(*v, &URL) if err != nil { return err } - ao.Homepage = &homepage + aop.URL = &URL } } } @@ -359,6 +127,10 @@ type ADGroup struct { autorest.Response `json:"-"` // DisplayName - The display name of the group. DisplayName *string `json:"displayName,omitempty"` + // MailEnabled - Whether the group is mail-enabled. Must be false. This is because only pure security groups can be created using the Graph API. + MailEnabled *bool `json:"mailEnabled,omitempty"` + // MailNickname - The mail alias for the group. + MailNickname *string `json:"mailNickname,omitempty"` // SecurityEnabled - Whether the group is security-enable. SecurityEnabled *bool `json:"securityEnabled,omitempty"` // Mail - The primary email address of the group. @@ -380,6 +152,12 @@ func (ag ADGroup) MarshalJSON() ([]byte, error) { if ag.DisplayName != nil { objectMap["displayName"] = ag.DisplayName } + if ag.MailEnabled != nil { + objectMap["mailEnabled"] = ag.MailEnabled + } + if ag.MailNickname != nil { + objectMap["mailNickname"] = ag.MailNickname + } if ag.SecurityEnabled != nil { objectMap["securityEnabled"] = ag.SecurityEnabled } @@ -449,6 +227,24 @@ func (ag *ADGroup) UnmarshalJSON(body []byte) error { } ag.DisplayName = &displayName } + case "mailEnabled": + if v != nil { + var mailEnabled bool + err = json.Unmarshal(*v, &mailEnabled) + if err != nil { + return err + } + ag.MailEnabled = &mailEnabled + } + case "mailNickname": + if v != nil { + var mailNickname string + err = json.Unmarshal(*v, &mailNickname) + if err != nil { + return err + } + ag.MailNickname = &mailNickname + } case "securityEnabled": if v != nil { var securityEnabled bool @@ -517,6 +313,8 @@ type Application struct { autorest.Response `json:"-"` // AppID - The application ID. AppID *string `json:"appId,omitempty"` + // AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals. + AppRoles *[]AppRole `json:"appRoles,omitempty"` // AppPermissions - The application permissions. AppPermissions *[]string `json:"appPermissions,omitempty"` // AvailableToOtherTenants - Whether the application is be available to other tenants. @@ -531,6 +329,12 @@ type Application struct { Homepage *string `json:"homepage,omitempty"` // Oauth2AllowImplicitFlow - Whether to allow implicit grant flow for OAuth2 Oauth2AllowImplicitFlow *bool `json:"oauth2AllowImplicitFlow,omitempty"` + // RequiredResourceAccess - Specifies resources that this application requires access to and the set of OAuth permission scopes and application roles that it needs under each of those resources. This pre-configuration of required resource access drives the consent experience. + RequiredResourceAccess *[]RequiredResourceAccess `json:"requiredResourceAccess,omitempty"` + // KeyCredentials - A collection of KeyCredential objects. + KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"` + // PasswordCredentials - A collection of PasswordCredential objects + PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` // ObjectID - The object ID. @@ -548,6 +352,9 @@ func (a Application) MarshalJSON() ([]byte, error) { if a.AppID != nil { objectMap["appId"] = a.AppID } + if a.AppRoles != nil { + objectMap["appRoles"] = a.AppRoles + } if a.AppPermissions != nil { objectMap["appPermissions"] = a.AppPermissions } @@ -569,6 +376,15 @@ func (a Application) MarshalJSON() ([]byte, error) { if a.Oauth2AllowImplicitFlow != nil { objectMap["oauth2AllowImplicitFlow"] = a.Oauth2AllowImplicitFlow } + if a.RequiredResourceAccess != nil { + objectMap["requiredResourceAccess"] = a.RequiredResourceAccess + } + if a.KeyCredentials != nil { + objectMap["keyCredentials"] = a.KeyCredentials + } + if a.PasswordCredentials != nil { + objectMap["passwordCredentials"] = a.PasswordCredentials + } if a.ObjectID != nil { objectMap["objectId"] = a.ObjectID } @@ -632,6 +448,15 @@ func (a *Application) UnmarshalJSON(body []byte) error { } a.AppID = &appID } + case "appRoles": + if v != nil { + var appRoles []AppRole + err = json.Unmarshal(*v, &appRoles) + if err != nil { + return err + } + a.AppRoles = &appRoles + } case "appPermissions": if v != nil { var appPermissions []string @@ -695,100 +520,71 @@ func (a *Application) UnmarshalJSON(body []byte) error { } a.Oauth2AllowImplicitFlow = &oauth2AllowImplicitFlow } - default: + case "requiredResourceAccess": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var requiredResourceAccess []RequiredResourceAccess + err = json.Unmarshal(*v, &requiredResourceAccess) if err != nil { return err } - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[k] = additionalProperties + a.RequiredResourceAccess = &requiredResourceAccess } - case "objectId": + case "keyCredentials": if v != nil { - var objectID string - err = json.Unmarshal(*v, &objectID) + var keyCredentials []KeyCredential + err = json.Unmarshal(*v, &keyCredentials) if err != nil { return err } - a.ObjectID = &objectID + a.KeyCredentials = &keyCredentials } - case "deletionTimestamp": + case "passwordCredentials": if v != nil { - var deletionTimestamp date.Time - err = json.Unmarshal(*v, &deletionTimestamp) + var passwordCredentials []PasswordCredential + err = json.Unmarshal(*v, &passwordCredentials) if err != nil { return err } - a.DeletionTimestamp = &deletionTimestamp + a.PasswordCredentials = &passwordCredentials } - case "objectType": + default: if v != nil { - var objectType ObjectType - err = json.Unmarshal(*v, &objectType) + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) if err != nil { return err } - a.ObjectType = objectType - } - } - } - - return nil -} - -// ApplicationAddOwnerParameters request parameters for adding a owner to an application. -type ApplicationAddOwnerParameters struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - // URL - A owner object URL, such as "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the owner (user, application, servicePrincipal, group) to be added. - URL *string `json:"url,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationAddOwnerParameters. -func (aaop ApplicationAddOwnerParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aaop.URL != nil { - objectMap["url"] = aaop.URL - } - for k, v := range aaop.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationAddOwnerParameters struct. -func (aaop *ApplicationAddOwnerParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - default: + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[k] = additionalProperties + } + case "objectId": if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) + var objectID string + err = json.Unmarshal(*v, &objectID) if err != nil { return err } - if aaop.AdditionalProperties == nil { - aaop.AdditionalProperties = make(map[string]interface{}) + a.ObjectID = &objectID + } + case "deletionTimestamp": + if v != nil { + var deletionTimestamp date.Time + err = json.Unmarshal(*v, &deletionTimestamp) + if err != nil { + return err } - aaop.AdditionalProperties[k] = additionalProperties + a.DeletionTimestamp = &deletionTimestamp } - case "url": + case "objectType": if v != nil { - var URL string - err = json.Unmarshal(*v, &URL) + var objectType ObjectType + err = json.Unmarshal(*v, &objectType) if err != nil { return err } - aaop.URL = &URL + a.ObjectType = objectType } } } @@ -800,6 +596,8 @@ func (aaop *ApplicationAddOwnerParameters) UnmarshalJSON(body []byte) error { type ApplicationCreateParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` + // AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals. + AppRoles *[]AppRole `json:"appRoles,omitempty"` // AvailableToOtherTenants - Whether the application is available to other tenants. AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"` // DisplayName - The display name of the application. @@ -823,6 +621,9 @@ type ApplicationCreateParameters struct { // MarshalJSON is the custom marshaler for ApplicationCreateParameters. func (acp ApplicationCreateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if acp.AppRoles != nil { + objectMap["appRoles"] = acp.AppRoles + } if acp.AvailableToOtherTenants != nil { objectMap["availableToOtherTenants"] = acp.AvailableToOtherTenants } @@ -877,6 +678,15 @@ func (acp *ApplicationCreateParameters) UnmarshalJSON(body []byte) error { } acp.AdditionalProperties[k] = additionalProperties } + case "appRoles": + if v != nil { + var appRoles []AppRole + err = json.Unmarshal(*v, &appRoles) + if err != nil { + return err + } + acp.AppRoles = &appRoles + } case "availableToOtherTenants": if v != nil { var availableToOtherTenants bool @@ -979,14 +789,24 @@ type ApplicationListResultIterator struct { page ApplicationListResultPage } -// Next advances to the next value. If there was an error making +// NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ApplicationListResultIterator) Next() error { +func (iter *ApplicationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } iter.i++ if iter.i < len(iter.page.Values()) { return nil } - err := iter.page.Next() + err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err @@ -995,6 +815,13 @@ func (iter *ApplicationListResultIterator) Next() error { return nil } +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ApplicationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + // NotDone returns true if the enumeration should be started or is not yet complete. func (iter ApplicationListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) @@ -1014,6 +841,11 @@ func (iter ApplicationListResultIterator) Value() Application { return iter.page.Values()[iter.i] } +// Creates a new instance of the ApplicationListResultIterator type. +func NewApplicationListResultIterator(page ApplicationListResultPage) ApplicationListResultIterator { + return ApplicationListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (alr ApplicationListResult) IsEmpty() bool { return alr.Value == nil || len(*alr.Value) == 0 @@ -1021,14 +853,24 @@ func (alr ApplicationListResult) IsEmpty() bool { // ApplicationListResultPage contains a page of Application values. type ApplicationListResultPage struct { - fn func(ApplicationListResult) (ApplicationListResult, error) + fn func(context.Context, ApplicationListResult) (ApplicationListResult, error) alr ApplicationListResult } -// Next advances to the next page of values. If there was an error making +// NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ApplicationListResultPage) Next() error { - next, err := page.fn(page.alr) +func (page *ApplicationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.alr) if err != nil { return err } @@ -1036,6 +878,13 @@ func (page *ApplicationListResultPage) Next() error { return nil } +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ApplicationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + // NotDone returns true if the page enumeration should be started or is not yet complete. func (page ApplicationListResultPage) NotDone() bool { return !page.alr.IsEmpty() @@ -1054,10 +903,17 @@ func (page ApplicationListResultPage) Values() []Application { return *page.alr.Value } +// Creates a new instance of the ApplicationListResultPage type. +func NewApplicationListResultPage(getNextPage func(context.Context, ApplicationListResult) (ApplicationListResult, error)) ApplicationListResultPage { + return ApplicationListResultPage{fn: getNextPage} +} + // ApplicationUpdateParameters request parameters for updating an existing application. type ApplicationUpdateParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` + // AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals. + AppRoles *[]AppRole `json:"appRoles,omitempty"` // AvailableToOtherTenants - Whether the application is available to other tenants AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"` // DisplayName - The display name of the application. @@ -1081,6 +937,9 @@ type ApplicationUpdateParameters struct { // MarshalJSON is the custom marshaler for ApplicationUpdateParameters. func (aup ApplicationUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if aup.AppRoles != nil { + objectMap["appRoles"] = aup.AppRoles + } if aup.AvailableToOtherTenants != nil { objectMap["availableToOtherTenants"] = aup.AvailableToOtherTenants } @@ -1135,6 +994,15 @@ func (aup *ApplicationUpdateParameters) UnmarshalJSON(body []byte) error { } aup.AdditionalProperties[k] = additionalProperties } + case "appRoles": + if v != nil { + var appRoles []AppRole + err = json.Unmarshal(*v, &appRoles) + if err != nil { + return err + } + aup.AppRoles = &appRoles + } case "availableToOtherTenants": if v != nil { var availableToOtherTenants bool @@ -1222,6 +1090,22 @@ func (aup *ApplicationUpdateParameters) UnmarshalJSON(body []byte) error { return nil } +// AppRole ... +type AppRole struct { + // ID - Unique role identifier inside the appRoles collection. + ID *string `json:"id,omitempty"` + // AllowedMemberTypes - Specifies whether this app role definition can be assigned to users and groups by setting to 'User', or to other applications (that are accessing this application in daemon service scenarios) by setting to 'Application', or to both. + AllowedMemberTypes *[]string `json:"allowedMemberTypes,omitempty"` + // Description - Permission help text that appears in the admin app assignment and consent experiences. + Description *string `json:"description,omitempty"` + // DisplayName - Display name for the permission that appears in the admin consent and app assignment experiences. + DisplayName *string `json:"displayName,omitempty"` + // IsEnabled - When creating or updating a role definition, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. + IsEnabled *bool `json:"isEnabled,omitempty"` + // Value - Specifies the value of the roles claim that the application should expect in the authentication and access tokens. + Value *string `json:"value,omitempty"` +} + // CheckGroupMembershipParameters request parameters for IsMemberOf API call. type CheckGroupMembershipParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -1527,6 +1411,8 @@ type DirectoryObjectListResult struct { autorest.Response `json:"-"` // Value - A collection of DirectoryObject. Value *[]BasicDirectoryObject `json:"value,omitempty"` + // OdataNextLink - The URL to get the next set of results. + OdataNextLink *string `json:"odata.nextLink,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DirectoryObjectListResult struct. @@ -1546,12 +1432,158 @@ func (dolr *DirectoryObjectListResult) UnmarshalJSON(body []byte) error { } dolr.Value = &value } + case "odata.nextLink": + if v != nil { + var odataNextLink string + err = json.Unmarshal(*v, &odataNextLink) + if err != nil { + return err + } + dolr.OdataNextLink = &odataNextLink + } } } return nil } +// DirectoryObjectListResultIterator provides access to a complete listing of DirectoryObject values. +type DirectoryObjectListResultIterator struct { + i int + page DirectoryObjectListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DirectoryObjectListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DirectoryObjectListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DirectoryObjectListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DirectoryObjectListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DirectoryObjectListResultIterator) Response() DirectoryObjectListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DirectoryObjectListResultIterator) Value() BasicDirectoryObject { + if !iter.page.NotDone() { + return DirectoryObject{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DirectoryObjectListResultIterator type. +func NewDirectoryObjectListResultIterator(page DirectoryObjectListResultPage) DirectoryObjectListResultIterator { + return DirectoryObjectListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dolr DirectoryObjectListResult) IsEmpty() bool { + return dolr.Value == nil || len(*dolr.Value) == 0 +} + +// directoryObjectListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dolr DirectoryObjectListResult) directoryObjectListResultPreparer(ctx context.Context) (*http.Request, error) { + if dolr.OdataNextLink == nil || len(to.String(dolr.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dolr.OdataNextLink))) +} + +// DirectoryObjectListResultPage contains a page of BasicDirectoryObject values. +type DirectoryObjectListResultPage struct { + fn func(context.Context, DirectoryObjectListResult) (DirectoryObjectListResult, error) + dolr DirectoryObjectListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DirectoryObjectListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DirectoryObjectListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.dolr) + if err != nil { + return err + } + page.dolr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DirectoryObjectListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DirectoryObjectListResultPage) NotDone() bool { + return !page.dolr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DirectoryObjectListResultPage) Response() DirectoryObjectListResult { + return page.dolr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DirectoryObjectListResultPage) Values() []BasicDirectoryObject { + if page.dolr.IsEmpty() { + return nil + } + return *page.dolr.Value +} + +// Creates a new instance of the DirectoryObjectListResultPage type. +func NewDirectoryObjectListResultPage(getNextPage func(context.Context, DirectoryObjectListResult) (DirectoryObjectListResult, error)) DirectoryObjectListResultPage { + return DirectoryObjectListResultPage{fn: getNextPage} +} + // Domain active Directory Domain information. type Domain struct { autorest.Response `json:"-"` @@ -1748,96 +1780,6 @@ func (gop *GetObjectsParameters) UnmarshalJSON(body []byte) error { return nil } -// GetObjectsResult the response to an Active Directory object inquiry API request. -type GetObjectsResult struct { - autorest.Response `json:"-"` - // Value - A collection of Active Directory objects. - Value *[]AADObject `json:"value,omitempty"` - // OdataNextLink - The URL to get the next set of results. - OdataNextLink *string `json:"odata.nextLink,omitempty"` -} - -// GetObjectsResultIterator provides access to a complete listing of AADObject values. -type GetObjectsResultIterator struct { - i int - page GetObjectsResultPage -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GetObjectsResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GetObjectsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GetObjectsResultIterator) Response() GetObjectsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GetObjectsResultIterator) Value() AADObject { - if !iter.page.NotDone() { - return AADObject{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (gor GetObjectsResult) IsEmpty() bool { - return gor.Value == nil || len(*gor.Value) == 0 -} - -// GetObjectsResultPage contains a page of AADObject values. -type GetObjectsResultPage struct { - fn func(GetObjectsResult) (GetObjectsResult, error) - gor GetObjectsResult -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GetObjectsResultPage) Next() error { - next, err := page.fn(page.gor) - if err != nil { - return err - } - page.gor = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GetObjectsResultPage) NotDone() bool { - return !page.gor.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GetObjectsResultPage) Response() GetObjectsResult { - return page.gor -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GetObjectsResultPage) Values() []AADObject { - if page.gor.IsEmpty() { - return nil - } - return *page.gor.Value -} - // GraphError active Directory error information. type GraphError struct { // OdataError - A Graph API error. @@ -2109,14 +2051,24 @@ type GroupListResultIterator struct { page GroupListResultPage } -// Next advances to the next value. If there was an error making +// NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *GroupListResultIterator) Next() error { +func (iter *GroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } iter.i++ if iter.i < len(iter.page.Values()) { return nil } - err := iter.page.Next() + err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err @@ -2125,6 +2077,13 @@ func (iter *GroupListResultIterator) Next() error { return nil } +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *GroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + // NotDone returns true if the enumeration should be started or is not yet complete. func (iter GroupListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) @@ -2144,6 +2103,11 @@ func (iter GroupListResultIterator) Value() ADGroup { return iter.page.Values()[iter.i] } +// Creates a new instance of the GroupListResultIterator type. +func NewGroupListResultIterator(page GroupListResultPage) GroupListResultIterator { + return GroupListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (glr GroupListResult) IsEmpty() bool { return glr.Value == nil || len(*glr.Value) == 0 @@ -2151,14 +2115,24 @@ func (glr GroupListResult) IsEmpty() bool { // GroupListResultPage contains a page of ADGroup values. type GroupListResultPage struct { - fn func(GroupListResult) (GroupListResult, error) + fn func(context.Context, GroupListResult) (GroupListResult, error) glr GroupListResult } -// Next advances to the next page of values. If there was an error making +// NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *GroupListResultPage) Next() error { - next, err := page.fn(page.glr) +func (page *GroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.glr) if err != nil { return err } @@ -2166,6 +2140,13 @@ func (page *GroupListResultPage) Next() error { return nil } +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *GroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + // NotDone returns true if the page enumeration should be started or is not yet complete. func (page GroupListResultPage) NotDone() bool { return !page.glr.IsEmpty() @@ -2184,6 +2165,11 @@ func (page GroupListResultPage) Values() []ADGroup { return *page.glr.Value } +// Creates a new instance of the GroupListResultPage type. +func NewGroupListResultPage(getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage { + return GroupListResultPage{fn: getNextPage} +} + // KeyCredential active Directory Key Credential information. type KeyCredential struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -2201,7 +2187,7 @@ type KeyCredential struct { // Type - Type. Acceptable values are 'AsymmetricX509Cert' and 'Symmetric'. Type *string `json:"type,omitempty"` // CustomKeyIdentifier - Custom Key Identifier - CustomKeyIdentifier *[]byte `json:"customKeyIdentifier,omitempty"` + CustomKeyIdentifier *string `json:"customKeyIdentifier,omitempty"` } // MarshalJSON is the custom marshaler for KeyCredential. @@ -2311,7 +2297,7 @@ func (kc *KeyCredential) UnmarshalJSON(body []byte) error { } case "customKeyIdentifier": if v != nil { - var customKeyIdentifier []byte + var customKeyIdentifier string err = json.Unmarshal(*v, &customKeyIdentifier) if err != nil { return err @@ -2402,6 +2388,8 @@ type PasswordCredential struct { KeyID *string `json:"keyId,omitempty"` // Value - Key value. Value *string `json:"value,omitempty"` + // CustomKeyIdentifier - Custom Key Identifier + CustomKeyIdentifier *[]byte `json:"customKeyIdentifier,omitempty"` } // MarshalJSON is the custom marshaler for PasswordCredential. @@ -2419,6 +2407,9 @@ func (pc PasswordCredential) MarshalJSON() ([]byte, error) { if pc.Value != nil { objectMap["value"] = pc.Value } + if pc.CustomKeyIdentifier != nil { + objectMap["customKeyIdentifier"] = pc.CustomKeyIdentifier + } for k, v := range pc.AdditionalProperties { objectMap[k] = v } @@ -2482,6 +2473,15 @@ func (pc *PasswordCredential) UnmarshalJSON(body []byte) error { } pc.Value = &value } + case "customKeyIdentifier": + if v != nil { + var customKeyIdentifier []byte + err = json.Unmarshal(*v, &customKeyIdentifier) + if err != nil { + return err + } + pc.CustomKeyIdentifier = &customKeyIdentifier + } } } @@ -2592,10 +2592,11 @@ type Permissions struct { ExpiryTime *string `json:"expiryTime,omitempty"` } -// RequiredResourceAccess specifies the set of OAuth 2.0 permission scopes and app roles under the specified -// resource that an application requires access to. The specified OAuth 2.0 permission scopes may be requested by -// client applications (through the requiredResourceAccess collection) when calling a resource application. The -// requiredResourceAccess property of the Application entity is a collection of ReqiredResourceAccess. +// RequiredResourceAccess specifies the set of OAuth 2.0 permission scopes and app roles under the +// specified resource that an application requires access to. The specified OAuth 2.0 permission scopes may +// be requested by client applications (through the requiredResourceAccess collection) when calling a +// resource application. The requiredResourceAccess property of the Application entity is a collection of +// RequiredResourceAccess. type RequiredResourceAccess struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` @@ -2743,6 +2744,8 @@ type ServicePrincipal struct { DisplayName *string `json:"displayName,omitempty"` // AppID - The application ID. AppID *string `json:"appId,omitempty"` + // AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals. + AppRoles *[]AppRole `json:"appRoles,omitempty"` // ServicePrincipalNames - A collection of service principal names. ServicePrincipalNames *[]string `json:"servicePrincipalNames,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -2765,6 +2768,9 @@ func (sp ServicePrincipal) MarshalJSON() ([]byte, error) { if sp.AppID != nil { objectMap["appId"] = sp.AppID } + if sp.AppRoles != nil { + objectMap["appRoles"] = sp.AppRoles + } if sp.ServicePrincipalNames != nil { objectMap["servicePrincipalNames"] = sp.ServicePrincipalNames } @@ -2840,6 +2846,15 @@ func (sp *ServicePrincipal) UnmarshalJSON(body []byte) error { } sp.AppID = &appID } + case "appRoles": + if v != nil { + var appRoles []AppRole + err = json.Unmarshal(*v, &appRoles) + if err != nil { + return err + } + sp.AppRoles = &appRoles + } case "servicePrincipalNames": if v != nil { var servicePrincipalNames []string @@ -2898,24 +2913,51 @@ func (sp *ServicePrincipal) UnmarshalJSON(body []byte) error { type ServicePrincipalCreateParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // AppID - application Id - AppID *string `json:"appId,omitempty"` // AccountEnabled - Whether the account is enabled AccountEnabled *bool `json:"accountEnabled,omitempty"` + // AppID - application Id + AppID *string `json:"appId,omitempty"` + // AppRoleAssignmentRequired - Specifies whether an AppRoleAssignment to a user or group is required before Azure AD will issue a user or access token to the application. + AppRoleAssignmentRequired *bool `json:"appRoleAssignmentRequired,omitempty"` + // DisplayName - The display name for the service principal. + DisplayName *string `json:"displayName,omitempty"` + ErrorURL *string `json:"errorUrl,omitempty"` + // Homepage - The URL to the homepage of the associated application. + Homepage *string `json:"homepage,omitempty"` // KeyCredentials - A collection of KeyCredential objects. KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"` // PasswordCredentials - A collection of PasswordCredential objects PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"` + // PublisherName - The display name of the tenant in which the associated application is specified. + PublisherName *string `json:"publisherName,omitempty"` + // ReplyUrls - A collection of reply URLs for the service principal. + ReplyUrls *[]string `json:"replyUrls,omitempty"` + SamlMetadataURL *string `json:"samlMetadataUrl,omitempty"` + // ServicePrincipalNames - A collection of service principal names. + ServicePrincipalNames *[]string `json:"servicePrincipalNames,omitempty"` + Tags *[]string `json:"tags,omitempty"` } // MarshalJSON is the custom marshaler for ServicePrincipalCreateParameters. func (spcp ServicePrincipalCreateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if spcp.AccountEnabled != nil { + objectMap["accountEnabled"] = spcp.AccountEnabled + } if spcp.AppID != nil { objectMap["appId"] = spcp.AppID } - if spcp.AccountEnabled != nil { - objectMap["accountEnabled"] = spcp.AccountEnabled + if spcp.AppRoleAssignmentRequired != nil { + objectMap["appRoleAssignmentRequired"] = spcp.AppRoleAssignmentRequired + } + if spcp.DisplayName != nil { + objectMap["displayName"] = spcp.DisplayName + } + if spcp.ErrorURL != nil { + objectMap["errorUrl"] = spcp.ErrorURL + } + if spcp.Homepage != nil { + objectMap["homepage"] = spcp.Homepage } if spcp.KeyCredentials != nil { objectMap["keyCredentials"] = spcp.KeyCredentials @@ -2923,6 +2965,21 @@ func (spcp ServicePrincipalCreateParameters) MarshalJSON() ([]byte, error) { if spcp.PasswordCredentials != nil { objectMap["passwordCredentials"] = spcp.PasswordCredentials } + if spcp.PublisherName != nil { + objectMap["publisherName"] = spcp.PublisherName + } + if spcp.ReplyUrls != nil { + objectMap["replyUrls"] = spcp.ReplyUrls + } + if spcp.SamlMetadataURL != nil { + objectMap["samlMetadataUrl"] = spcp.SamlMetadataURL + } + if spcp.ServicePrincipalNames != nil { + objectMap["servicePrincipalNames"] = spcp.ServicePrincipalNames + } + if spcp.Tags != nil { + objectMap["tags"] = spcp.Tags + } for k, v := range spcp.AdditionalProperties { objectMap[k] = v } @@ -2950,6 +3007,15 @@ func (spcp *ServicePrincipalCreateParameters) UnmarshalJSON(body []byte) error { } spcp.AdditionalProperties[k] = additionalProperties } + case "accountEnabled": + if v != nil { + var accountEnabled bool + err = json.Unmarshal(*v, &accountEnabled) + if err != nil { + return err + } + spcp.AccountEnabled = &accountEnabled + } case "appId": if v != nil { var appID string @@ -2959,14 +3025,41 @@ func (spcp *ServicePrincipalCreateParameters) UnmarshalJSON(body []byte) error { } spcp.AppID = &appID } - case "accountEnabled": + case "appRoleAssignmentRequired": if v != nil { - var accountEnabled bool - err = json.Unmarshal(*v, &accountEnabled) + var appRoleAssignmentRequired bool + err = json.Unmarshal(*v, &appRoleAssignmentRequired) if err != nil { return err } - spcp.AccountEnabled = &accountEnabled + spcp.AppRoleAssignmentRequired = &appRoleAssignmentRequired + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + spcp.DisplayName = &displayName + } + case "errorUrl": + if v != nil { + var errorURL string + err = json.Unmarshal(*v, &errorURL) + if err != nil { + return err + } + spcp.ErrorURL = &errorURL + } + case "homepage": + if v != nil { + var homepage string + err = json.Unmarshal(*v, &homepage) + if err != nil { + return err + } + spcp.Homepage = &homepage } case "keyCredentials": if v != nil { @@ -2986,6 +3079,51 @@ func (spcp *ServicePrincipalCreateParameters) UnmarshalJSON(body []byte) error { } spcp.PasswordCredentials = &passwordCredentials } + case "publisherName": + if v != nil { + var publisherName string + err = json.Unmarshal(*v, &publisherName) + if err != nil { + return err + } + spcp.PublisherName = &publisherName + } + case "replyUrls": + if v != nil { + var replyUrls []string + err = json.Unmarshal(*v, &replyUrls) + if err != nil { + return err + } + spcp.ReplyUrls = &replyUrls + } + case "samlMetadataUrl": + if v != nil { + var samlMetadataURL string + err = json.Unmarshal(*v, &samlMetadataURL) + if err != nil { + return err + } + spcp.SamlMetadataURL = &samlMetadataURL + } + case "servicePrincipalNames": + if v != nil { + var servicePrincipalNames []string + err = json.Unmarshal(*v, &servicePrincipalNames) + if err != nil { + return err + } + spcp.ServicePrincipalNames = &servicePrincipalNames + } + case "tags": + if v != nil { + var tags []string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + spcp.Tags = &tags + } } } @@ -3007,14 +3145,24 @@ type ServicePrincipalListResultIterator struct { page ServicePrincipalListResultPage } -// Next advances to the next value. If there was an error making +// NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ServicePrincipalListResultIterator) Next() error { +func (iter *ServicePrincipalListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } iter.i++ if iter.i < len(iter.page.Values()) { return nil } - err := iter.page.Next() + err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err @@ -3023,6 +3171,13 @@ func (iter *ServicePrincipalListResultIterator) Next() error { return nil } +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ServicePrincipalListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + // NotDone returns true if the enumeration should be started or is not yet complete. func (iter ServicePrincipalListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) @@ -3042,6 +3197,11 @@ func (iter ServicePrincipalListResultIterator) Value() ServicePrincipal { return iter.page.Values()[iter.i] } +// Creates a new instance of the ServicePrincipalListResultIterator type. +func NewServicePrincipalListResultIterator(page ServicePrincipalListResultPage) ServicePrincipalListResultIterator { + return ServicePrincipalListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (splr ServicePrincipalListResult) IsEmpty() bool { return splr.Value == nil || len(*splr.Value) == 0 @@ -3049,14 +3209,24 @@ func (splr ServicePrincipalListResult) IsEmpty() bool { // ServicePrincipalListResultPage contains a page of ServicePrincipal values. type ServicePrincipalListResultPage struct { - fn func(ServicePrincipalListResult) (ServicePrincipalListResult, error) + fn func(context.Context, ServicePrincipalListResult) (ServicePrincipalListResult, error) splr ServicePrincipalListResult } -// Next advances to the next page of values. If there was an error making +// NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ServicePrincipalListResultPage) Next() error { - next, err := page.fn(page.splr) +func (page *ServicePrincipalListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.splr) if err != nil { return err } @@ -3064,6 +3234,13 @@ func (page *ServicePrincipalListResultPage) Next() error { return nil } +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ServicePrincipalListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + // NotDone returns true if the page enumeration should be started or is not yet complete. func (page ServicePrincipalListResultPage) NotDone() bool { return !page.splr.IsEmpty() @@ -3082,8 +3259,234 @@ func (page ServicePrincipalListResultPage) Values() []ServicePrincipal { return *page.splr.Value } -// SignInName contains information about a sign-in name of a local account user in an Azure Active Directory B2C -// tenant. +// Creates a new instance of the ServicePrincipalListResultPage type. +func NewServicePrincipalListResultPage(getNextPage func(context.Context, ServicePrincipalListResult) (ServicePrincipalListResult, error)) ServicePrincipalListResultPage { + return ServicePrincipalListResultPage{fn: getNextPage} +} + +// ServicePrincipalUpdateParameters request parameters for creating a new service principal. +type ServicePrincipalUpdateParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // AccountEnabled - Whether the account is enabled + AccountEnabled *bool `json:"accountEnabled,omitempty"` + // AppID - application Id + AppID *string `json:"appId,omitempty"` + // AppRoleAssignmentRequired - Specifies whether an AppRoleAssignment to a user or group is required before Azure AD will issue a user or access token to the application. + AppRoleAssignmentRequired *bool `json:"appRoleAssignmentRequired,omitempty"` + // DisplayName - The display name for the service principal. + DisplayName *string `json:"displayName,omitempty"` + ErrorURL *string `json:"errorUrl,omitempty"` + // Homepage - The URL to the homepage of the associated application. + Homepage *string `json:"homepage,omitempty"` + // KeyCredentials - A collection of KeyCredential objects. + KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"` + // PasswordCredentials - A collection of PasswordCredential objects + PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"` + // PublisherName - The display name of the tenant in which the associated application is specified. + PublisherName *string `json:"publisherName,omitempty"` + // ReplyUrls - A collection of reply URLs for the service principal. + ReplyUrls *[]string `json:"replyUrls,omitempty"` + SamlMetadataURL *string `json:"samlMetadataUrl,omitempty"` + // ServicePrincipalNames - A collection of service principal names. + ServicePrincipalNames *[]string `json:"servicePrincipalNames,omitempty"` + Tags *[]string `json:"tags,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicePrincipalUpdateParameters. +func (spup ServicePrincipalUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spup.AccountEnabled != nil { + objectMap["accountEnabled"] = spup.AccountEnabled + } + if spup.AppID != nil { + objectMap["appId"] = spup.AppID + } + if spup.AppRoleAssignmentRequired != nil { + objectMap["appRoleAssignmentRequired"] = spup.AppRoleAssignmentRequired + } + if spup.DisplayName != nil { + objectMap["displayName"] = spup.DisplayName + } + if spup.ErrorURL != nil { + objectMap["errorUrl"] = spup.ErrorURL + } + if spup.Homepage != nil { + objectMap["homepage"] = spup.Homepage + } + if spup.KeyCredentials != nil { + objectMap["keyCredentials"] = spup.KeyCredentials + } + if spup.PasswordCredentials != nil { + objectMap["passwordCredentials"] = spup.PasswordCredentials + } + if spup.PublisherName != nil { + objectMap["publisherName"] = spup.PublisherName + } + if spup.ReplyUrls != nil { + objectMap["replyUrls"] = spup.ReplyUrls + } + if spup.SamlMetadataURL != nil { + objectMap["samlMetadataUrl"] = spup.SamlMetadataURL + } + if spup.ServicePrincipalNames != nil { + objectMap["servicePrincipalNames"] = spup.ServicePrincipalNames + } + if spup.Tags != nil { + objectMap["tags"] = spup.Tags + } + for k, v := range spup.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServicePrincipalUpdateParameters struct. +func (spup *ServicePrincipalUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if spup.AdditionalProperties == nil { + spup.AdditionalProperties = make(map[string]interface{}) + } + spup.AdditionalProperties[k] = additionalProperties + } + case "accountEnabled": + if v != nil { + var accountEnabled bool + err = json.Unmarshal(*v, &accountEnabled) + if err != nil { + return err + } + spup.AccountEnabled = &accountEnabled + } + case "appId": + if v != nil { + var appID string + err = json.Unmarshal(*v, &appID) + if err != nil { + return err + } + spup.AppID = &appID + } + case "appRoleAssignmentRequired": + if v != nil { + var appRoleAssignmentRequired bool + err = json.Unmarshal(*v, &appRoleAssignmentRequired) + if err != nil { + return err + } + spup.AppRoleAssignmentRequired = &appRoleAssignmentRequired + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + spup.DisplayName = &displayName + } + case "errorUrl": + if v != nil { + var errorURL string + err = json.Unmarshal(*v, &errorURL) + if err != nil { + return err + } + spup.ErrorURL = &errorURL + } + case "homepage": + if v != nil { + var homepage string + err = json.Unmarshal(*v, &homepage) + if err != nil { + return err + } + spup.Homepage = &homepage + } + case "keyCredentials": + if v != nil { + var keyCredentials []KeyCredential + err = json.Unmarshal(*v, &keyCredentials) + if err != nil { + return err + } + spup.KeyCredentials = &keyCredentials + } + case "passwordCredentials": + if v != nil { + var passwordCredentials []PasswordCredential + err = json.Unmarshal(*v, &passwordCredentials) + if err != nil { + return err + } + spup.PasswordCredentials = &passwordCredentials + } + case "publisherName": + if v != nil { + var publisherName string + err = json.Unmarshal(*v, &publisherName) + if err != nil { + return err + } + spup.PublisherName = &publisherName + } + case "replyUrls": + if v != nil { + var replyUrls []string + err = json.Unmarshal(*v, &replyUrls) + if err != nil { + return err + } + spup.ReplyUrls = &replyUrls + } + case "samlMetadataUrl": + if v != nil { + var samlMetadataURL string + err = json.Unmarshal(*v, &samlMetadataURL) + if err != nil { + return err + } + spup.SamlMetadataURL = &samlMetadataURL + } + case "servicePrincipalNames": + if v != nil { + var servicePrincipalNames []string + err = json.Unmarshal(*v, &servicePrincipalNames) + if err != nil { + return err + } + spup.ServicePrincipalNames = &servicePrincipalNames + } + case "tags": + if v != nil { + var tags []string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + spup.Tags = &tags + } + } + } + + return nil +} + +// SignInName contains information about a sign-in name of a local account user in an Azure Active +// Directory B2C tenant. type SignInName struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` @@ -3809,14 +4212,24 @@ type UserListResultIterator struct { page UserListResultPage } -// Next advances to the next value. If there was an error making +// NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *UserListResultIterator) Next() error { +func (iter *UserListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } iter.i++ if iter.i < len(iter.page.Values()) { return nil } - err := iter.page.Next() + err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err @@ -3825,6 +4238,13 @@ func (iter *UserListResultIterator) Next() error { return nil } +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *UserListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + // NotDone returns true if the enumeration should be started or is not yet complete. func (iter UserListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) @@ -3844,6 +4264,11 @@ func (iter UserListResultIterator) Value() User { return iter.page.Values()[iter.i] } +// Creates a new instance of the UserListResultIterator type. +func NewUserListResultIterator(page UserListResultPage) UserListResultIterator { + return UserListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (ulr UserListResult) IsEmpty() bool { return ulr.Value == nil || len(*ulr.Value) == 0 @@ -3851,14 +4276,24 @@ func (ulr UserListResult) IsEmpty() bool { // UserListResultPage contains a page of User values. type UserListResultPage struct { - fn func(UserListResult) (UserListResult, error) + fn func(context.Context, UserListResult) (UserListResult, error) ulr UserListResult } -// Next advances to the next page of values. If there was an error making +// NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *UserListResultPage) Next() error { - next, err := page.fn(page.ulr) +func (page *UserListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ulr) if err != nil { return err } @@ -3866,6 +4301,13 @@ func (page *UserListResultPage) Next() error { return nil } +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *UserListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + // NotDone returns true if the page enumeration should be started or is not yet complete. func (page UserListResultPage) NotDone() bool { return !page.ulr.IsEmpty() @@ -3884,6 +4326,11 @@ func (page UserListResultPage) Values() []User { return *page.ulr.Value } +// Creates a new instance of the UserListResultPage type. +func NewUserListResultPage(getNextPage func(context.Context, UserListResult) (UserListResult, error)) UserListResultPage { + return UserListResultPage{fn: getNextPage} +} + // UserUpdateParameters request parameters for updating an existing work or school account user. type UserUpdateParameters struct { // AccountEnabled - Whether the account is enabled. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2.go index 97d465bf13..97e79c76dd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -43,6 +44,16 @@ func NewOAuth2ClientWithBaseURI(baseURI string, tenantID string) OAuth2Client { // Parameters: // filter - this is the Service Principal ObjectId associated with the app func (client OAuth2Client) Get(ctx context.Context, filter string) (result Permissions, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OAuth2Client.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.GetPreparer(ctx, filter) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Get", nil, "Failure preparing request") @@ -106,33 +117,43 @@ func (client OAuth2Client) GetResponder(resp *http.Response) (result Permissions return } -// Post grants OAuth2 permissions for the relevant resource Ids of an app. +// Grant grants OAuth2 permissions for the relevant resource Ids of an app. // Parameters: -// body - the relevant app Service Principal Object Id and the Service Principal Objecit Id you want to grant. -func (client OAuth2Client) Post(ctx context.Context, body *Permissions) (result Permissions, err error) { - req, err := client.PostPreparer(ctx, body) +// body - the relevant app Service Principal Object Id and the Service Principal Object Id you want to grant. +func (client OAuth2Client) Grant(ctx context.Context, body *Permissions) (result Permissions, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OAuth2Client.Grant") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GrantPreparer(ctx, body) if err != nil { - err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Post", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Grant", nil, "Failure preparing request") return } - resp, err := client.PostSender(req) + resp, err := client.GrantSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Post", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Grant", resp, "Failure sending request") return } - result, err = client.PostResponder(resp) + result, err = client.GrantResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Post", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Grant", resp, "Failure responding to request") } return } -// PostPreparer prepares the Post request. -func (client OAuth2Client) PostPreparer(ctx context.Context, body *Permissions) (*http.Request, error) { +// GrantPreparer prepares the Grant request. +func (client OAuth2Client) GrantPreparer(ctx context.Context, body *Permissions) (*http.Request, error) { pathParameters := map[string]interface{}{ "tenantID": autorest.Encode("path", client.TenantID), } @@ -155,16 +176,16 @@ func (client OAuth2Client) PostPreparer(ctx context.Context, body *Permissions) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// PostSender sends the Post request. The method will close the +// GrantSender sends the Grant request. The method will close the // http.Response Body if it receives an error. -func (client OAuth2Client) PostSender(req *http.Request) (*http.Response, error) { +func (client OAuth2Client) GrantSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } -// PostResponder handles the response to the Post request. The method always +// GrantResponder handles the response to the Grant request. The method always // closes the http.Response Body. -func (client OAuth2Client) PostResponder(resp *http.Response) (result Permissions, err error) { +func (client OAuth2Client) GrantResponder(resp *http.Response) (result Permissions, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go index 638a0f02a1..04d3cc6395 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go @@ -22,7 +22,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -41,81 +41,24 @@ func NewObjectsClientWithBaseURI(baseURI string, tenantID string) ObjectsClient return ObjectsClient{NewWithBaseURI(baseURI, tenantID)} } -// GetCurrentUser gets the details for the currently logged-in user. -func (client ObjectsClient) GetCurrentUser(ctx context.Context) (result AADObject, err error) { - req, err := client.GetCurrentUserPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetCurrentUser", nil, "Failure preparing request") - return - } - - resp, err := client.GetCurrentUserSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetCurrentUser", resp, "Failure sending request") - return - } - - result, err = client.GetCurrentUserResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetCurrentUser", resp, "Failure responding to request") - } - - return -} - -// GetCurrentUserPreparer prepares the GetCurrentUser request. -func (client ObjectsClient) GetCurrentUserPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "tenantID": autorest.Encode("path", client.TenantID), - } - - const APIVersion = "1.6" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{tenantID}/me", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetCurrentUserSender sends the GetCurrentUser request. The method will close the -// http.Response Body if it receives an error. -func (client ObjectsClient) GetCurrentUserSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetCurrentUserResponder handles the response to the GetCurrentUser request. The method always -// closes the http.Response Body. -func (client ObjectsClient) GetCurrentUserResponder(resp *http.Response) (result AADObject, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetObjectsByObjectIds gets AD group membership for the specified AD object IDs. +// GetObjectsByObjectIds gets the directory objects specified in a list of object IDs. You can also specify which +// resource collections (users, groups, etc.) should be searched by specifying the optional types parameter. // Parameters: // parameters - objects filtering parameters. -func (client ObjectsClient) GetObjectsByObjectIds(ctx context.Context, parameters GetObjectsParameters) (result GetObjectsResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.IncludeDirectoryObjectReferences", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("graphrbac.ObjectsClient", "GetObjectsByObjectIds", err.Error()) - } - - result.fn = func(lastResult GetObjectsResult) (GetObjectsResult, error) { +func (client ObjectsClient) GetObjectsByObjectIds(ctx context.Context, parameters GetObjectsParameters) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ObjectsClient.GetObjectsByObjectIds") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult DirectoryObjectListResult) (DirectoryObjectListResult, error) { if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { - return GetObjectsResult{}, nil + return DirectoryObjectListResult{}, nil } return client.GetObjectsByObjectIdsNext(ctx, *lastResult.OdataNextLink) } @@ -127,12 +70,12 @@ func (client ObjectsClient) GetObjectsByObjectIds(ctx context.Context, parameter resp, err := client.GetObjectsByObjectIdsSender(req) if err != nil { - result.gor.Response = autorest.Response{Response: resp} + result.dolr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIds", resp, "Failure sending request") return } - result.gor, err = client.GetObjectsByObjectIdsResponder(resp) + result.dolr, err = client.GetObjectsByObjectIdsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIds", resp, "Failure responding to request") } @@ -170,7 +113,7 @@ func (client ObjectsClient) GetObjectsByObjectIdsSender(req *http.Request) (*htt // GetObjectsByObjectIdsResponder handles the response to the GetObjectsByObjectIds request. The method always // closes the http.Response Body. -func (client ObjectsClient) GetObjectsByObjectIdsResponder(resp *http.Response) (result GetObjectsResult, err error) { +func (client ObjectsClient) GetObjectsByObjectIdsResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -182,7 +125,17 @@ func (client ObjectsClient) GetObjectsByObjectIdsResponder(resp *http.Response) } // GetObjectsByObjectIdsComplete enumerates all values, automatically crossing page boundaries as required. -func (client ObjectsClient) GetObjectsByObjectIdsComplete(ctx context.Context, parameters GetObjectsParameters) (result GetObjectsResultIterator, err error) { +func (client ObjectsClient) GetObjectsByObjectIdsComplete(ctx context.Context, parameters GetObjectsParameters) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ObjectsClient.GetObjectsByObjectIds") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.GetObjectsByObjectIds(ctx, parameters) return } @@ -190,7 +143,17 @@ func (client ObjectsClient) GetObjectsByObjectIdsComplete(ctx context.Context, p // GetObjectsByObjectIdsNext gets AD group membership for the specified AD object IDs. // Parameters: // nextLink - next link for the list operation. -func (client ObjectsClient) GetObjectsByObjectIdsNext(ctx context.Context, nextLink string) (result GetObjectsResult, err error) { +func (client ObjectsClient) GetObjectsByObjectIdsNext(ctx context.Context, nextLink string) (result DirectoryObjectListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ObjectsClient.GetObjectsByObjectIdsNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.GetObjectsByObjectIdsNextPreparer(ctx, nextLink) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIdsNext", nil, "Failure preparing request") @@ -241,7 +204,7 @@ func (client ObjectsClient) GetObjectsByObjectIdsNextSender(req *http.Request) ( // GetObjectsByObjectIdsNextResponder handles the response to the GetObjectsByObjectIdsNext request. The method always // closes the http.Response Body. -func (client ObjectsClient) GetObjectsByObjectIdsNextResponder(resp *http.Response) (result GetObjectsResult, err error) { +func (client ObjectsClient) GetObjectsByObjectIdsNextResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go index 2b09eaf96d..bca9e9ed2e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go @@ -23,6 +23,7 @@ import ( "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -45,10 +46,19 @@ func NewServicePrincipalsClientWithBaseURI(baseURI string, tenantID string) Serv // Parameters: // parameters - parameters to create a service principal. func (client ServicePrincipalsClient) Create(ctx context.Context, parameters ServicePrincipalCreateParameters) (result ServicePrincipal, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.AppID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.AccountEnabled", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.AppID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("graphrbac.ServicePrincipalsClient", "Create", err.Error()) } @@ -118,6 +128,16 @@ func (client ServicePrincipalsClient) CreateResponder(resp *http.Response) (resu // Parameters: // objectID - the object ID of the service principal to delete. func (client ServicePrincipalsClient) Delete(ctx context.Context, objectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.DeletePreparer(ctx, objectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Delete", nil, "Failure preparing request") @@ -182,6 +202,16 @@ func (client ServicePrincipalsClient) DeleteResponder(resp *http.Response) (resu // Parameters: // objectID - the object ID of the service principal to get. func (client ServicePrincipalsClient) Get(ctx context.Context, objectID string) (result ServicePrincipal, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.GetPreparer(ctx, objectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Get", nil, "Failure preparing request") @@ -247,7 +277,17 @@ func (client ServicePrincipalsClient) GetResponder(resp *http.Response) (result // Parameters: // filter - the filter to apply to the operation. func (client ServicePrincipalsClient) List(ctx context.Context, filter string) (result ServicePrincipalListResultPage, err error) { - result.fn = func(lastResult ServicePrincipalListResult) (ServicePrincipalListResult, error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.List") + defer func() { + sc := -1 + if result.splr.Response.Response != nil { + sc = result.splr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult ServicePrincipalListResult) (ServicePrincipalListResult, error) { if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { return ServicePrincipalListResult{}, nil } @@ -318,6 +358,16 @@ func (client ServicePrincipalsClient) ListResponder(resp *http.Response) (result // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client ServicePrincipalsClient) ListComplete(ctx context.Context, filter string) (result ServicePrincipalListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.List(ctx, filter) return } @@ -326,6 +376,16 @@ func (client ServicePrincipalsClient) ListComplete(ctx context.Context, filter s // Parameters: // objectID - the object ID of the service principal for which to get keyCredentials. func (client ServicePrincipalsClient) ListKeyCredentials(ctx context.Context, objectID string) (result KeyCredentialListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.ListKeyCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.ListKeyCredentialsPreparer(ctx, objectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListKeyCredentials", nil, "Failure preparing request") @@ -391,6 +451,16 @@ func (client ServicePrincipalsClient) ListKeyCredentialsResponder(resp *http.Res // Parameters: // nextLink - next link for the list operation. func (client ServicePrincipalsClient) ListNext(ctx context.Context, nextLink string) (result ServicePrincipalListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.ListNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.ListNextPreparer(ctx, nextLink) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListNext", nil, "Failure preparing request") @@ -455,7 +525,18 @@ func (client ServicePrincipalsClient) ListNextResponder(resp *http.Response) (re // ListOwners the owners are a set of non-admin users who are allowed to modify this object. // Parameters: // objectID - the object ID of the service principal for which to get owners. -func (client ServicePrincipalsClient) ListOwners(ctx context.Context, objectID string) (result DirectoryObjectListResult, err error) { +func (client ServicePrincipalsClient) ListOwners(ctx context.Context, objectID string) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.ListOwners") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOwnersNextResults req, err := client.ListOwnersPreparer(ctx, objectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListOwners", nil, "Failure preparing request") @@ -464,12 +545,12 @@ func (client ServicePrincipalsClient) ListOwners(ctx context.Context, objectID s resp, err := client.ListOwnersSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.dolr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListOwners", resp, "Failure sending request") return } - result, err = client.ListOwnersResponder(resp) + result.dolr, err = client.ListOwnersResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListOwners", resp, "Failure responding to request") } @@ -517,10 +598,57 @@ func (client ServicePrincipalsClient) ListOwnersResponder(resp *http.Response) ( return } +// listOwnersNextResults retrieves the next set of results, if any. +func (client ServicePrincipalsClient) listOwnersNextResults(ctx context.Context, lastResults DirectoryObjectListResult) (result DirectoryObjectListResult, err error) { + req, err := lastResults.directoryObjectListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "listOwnersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOwnersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "listOwnersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOwnersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "listOwnersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOwnersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServicePrincipalsClient) ListOwnersComplete(ctx context.Context, objectID string) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.ListOwners") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOwners(ctx, objectID) + return +} + // ListPasswordCredentials gets the passwordCredentials associated with a service principal. // Parameters: // objectID - the object ID of the service principal. func (client ServicePrincipalsClient) ListPasswordCredentials(ctx context.Context, objectID string) (result PasswordCredentialListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.ListPasswordCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.ListPasswordCredentialsPreparer(ctx, objectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListPasswordCredentials", nil, "Failure preparing request") @@ -582,11 +710,98 @@ func (client ServicePrincipalsClient) ListPasswordCredentialsResponder(resp *htt return } +// Update updates a service principal in the directory. +// Parameters: +// objectID - the object ID of the service principal to delete. +// parameters - parameters to update a service principal. +func (client ServicePrincipalsClient) Update(ctx context.Context, objectID string, parameters ServicePrincipalUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.Update") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, objectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServicePrincipalsClient) UpdatePreparer(ctx context.Context, objectID string, parameters ServicePrincipalUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/servicePrincipals/{objectId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ServicePrincipalsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) UpdateResponder(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 +} + // UpdateKeyCredentials update the keyCredentials associated with a service principal. // Parameters: // objectID - the object ID for which to get service principal information. // parameters - parameters to update the keyCredentials of an existing service principal. func (client ServicePrincipalsClient) UpdateKeyCredentials(ctx context.Context, objectID string, parameters KeyCredentialsUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.UpdateKeyCredentials") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.UpdateKeyCredentialsPreparer(ctx, objectID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "UpdateKeyCredentials", nil, "Failure preparing request") @@ -654,6 +869,16 @@ func (client ServicePrincipalsClient) UpdateKeyCredentialsResponder(resp *http.R // objectID - the object ID of the service principal. // parameters - parameters to update the passwordCredentials of an existing service principal. func (client ServicePrincipalsClient) UpdatePasswordCredentials(ctx context.Context, objectID string, parameters PasswordCredentialsUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.UpdatePasswordCredentials") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.UpdatePasswordCredentialsPreparer(ctx, objectID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "UpdatePasswordCredentials", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go new file mode 100644 index 0000000000..3b89fca32d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go @@ -0,0 +1,283 @@ +package graphrbac + +// 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. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SignedInUserClient is the the Graph RBAC Management Client +type SignedInUserClient struct { + BaseClient +} + +// NewSignedInUserClient creates an instance of the SignedInUserClient client. +func NewSignedInUserClient(tenantID string) SignedInUserClient { + return NewSignedInUserClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewSignedInUserClientWithBaseURI creates an instance of the SignedInUserClient client. +func NewSignedInUserClientWithBaseURI(baseURI string, tenantID string) SignedInUserClient { + return SignedInUserClient{NewWithBaseURI(baseURI, tenantID)} +} + +// Get gets the details for the currently logged-in user. +func (client SignedInUserClient) Get(ctx context.Context) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SignedInUserClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SignedInUserClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/me", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SignedInUserClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SignedInUserClient) GetResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOwnedObjects get the list of directory objects that are owned by the user. +func (client SignedInUserClient) ListOwnedObjects(ctx context.Context) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SignedInUserClient.ListOwnedObjects") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult DirectoryObjectListResult) (DirectoryObjectListResult, error) { + if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { + return DirectoryObjectListResult{}, nil + } + return client.ListOwnedObjectsNext(ctx, *lastResult.OdataNextLink) + } + req, err := client.ListOwnedObjectsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjects", nil, "Failure preparing request") + return + } + + resp, err := client.ListOwnedObjectsSender(req) + if err != nil { + result.dolr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjects", resp, "Failure sending request") + return + } + + result.dolr, err = client.ListOwnedObjectsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjects", resp, "Failure responding to request") + } + + return +} + +// ListOwnedObjectsPreparer prepares the ListOwnedObjects request. +func (client SignedInUserClient) ListOwnedObjectsPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/me/ownedObjects", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOwnedObjectsSender sends the ListOwnedObjects request. The method will close the +// http.Response Body if it receives an error. +func (client SignedInUserClient) ListOwnedObjectsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOwnedObjectsResponder handles the response to the ListOwnedObjects request. The method always +// closes the http.Response Body. +func (client SignedInUserClient) ListOwnedObjectsResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOwnedObjectsComplete enumerates all values, automatically crossing page boundaries as required. +func (client SignedInUserClient) ListOwnedObjectsComplete(ctx context.Context) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SignedInUserClient.ListOwnedObjects") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOwnedObjects(ctx) + return +} + +// ListOwnedObjectsNext get the list of directory objects that are owned by the user. +// Parameters: +// nextLink - next link for the list operation. +func (client SignedInUserClient) ListOwnedObjectsNext(ctx context.Context, nextLink string) (result DirectoryObjectListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SignedInUserClient.ListOwnedObjectsNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListOwnedObjectsNextPreparer(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjectsNext", nil, "Failure preparing request") + return + } + + resp, err := client.ListOwnedObjectsNextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjectsNext", resp, "Failure sending request") + return + } + + result, err = client.ListOwnedObjectsNextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjectsNext", resp, "Failure responding to request") + } + + return +} + +// ListOwnedObjectsNextPreparer prepares the ListOwnedObjectsNext request. +func (client SignedInUserClient) ListOwnedObjectsNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nextLink": nextLink, + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOwnedObjectsNextSender sends the ListOwnedObjectsNext request. The method will close the +// http.Response Body if it receives an error. +func (client SignedInUserClient) ListOwnedObjectsNextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOwnedObjectsNextResponder handles the response to the ListOwnedObjectsNext request. The method always +// closes the http.Response Body. +func (client SignedInUserClient) ListOwnedObjectsNextResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go index 9d0cd833ad..a2ef210a27 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go @@ -23,6 +23,7 @@ import ( "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -45,6 +46,16 @@ func NewUsersClientWithBaseURI(baseURI string, tenantID string) UsersClient { // Parameters: // parameters - parameters to create a user. func (client UsersClient) Create(ctx context.Context, parameters UserCreateParameters) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.AccountEnabled", Name: validation.Null, Rule: true, Chain: nil}, @@ -122,6 +133,16 @@ func (client UsersClient) CreateResponder(resp *http.Response) (result User, err // Parameters: // upnOrObjectID - the object ID or principal name of the user to delete. func (client UsersClient) Delete(ctx context.Context, upnOrObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.DeletePreparer(ctx, upnOrObjectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Delete", nil, "Failure preparing request") @@ -186,6 +207,16 @@ func (client UsersClient) DeleteResponder(resp *http.Response) (result autorest. // Parameters: // upnOrObjectID - the object ID or principal name of the user for which to get information. func (client UsersClient) Get(ctx context.Context, upnOrObjectID string) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.GetPreparer(ctx, upnOrObjectID) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Get", nil, "Failure preparing request") @@ -252,6 +283,16 @@ func (client UsersClient) GetResponder(resp *http.Response) (result User, err er // objectID - the object ID of the user for which to get group membership. // parameters - user filtering parameters. func (client UsersClient) GetMemberGroups(ctx context.Context, objectID string, parameters UserGetMemberGroupsParameters) (result UserGetMemberGroupsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.GetMemberGroups") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SecurityEnabledOnly", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { @@ -325,7 +366,17 @@ func (client UsersClient) GetMemberGroupsResponder(resp *http.Response) (result // Parameters: // filter - the filter to apply to the operation. func (client UsersClient) List(ctx context.Context, filter string) (result UserListResultPage, err error) { - result.fn = func(lastResult UserListResult) (UserListResult, error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.List") + defer func() { + sc := -1 + if result.ulr.Response.Response != nil { + sc = result.ulr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult UserListResult) (UserListResult, error) { if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { return UserListResult{}, nil } @@ -396,6 +447,16 @@ func (client UsersClient) ListResponder(resp *http.Response) (result UserListRes // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client UsersClient) ListComplete(ctx context.Context, filter string) (result UserListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.List(ctx, filter) return } @@ -404,6 +465,16 @@ func (client UsersClient) ListComplete(ctx context.Context, filter string) (resu // Parameters: // nextLink - next link for the list operation. func (client UsersClient) ListNext(ctx context.Context, nextLink string) (result UserListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.ListNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.ListNextPreparer(ctx, nextLink) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "ListNext", nil, "Failure preparing request") @@ -470,6 +541,16 @@ func (client UsersClient) ListNextResponder(resp *http.Response) (result UserLis // upnOrObjectID - the object ID or principal name of the user to update. // parameters - parameters to update an existing user. func (client UsersClient) Update(ctx context.Context, upnOrObjectID string, parameters UserUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Update") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.UpdatePreparer(ctx, upnOrObjectID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Update", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/deploymentoperations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/deploymentoperations.go index 215e1ffbad..67d7f6a304 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/deploymentoperations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/deploymentoperations.go @@ -22,6 +22,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -46,11 +47,21 @@ func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID str // deploymentName - the name of the deployment. // operationID - operation Id. func (client DeploymentOperationsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string, operationID string) (result DeploymentOperation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.DeploymentOperationsClient", "Get", err.Error()) } @@ -123,11 +134,21 @@ func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (resu // deploymentName - the name of the deployment. // top - query parameters. func (client DeploymentOperationsClient) List(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (result DeploymentOperationsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsClient.List") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.DeploymentOperationsClient", "List", err.Error()) } @@ -198,8 +219,8 @@ func (client DeploymentOperationsClient) ListResponder(resp *http.Response) (res } // listNextResults retrieves the next set of results, if any. -func (client DeploymentOperationsClient) listNextResults(lastResults DeploymentOperationsListResult) (result DeploymentOperationsListResult, err error) { - req, err := lastResults.deploymentOperationsListResultPreparer() +func (client DeploymentOperationsClient) listNextResults(ctx context.Context, lastResults DeploymentOperationsListResult) (result DeploymentOperationsListResult, err error) { + req, err := lastResults.deploymentOperationsListResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -220,6 +241,16 @@ func (client DeploymentOperationsClient) listNextResults(lastResults DeploymentO // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client DeploymentOperationsClient) ListComplete(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (result DeploymentOperationsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.List(ctx, resourceGroupName, deploymentName, top) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/deployments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/deployments.go index db4c7ca6a4..54ddcb2c20 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/deployments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/deployments.go @@ -22,6 +22,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -45,11 +46,21 @@ func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) Depl // resourceGroupName - the name of the resource group. The name is case insensitive. // deploymentName - the name of the deployment. func (client DeploymentsClient) Cancel(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Cancel") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.DeploymentsClient", "Cancel", err.Error()) } @@ -119,11 +130,21 @@ func (client DeploymentsClient) CancelResponder(resp *http.Response) (result aut // resourceGroupName - the name of the resource group to check. The name is case insensitive. // deploymentName - the name of the deployment. func (client DeploymentsClient) CheckExistence(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.CheckExistence") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.DeploymentsClient", "CheckExistence", err.Error()) } @@ -194,11 +215,21 @@ func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (re // deploymentName - the name of the deployment. // parameters - additional parameters supplied to the operation. func (client DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Properties.TemplateLink", Name: validation.Null, Rule: false, @@ -278,11 +309,21 @@ func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (re // resourceGroupName - the name of the resource group. The name is case insensitive. // deploymentName - the name of the deployment to be deleted. func (client DeploymentsClient) Delete(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.DeploymentsClient", "Delete", err.Error()) } @@ -352,11 +393,21 @@ func (client DeploymentsClient) DeleteResponder(resp *http.Response) (result aut // resourceGroupName - the name of the resource group. The name is case insensitive. // deploymentName - the name of the deployment. func (client DeploymentsClient) ExportTemplate(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentExportResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.ExportTemplate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.DeploymentsClient", "ExportTemplate", err.Error()) } @@ -427,11 +478,21 @@ func (client DeploymentsClient) ExportTemplateResponder(resp *http.Response) (re // resourceGroupName - the name of the resource group to get. The name is case insensitive. // deploymentName - the name of the deployment. func (client DeploymentsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentExtended, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.DeploymentsClient", "Get", err.Error()) } @@ -503,11 +564,21 @@ func (client DeploymentsClient) GetResponder(resp *http.Response) (result Deploy // filter - the filter to apply on the operation. // top - query parameters. If null is passed returns all deployments. func (client DeploymentsClient) List(ctx context.Context, resourceGroupName string, filter string, top *int32) (result DeploymentListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.List") + defer func() { + sc := -1 + if result.dlr.Response.Response != nil { + sc = result.dlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.DeploymentsClient", "List", err.Error()) } @@ -580,8 +651,8 @@ func (client DeploymentsClient) ListResponder(resp *http.Response) (result Deplo } // listNextResults retrieves the next set of results, if any. -func (client DeploymentsClient) listNextResults(lastResults DeploymentListResult) (result DeploymentListResult, err error) { - req, err := lastResults.deploymentListResultPreparer() +func (client DeploymentsClient) listNextResults(ctx context.Context, lastResults DeploymentListResult) (result DeploymentListResult, err error) { + req, err := lastResults.deploymentListResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -602,6 +673,16 @@ func (client DeploymentsClient) listNextResults(lastResults DeploymentListResult // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client DeploymentsClient) ListComplete(ctx context.Context, resourceGroupName string, filter string, top *int32) (result DeploymentListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.List(ctx, resourceGroupName, filter, top) return } @@ -612,11 +693,21 @@ func (client DeploymentsClient) ListComplete(ctx context.Context, resourceGroupN // deploymentName - the name of the deployment. // parameters - deployment to validate. func (client DeploymentsClient) Validate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentValidateResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Validate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Properties.TemplateLink", Name: validation.Null, Rule: false, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/groups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/groups.go index f4d05a1b48..c199f30bcb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/groups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/groups.go @@ -22,6 +22,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -44,11 +45,21 @@ func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsCli // Parameters: // resourceGroupName - the name of the resource group to check. The name is case insensitive. func (client GroupsClient) CheckExistence(ctx context.Context, resourceGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.CheckExistence") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.GroupsClient", "CheckExistence", err.Error()) } @@ -117,11 +128,21 @@ func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result // resourceGroupName - the name of the resource group to be created or updated. // parameters - parameters supplied to the create or update resource group service operation. func (client GroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, parameters Group) (result Group, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.GroupsClient", "CreateOrUpdate", err.Error()) @@ -194,11 +215,21 @@ func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group to be deleted. The name is case insensitive. func (client GroupsClient) Delete(ctx context.Context, resourceGroupName string) (result GroupsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.GroupsClient", "Delete", err.Error()) } @@ -267,11 +298,21 @@ func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest // resourceGroupName - the name of the resource group to be created or updated. // parameters - parameters supplied to the export template resource group operation. func (client GroupsClient) ExportTemplate(ctx context.Context, resourceGroupName string, parameters ExportTemplateRequest) (result GroupExportResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.ExportTemplate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.GroupsClient", "ExportTemplate", err.Error()) } @@ -342,11 +383,21 @@ func (client GroupsClient) ExportTemplateResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group to get. The name is case insensitive. func (client GroupsClient) Get(ctx context.Context, resourceGroupName string) (result Group, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.GroupsClient", "Get", err.Error()) } @@ -416,6 +467,16 @@ func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err // filter - the filter to apply on the operation. // top - query parameters. If null is passed returns all resource groups. func (client GroupsClient) List(ctx context.Context, filter string, top *int32) (result GroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List") + defer func() { + sc := -1 + if result.glr.Response.Response != nil { + sc = result.glr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.fn = client.listNextResults req, err := client.ListPreparer(ctx, filter, top) if err != nil { @@ -484,8 +545,8 @@ func (client GroupsClient) ListResponder(resp *http.Response) (result GroupListR } // listNextResults retrieves the next set of results, if any. -func (client GroupsClient) listNextResults(lastResults GroupListResult) (result GroupListResult, err error) { - req, err := lastResults.groupListResultPreparer() +func (client GroupsClient) listNextResults(ctx context.Context, lastResults GroupListResult) (result GroupListResult, err error) { + req, err := lastResults.groupListResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -506,6 +567,16 @@ func (client GroupsClient) listNextResults(lastResults GroupListResult) (result // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client GroupsClient) ListComplete(ctx context.Context, filter string, top *int32) (result GroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.List(ctx, filter, top) return } @@ -517,11 +588,21 @@ func (client GroupsClient) ListComplete(ctx context.Context, filter string, top // expand - the $expand query parameter // top - query parameters. If null is passed returns all resource groups. func (client GroupsClient) ListResources(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.ListResources") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.GroupsClient", "ListResources", err.Error()) } @@ -597,8 +678,8 @@ func (client GroupsClient) ListResourcesResponder(resp *http.Response) (result L } // listResourcesNextResults retrieves the next set of results, if any. -func (client GroupsClient) listResourcesNextResults(lastResults ListResult) (result ListResult, err error) { - req, err := lastResults.listResultPreparer() +func (client GroupsClient) listResourcesNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "listResourcesNextResults", nil, "Failure preparing next results request") } @@ -619,6 +700,16 @@ func (client GroupsClient) listResourcesNextResults(lastResults ListResult) (res // ListResourcesComplete enumerates all values, automatically crossing page boundaries as required. func (client GroupsClient) ListResourcesComplete(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.ListResources") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.ListResources(ctx, resourceGroupName, filter, expand, top) return } @@ -630,11 +721,21 @@ func (client GroupsClient) ListResourcesComplete(ctx context.Context, resourceGr // resourceGroupName - the name of the resource group to be created or updated. The name is case insensitive. // parameters - parameters supplied to the update state resource group service operation. func (client GroupsClient) Patch(ctx context.Context, resourceGroupName string, parameters Group) (result Group, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Patch") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.GroupsClient", "Patch", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/models.go index bf84a5d4c6..c073a1e819 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/models.go @@ -18,14 +18,19 @@ package resources // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "context" "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" "net/http" ) +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources" + // DeploymentMode enumerates the values for deployment mode. type DeploymentMode string @@ -143,14 +148,24 @@ type DeploymentListResultIterator struct { page DeploymentListResultPage } -// Next advances to the next value. If there was an error making +// NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *DeploymentListResultIterator) Next() error { +func (iter *DeploymentListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } iter.i++ if iter.i < len(iter.page.Values()) { return nil } - err := iter.page.Next() + err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err @@ -159,6 +174,13 @@ func (iter *DeploymentListResultIterator) Next() error { return nil } +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DeploymentListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + // NotDone returns true if the enumeration should be started or is not yet complete. func (iter DeploymentListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) @@ -178,6 +200,11 @@ func (iter DeploymentListResultIterator) Value() DeploymentExtended { return iter.page.Values()[iter.i] } +// Creates a new instance of the DeploymentListResultIterator type. +func NewDeploymentListResultIterator(page DeploymentListResultPage) DeploymentListResultIterator { + return DeploymentListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (dlr DeploymentListResult) IsEmpty() bool { return dlr.Value == nil || len(*dlr.Value) == 0 @@ -185,11 +212,11 @@ func (dlr DeploymentListResult) IsEmpty() bool { // deploymentListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dlr DeploymentListResult) deploymentListResultPreparer() (*http.Request, error) { +func (dlr DeploymentListResult) deploymentListResultPreparer(ctx context.Context) (*http.Request, error) { if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 { return nil, nil } - return autorest.Prepare(&http.Request{}, + return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(dlr.NextLink))) @@ -197,14 +224,24 @@ func (dlr DeploymentListResult) deploymentListResultPreparer() (*http.Request, e // DeploymentListResultPage contains a page of DeploymentExtended values. type DeploymentListResultPage struct { - fn func(DeploymentListResult) (DeploymentListResult, error) + fn func(context.Context, DeploymentListResult) (DeploymentListResult, error) dlr DeploymentListResult } -// Next advances to the next page of values. If there was an error making +// NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *DeploymentListResultPage) Next() error { - next, err := page.fn(page.dlr) +func (page *DeploymentListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.dlr) if err != nil { return err } @@ -212,6 +249,13 @@ func (page *DeploymentListResultPage) Next() error { return nil } +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DeploymentListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + // NotDone returns true if the page enumeration should be started or is not yet complete. func (page DeploymentListResultPage) NotDone() bool { return !page.dlr.IsEmpty() @@ -230,6 +274,11 @@ func (page DeploymentListResultPage) Values() []DeploymentExtended { return *page.dlr.Value } +// Creates a new instance of the DeploymentListResultPage type. +func NewDeploymentListResultPage(getNextPage func(context.Context, DeploymentListResult) (DeploymentListResult, error)) DeploymentListResultPage { + return DeploymentListResultPage{fn: getNextPage} +} + // DeploymentOperation deployment operation information. type DeploymentOperation struct { autorest.Response `json:"-"` @@ -270,20 +319,31 @@ type DeploymentOperationsListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation values. +// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation +// values. type DeploymentOperationsListResultIterator struct { i int page DeploymentOperationsListResultPage } -// Next advances to the next value. If there was an error making +// NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *DeploymentOperationsListResultIterator) Next() error { +func (iter *DeploymentOperationsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } iter.i++ if iter.i < len(iter.page.Values()) { return nil } - err := iter.page.Next() + err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err @@ -292,6 +352,13 @@ func (iter *DeploymentOperationsListResultIterator) Next() error { return nil } +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DeploymentOperationsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + // NotDone returns true if the enumeration should be started or is not yet complete. func (iter DeploymentOperationsListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) @@ -311,6 +378,11 @@ func (iter DeploymentOperationsListResultIterator) Value() DeploymentOperation { return iter.page.Values()[iter.i] } +// Creates a new instance of the DeploymentOperationsListResultIterator type. +func NewDeploymentOperationsListResultIterator(page DeploymentOperationsListResultPage) DeploymentOperationsListResultIterator { + return DeploymentOperationsListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (dolr DeploymentOperationsListResult) IsEmpty() bool { return dolr.Value == nil || len(*dolr.Value) == 0 @@ -318,11 +390,11 @@ func (dolr DeploymentOperationsListResult) IsEmpty() bool { // deploymentOperationsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer() (*http.Request, error) { +func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer(ctx context.Context) (*http.Request, error) { if dolr.NextLink == nil || len(to.String(dolr.NextLink)) < 1 { return nil, nil } - return autorest.Prepare(&http.Request{}, + return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(dolr.NextLink))) @@ -330,14 +402,24 @@ func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPrepare // DeploymentOperationsListResultPage contains a page of DeploymentOperation values. type DeploymentOperationsListResultPage struct { - fn func(DeploymentOperationsListResult) (DeploymentOperationsListResult, error) + fn func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error) dolr DeploymentOperationsListResult } -// Next advances to the next page of values. If there was an error making +// NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *DeploymentOperationsListResultPage) Next() error { - next, err := page.fn(page.dolr) +func (page *DeploymentOperationsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.dolr) if err != nil { return err } @@ -345,6 +427,13 @@ func (page *DeploymentOperationsListResultPage) Next() error { return nil } +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DeploymentOperationsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + // NotDone returns true if the page enumeration should be started or is not yet complete. func (page DeploymentOperationsListResultPage) NotDone() bool { return !page.dolr.IsEmpty() @@ -363,6 +452,11 @@ func (page DeploymentOperationsListResultPage) Values() []DeploymentOperation { return *page.dolr.Value } +// Creates a new instance of the DeploymentOperationsListResultPage type. +func NewDeploymentOperationsListResultPage(getNextPage func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)) DeploymentOperationsListResultPage { + return DeploymentOperationsListResultPage{fn: getNextPage} +} + // DeploymentProperties deployment properties. type DeploymentProperties struct { // Template - The template content. It can be a JObject or a well formed JSON string. Use only one of Template or TemplateLink. @@ -387,7 +481,7 @@ type DeploymentPropertiesExtended struct { CorrelationID *string `json:"correlationId,omitempty"` // Timestamp - The timestamp of the template deployment. Timestamp *date.Time `json:"timestamp,omitempty"` - // Outputs - Key/value pairs that represent deploymentoutput. + // Outputs - Key/value pairs that represent deployment output. Outputs interface{} `json:"outputs,omitempty"` // Providers - The list of resource providers needed for the deployment. Providers *[]Provider `json:"providers,omitempty"` @@ -407,8 +501,8 @@ type DeploymentPropertiesExtended struct { DebugSetting *DebugSetting `json:"debugSetting,omitempty"` } -// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type DeploymentsCreateOrUpdateFuture struct { azure.Future } @@ -436,7 +530,8 @@ func (future *DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) return } -// DeploymentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DeploymentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DeploymentsDeleteFuture struct { azure.Future } @@ -508,7 +603,9 @@ func (gr GenericResource) MarshalJSON() ([]byte, error) { if gr.Plan != nil { objectMap["plan"] = gr.Plan } - objectMap["properties"] = gr.Properties + if gr.Properties != nil { + objectMap["properties"] = gr.Properties + } if gr.Kind != nil { objectMap["kind"] = gr.Kind } @@ -616,14 +713,24 @@ type GroupListResultIterator struct { page GroupListResultPage } -// Next advances to the next value. If there was an error making +// NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *GroupListResultIterator) Next() error { +func (iter *GroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } iter.i++ if iter.i < len(iter.page.Values()) { return nil } - err := iter.page.Next() + err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err @@ -632,6 +739,13 @@ func (iter *GroupListResultIterator) Next() error { return nil } +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *GroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + // NotDone returns true if the enumeration should be started or is not yet complete. func (iter GroupListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) @@ -651,6 +765,11 @@ func (iter GroupListResultIterator) Value() Group { return iter.page.Values()[iter.i] } +// Creates a new instance of the GroupListResultIterator type. +func NewGroupListResultIterator(page GroupListResultPage) GroupListResultIterator { + return GroupListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (glr GroupListResult) IsEmpty() bool { return glr.Value == nil || len(*glr.Value) == 0 @@ -658,11 +777,11 @@ func (glr GroupListResult) IsEmpty() bool { // groupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (glr GroupListResult) groupListResultPreparer() (*http.Request, error) { +func (glr GroupListResult) groupListResultPreparer(ctx context.Context) (*http.Request, error) { if glr.NextLink == nil || len(to.String(glr.NextLink)) < 1 { return nil, nil } - return autorest.Prepare(&http.Request{}, + return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(glr.NextLink))) @@ -670,14 +789,24 @@ func (glr GroupListResult) groupListResultPreparer() (*http.Request, error) { // GroupListResultPage contains a page of Group values. type GroupListResultPage struct { - fn func(GroupListResult) (GroupListResult, error) + fn func(context.Context, GroupListResult) (GroupListResult, error) glr GroupListResult } -// Next advances to the next page of values. If there was an error making +// NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *GroupListResultPage) Next() error { - next, err := page.fn(page.glr) +func (page *GroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.glr) if err != nil { return err } @@ -685,6 +814,13 @@ func (page *GroupListResultPage) Next() error { return nil } +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *GroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + // NotDone returns true if the page enumeration should be started or is not yet complete. func (page GroupListResultPage) NotDone() bool { return !page.glr.IsEmpty() @@ -703,6 +839,11 @@ func (page GroupListResultPage) Values() []Group { return *page.glr.Value } +// Creates a new instance of the GroupListResultPage type. +func NewGroupListResultPage(getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage { + return GroupListResultPage{fn: getNextPage} +} + // GroupProperties the resource group properties. type GroupProperties struct { // ProvisioningState - The provisioning state. @@ -762,14 +903,24 @@ type ListResultIterator struct { page ListResultPage } -// Next advances to the next value. If there was an error making +// NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ListResultIterator) Next() error { +func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } iter.i++ if iter.i < len(iter.page.Values()) { return nil } - err := iter.page.Next() + err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err @@ -778,6 +929,13 @@ func (iter *ListResultIterator) Next() error { return nil } +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + // NotDone returns true if the enumeration should be started or is not yet complete. func (iter ListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) @@ -797,6 +955,11 @@ func (iter ListResultIterator) Value() GenericResource { return iter.page.Values()[iter.i] } +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (lr ListResult) IsEmpty() bool { return lr.Value == nil || len(*lr.Value) == 0 @@ -804,11 +967,11 @@ func (lr ListResult) IsEmpty() bool { // listResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lr ListResult) listResultPreparer() (*http.Request, error) { +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { return nil, nil } - return autorest.Prepare(&http.Request{}, + return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(lr.NextLink))) @@ -816,14 +979,24 @@ func (lr ListResult) listResultPreparer() (*http.Request, error) { // ListResultPage contains a page of GenericResource values. type ListResultPage struct { - fn func(ListResult) (ListResult, error) + fn func(context.Context, ListResult) (ListResult, error) lr ListResult } -// Next advances to the next page of values. If there was an error making +// NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ListResultPage) Next() error { - next, err := page.fn(page.lr) +func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) if err != nil { return err } @@ -831,6 +1004,13 @@ func (page *ListResultPage) Next() error { return nil } +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + // NotDone returns true if the page enumeration should be started or is not yet complete. func (page ListResultPage) NotDone() bool { return !page.lr.IsEmpty() @@ -849,6 +1029,11 @@ func (page ListResultPage) Values() []GenericResource { return *page.lr.Value } +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + // ManagementErrorWithDetails ... type ManagementErrorWithDetails struct { // Code - The error code returned from the server. @@ -869,7 +1054,8 @@ type MoveInfo struct { TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` } -// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type MoveResourcesFuture struct { azure.Future } @@ -891,7 +1077,7 @@ func (future *MoveResourcesFuture) Result(client Client) (ar autorest.Response, return } -// ParametersLink entity representing the reference to the deployment paramaters. +// ParametersLink entity representing the reference to the deployment parameters. type ParametersLink struct { // URI - URI referencing the template. URI *string `json:"uri,omitempty"` @@ -939,14 +1125,24 @@ type ProviderListResultIterator struct { page ProviderListResultPage } -// Next advances to the next value. If there was an error making +// NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ProviderListResultIterator) Next() error { +func (iter *ProviderListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } iter.i++ if iter.i < len(iter.page.Values()) { return nil } - err := iter.page.Next() + err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err @@ -955,6 +1151,13 @@ func (iter *ProviderListResultIterator) Next() error { return nil } +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProviderListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + // NotDone returns true if the enumeration should be started or is not yet complete. func (iter ProviderListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) @@ -974,6 +1177,11 @@ func (iter ProviderListResultIterator) Value() Provider { return iter.page.Values()[iter.i] } +// Creates a new instance of the ProviderListResultIterator type. +func NewProviderListResultIterator(page ProviderListResultPage) ProviderListResultIterator { + return ProviderListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (plr ProviderListResult) IsEmpty() bool { return plr.Value == nil || len(*plr.Value) == 0 @@ -981,11 +1189,11 @@ func (plr ProviderListResult) IsEmpty() bool { // providerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (plr ProviderListResult) providerListResultPreparer() (*http.Request, error) { +func (plr ProviderListResult) providerListResultPreparer(ctx context.Context) (*http.Request, error) { if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { return nil, nil } - return autorest.Prepare(&http.Request{}, + return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(plr.NextLink))) @@ -993,14 +1201,24 @@ func (plr ProviderListResult) providerListResultPreparer() (*http.Request, error // ProviderListResultPage contains a page of Provider values. type ProviderListResultPage struct { - fn func(ProviderListResult) (ProviderListResult, error) + fn func(context.Context, ProviderListResult) (ProviderListResult, error) plr ProviderListResult } -// Next advances to the next page of values. If there was an error making +// NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ProviderListResultPage) Next() error { - next, err := page.fn(page.plr) +func (page *ProviderListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.plr) if err != nil { return err } @@ -1008,6 +1226,13 @@ func (page *ProviderListResultPage) Next() error { return nil } +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProviderListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + // NotDone returns true if the page enumeration should be started or is not yet complete. func (page ProviderListResultPage) NotDone() bool { return !page.plr.IsEmpty() @@ -1026,6 +1251,11 @@ func (page ProviderListResultPage) Values() []Provider { return *page.plr.Value } +// Creates a new instance of the ProviderListResultPage type. +func NewProviderListResultPage(getNextPage func(context.Context, ProviderListResult) (ProviderListResult, error)) ProviderListResultPage { + return ProviderListResultPage{fn: getNextPage} +} + // ProviderOperationDisplayProperties resource provider operation's display properties. type ProviderOperationDisplayProperties struct { // Publisher - Operation description. @@ -1168,14 +1398,24 @@ type TagsListResultIterator struct { page TagsListResultPage } -// Next advances to the next value. If there was an error making +// NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *TagsListResultIterator) Next() error { +func (iter *TagsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TagsListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } iter.i++ if iter.i < len(iter.page.Values()) { return nil } - err := iter.page.Next() + err = iter.page.NextWithContext(ctx) if err != nil { iter.i-- return err @@ -1184,6 +1424,13 @@ func (iter *TagsListResultIterator) Next() error { return nil } +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TagsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + // NotDone returns true if the enumeration should be started or is not yet complete. func (iter TagsListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) @@ -1203,6 +1450,11 @@ func (iter TagsListResultIterator) Value() TagDetails { return iter.page.Values()[iter.i] } +// Creates a new instance of the TagsListResultIterator type. +func NewTagsListResultIterator(page TagsListResultPage) TagsListResultIterator { + return TagsListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (tlr TagsListResult) IsEmpty() bool { return tlr.Value == nil || len(*tlr.Value) == 0 @@ -1210,11 +1462,11 @@ func (tlr TagsListResult) IsEmpty() bool { // tagsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (tlr TagsListResult) tagsListResultPreparer() (*http.Request, error) { +func (tlr TagsListResult) tagsListResultPreparer(ctx context.Context) (*http.Request, error) { if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { return nil, nil } - return autorest.Prepare(&http.Request{}, + return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(tlr.NextLink))) @@ -1222,14 +1474,24 @@ func (tlr TagsListResult) tagsListResultPreparer() (*http.Request, error) { // TagsListResultPage contains a page of TagDetails values. type TagsListResultPage struct { - fn func(TagsListResult) (TagsListResult, error) + fn func(context.Context, TagsListResult) (TagsListResult, error) tlr TagsListResult } -// Next advances to the next page of values. If there was an error making +// NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *TagsListResultPage) Next() error { - next, err := page.fn(page.tlr) +func (page *TagsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TagsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.tlr) if err != nil { return err } @@ -1237,6 +1499,13 @@ func (page *TagsListResultPage) Next() error { return nil } +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TagsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + // NotDone returns true if the page enumeration should be started or is not yet complete. func (page TagsListResultPage) NotDone() bool { return !page.tlr.IsEmpty() @@ -1255,6 +1524,11 @@ func (page TagsListResultPage) Values() []TagDetails { return *page.tlr.Value } +// Creates a new instance of the TagsListResultPage type. +func NewTagsListResultPage(getNextPage func(context.Context, TagsListResult) (TagsListResult, error)) TagsListResultPage { + return TagsListResultPage{fn: getNextPage} +} + // TagValue tag information. type TagValue struct { autorest.Response `json:"-"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/providers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/providers.go index 4993b1f432..66a4c83199 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/providers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/providers.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -45,6 +46,16 @@ func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) Provid // expand - the $expand query parameter. e.g. To include property aliases in response, use // $expand=resourceTypes/aliases. func (client ProvidersClient) Get(ctx context.Context, resourceProviderNamespace string, expand string) (result Provider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProvidersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.GetPreparer(ctx, resourceProviderNamespace, expand) if err != nil { err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Get", nil, "Failure preparing request") @@ -115,6 +126,16 @@ func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider // expand - the $expand query parameter. e.g. To include property aliases in response, use // $expand=resourceTypes/aliases. func (client ProvidersClient) List(ctx context.Context, top *int32, expand string) (result ProviderListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProvidersClient.List") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.fn = client.listNextResults req, err := client.ListPreparer(ctx, top, expand) if err != nil { @@ -183,8 +204,8 @@ func (client ProvidersClient) ListResponder(resp *http.Response) (result Provide } // listNextResults retrieves the next set of results, if any. -func (client ProvidersClient) listNextResults(lastResults ProviderListResult) (result ProviderListResult, err error) { - req, err := lastResults.providerListResultPreparer() +func (client ProvidersClient) listNextResults(ctx context.Context, lastResults ProviderListResult) (result ProviderListResult, err error) { + req, err := lastResults.providerListResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "listNextResults", nil, "Failure preparing next results request") } @@ -205,6 +226,16 @@ func (client ProvidersClient) listNextResults(lastResults ProviderListResult) (r // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client ProvidersClient) ListComplete(ctx context.Context, top *int32, expand string) (result ProviderListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProvidersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.List(ctx, top, expand) return } @@ -213,6 +244,16 @@ func (client ProvidersClient) ListComplete(ctx context.Context, top *int32, expa // Parameters: // resourceProviderNamespace - namespace of the resource provider. func (client ProvidersClient) Register(ctx context.Context, resourceProviderNamespace string) (result Provider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProvidersClient.Register") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.RegisterPreparer(ctx, resourceProviderNamespace) if err != nil { err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Register", nil, "Failure preparing request") @@ -278,6 +319,16 @@ func (client ProvidersClient) RegisterResponder(resp *http.Response) (result Pro // Parameters: // resourceProviderNamespace - namespace of the resource provider. func (client ProvidersClient) Unregister(ctx context.Context, resourceProviderNamespace string) (result Provider, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProvidersClient.Unregister") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.UnregisterPreparer(ctx, resourceProviderNamespace) if err != nil { err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Unregister", nil, "Failure preparing request") diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/resources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/resources.go index 301b9934e9..c197f530a4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/resources.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/resources.go @@ -22,6 +22,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -48,11 +49,21 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // resourceType - resource identity. // resourceName - resource identity. func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } @@ -129,11 +140,21 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // resourceName - resource identity. // parameters - create or update resource parameters. func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result GenericResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } @@ -212,11 +233,21 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // resourceType - resource identity. // resourceName - resource identity. func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.Client", "Delete", err.Error()) } @@ -292,11 +323,21 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // resourceType - resource identity. // resourceName - resource identity. func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.Client", "Get", err.Error()) } @@ -371,6 +412,16 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource, // expand - the $expand query parameter. // top - query parameters. If null is passed returns all resource groups. func (client Client) List(ctx context.Context, filter string, expand string, top *int32) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.List") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.fn = client.listNextResults req, err := client.ListPreparer(ctx, filter, expand, top) if err != nil { @@ -442,8 +493,8 @@ func (client Client) ListResponder(resp *http.Response) (result ListResult, err } // listNextResults retrieves the next set of results, if any. -func (client Client) listNextResults(lastResults ListResult) (result ListResult, err error) { - req, err := lastResults.listResultPreparer() +func (client Client) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "resources.Client", "listNextResults", nil, "Failure preparing next results request") } @@ -464,6 +515,16 @@ func (client Client) listNextResults(lastResults ListResult) (result ListResult, // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client Client) ListComplete(ctx context.Context, filter string, expand string, top *int32) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.List(ctx, filter, expand, top) return } @@ -474,11 +535,21 @@ func (client Client) ListComplete(ctx context.Context, filter string, expand str // sourceResourceGroupName - source resource group name. // parameters - move resources' parameters. func (client Client) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (result MoveResourcesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.MoveResources") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: sourceResourceGroupName, Constraints: []validation.Constraint{{Target: "sourceResourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "sourceResourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "sourceResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "sourceResourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.Client", "MoveResources", err.Error()) } @@ -553,11 +624,21 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // resourceName - the name of the resource to update. // parameters - parameters for updating the resource. func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("resources.Client", "Update", err.Error()) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/tags.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/tags.go index c38a381883..7d5b286c4a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/tags.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources/tags.go @@ -21,6 +21,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -43,6 +44,16 @@ func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient // Parameters: // tagName - the name of the tag. func (client TagsClient) CreateOrUpdate(ctx context.Context, tagName string) (result TagDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.CreateOrUpdatePreparer(ctx, tagName) if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -109,6 +120,16 @@ func (client TagsClient) CreateOrUpdateResponder(resp *http.Response) (result Ta // tagName - the name of the tag. // tagValue - the value of the tag. func (client TagsClient) CreateOrUpdateValue(ctx context.Context, tagName string, tagValue string) (result TagValue, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.CreateOrUpdateValue") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.CreateOrUpdateValuePreparer(ctx, tagName, tagValue) if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdateValue", nil, "Failure preparing request") @@ -175,6 +196,16 @@ func (client TagsClient) CreateOrUpdateValueResponder(resp *http.Response) (resu // Parameters: // tagName - the name of the tag. func (client TagsClient) Delete(ctx context.Context, tagName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.DeletePreparer(ctx, tagName) if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "Delete", nil, "Failure preparing request") @@ -240,6 +271,16 @@ func (client TagsClient) DeleteResponder(resp *http.Response) (result autorest.R // tagName - the name of the tag. // tagValue - the value of the tag. func (client TagsClient) DeleteValue(ctx context.Context, tagName string, tagValue string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.DeleteValue") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } req, err := client.DeleteValuePreparer(ctx, tagName, tagValue) if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "DeleteValue", nil, "Failure preparing request") @@ -303,6 +344,16 @@ func (client TagsClient) DeleteValueResponder(resp *http.Response) (result autor // List get a list of subscription resource tags. func (client TagsClient) List(ctx context.Context) (result TagsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.List") + defer func() { + sc := -1 + if result.tlr.Response.Response != nil { + sc = result.tlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { @@ -365,8 +416,8 @@ func (client TagsClient) ListResponder(resp *http.Response) (result TagsListResu } // listNextResults retrieves the next set of results, if any. -func (client TagsClient) listNextResults(lastResults TagsListResult) (result TagsListResult, err error) { - req, err := lastResults.tagsListResultPreparer() +func (client TagsClient) listNextResults(ctx context.Context, lastResults TagsListResult) (result TagsListResult, err error) { + req, err := lastResults.tagsListResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "resources.TagsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -387,6 +438,16 @@ func (client TagsClient) listNextResults(lastResults TagsListResult) (result Tag // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client TagsClient) ListComplete(ctx context.Context) (result TagsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } result.page, err = client.List(ctx) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index 7f0f6f2b66..4a6bc30316 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -18,4 +18,4 @@ package version // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Number contains the semantic version of this SDK. -const Number = "v21.3.0" +const Number = "v24.0.0" diff --git a/vendor/vendor.json b/vendor/vendor.json index ba8a24cc33..c3aa746140 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -3,36 +3,36 @@ "ignore": "test", "package": [ { - "checksumSHA1": "Ohzmn3hdzuDAONRJ4pfj9gIcK9Y=", + "checksumSHA1": "UhJRm079RffZyb5lr6ejn6NGiu0=", "path": "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources", - "revision": "da91af54816b4cf72949c225a2d0980f51fab01b", - "revisionTime": "2018-10-19T17:11:53Z", - "version": "v21.3.0", - "versionExact": "v21.3.0" + "revision": "1951233eb944a49aa5f7278cba8e3e32a8c958af", + "revisionTime": "2018-12-19T17:12:57Z", + "version": "v24.0.0", + "versionExact": "v24.0.0" }, { - "checksumSHA1": "R/wi+9kJaTVXwJDbeqSVEmmdzbU=", + "checksumSHA1": "TLS49M5qFLOtWvgjHAmcBFbC/hY=", "path": "github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac", - "revision": "da91af54816b4cf72949c225a2d0980f51fab01b", - "revisionTime": "2018-10-19T17:11:53Z", - "version": "v21.3.0", - "versionExact": "v21.3.0" + "revision": "1951233eb944a49aa5f7278cba8e3e32a8c958af", + "revisionTime": "2018-12-19T17:12:57Z", + "version": "v24.0.0", + "versionExact": "v24.0.0" }, { - "checksumSHA1": "dVI8mXjcACkxDIMil3qe9FXxfo8=", + "checksumSHA1": "Tnw6Ah2Iqc9m/1lCar+6rXvIvwk=", "path": "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources", - "revision": "da91af54816b4cf72949c225a2d0980f51fab01b", - "revisionTime": "2018-10-19T17:11:53Z", - "version": "v21.3.0", - "versionExact": "v21.3.0" + "revision": "1951233eb944a49aa5f7278cba8e3e32a8c958af", + "revisionTime": "2018-12-19T17:12:57Z", + "version": "v24.0.0", + "versionExact": "v24.0.0" }, { - "checksumSHA1": "iwFNzhhpqENmDbIOG2GHQJY2nDs=", + "checksumSHA1": "5OXhmdScl78ZC8+IuDA6LBE8f7U=", "path": "github.com/Azure/azure-sdk-for-go/version", - "revision": "da91af54816b4cf72949c225a2d0980f51fab01b", - "revisionTime": "2018-10-19T17:11:53Z", - "version": "v21.3.0", - "versionExact": "v21.3.0" + "revision": "1951233eb944a49aa5f7278cba8e3e32a8c958af", + "revisionTime": "2018-12-19T17:12:57Z", + "version": "v24.0.0", + "versionExact": "v24.0.0" }, { "checksumSHA1": "AUVb80JXsNPSMRGnXGOy+Jr/cd0=", From 4a9d836e36b1db0c0dd44b665a3fa51b3e62aa96 Mon Sep 17 00:00:00 2001 From: kt Date: Mon, 21 Jan 2019 21:32:13 -0800 Subject: [PATCH 2/2] sdk v24.0.0 -> v24.1.0 --- .../resources/mgmt/resources/models.go | 2 +- .../Azure/azure-sdk-for-go/version/version.go | 2 +- vendor/vendor.json | 36 +++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go index cbe939d82b..c791818c4e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go @@ -1,6 +1,6 @@ // +build go1.9 -// Copyright 2018 Microsoft Corporation +// Copyright 2019 Microsoft Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index 4a6bc30316..fcc40b733b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -18,4 +18,4 @@ package version // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Number contains the semantic version of this SDK. -const Number = "v24.0.0" +const Number = "v24.1.0" diff --git a/vendor/vendor.json b/vendor/vendor.json index c3aa746140..3a3aa65bff 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -3,36 +3,36 @@ "ignore": "test", "package": [ { - "checksumSHA1": "UhJRm079RffZyb5lr6ejn6NGiu0=", + "checksumSHA1": "U2UlPbz0yLRogFpi3zThZknoH2o=", "path": "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources", - "revision": "1951233eb944a49aa5f7278cba8e3e32a8c958af", - "revisionTime": "2018-12-19T17:12:57Z", - "version": "v24.0.0", - "versionExact": "v24.0.0" + "revision": "392ea0b046cfb0cb05942ea92baf22af9ff7f9df", + "revisionTime": "2019-01-15T22:53:05Z", + "version": "v24.1.0", + "versionExact": "v24.1.0" }, { "checksumSHA1": "TLS49M5qFLOtWvgjHAmcBFbC/hY=", "path": "github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac", - "revision": "1951233eb944a49aa5f7278cba8e3e32a8c958af", - "revisionTime": "2018-12-19T17:12:57Z", - "version": "v24.0.0", - "versionExact": "v24.0.0" + "revision": "392ea0b046cfb0cb05942ea92baf22af9ff7f9df", + "revisionTime": "2019-01-15T22:53:05Z", + "version": "v24.1.0", + "versionExact": "v24.1.0" }, { "checksumSHA1": "Tnw6Ah2Iqc9m/1lCar+6rXvIvwk=", "path": "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-02-01/resources", - "revision": "1951233eb944a49aa5f7278cba8e3e32a8c958af", - "revisionTime": "2018-12-19T17:12:57Z", - "version": "v24.0.0", - "versionExact": "v24.0.0" + "revision": "392ea0b046cfb0cb05942ea92baf22af9ff7f9df", + "revisionTime": "2019-01-15T22:53:05Z", + "version": "v24.1.0", + "versionExact": "v24.1.0" }, { - "checksumSHA1": "5OXhmdScl78ZC8+IuDA6LBE8f7U=", + "checksumSHA1": "olWwaqk/E+bXvnS7oJEKYWAbuRQ=", "path": "github.com/Azure/azure-sdk-for-go/version", - "revision": "1951233eb944a49aa5f7278cba8e3e32a8c958af", - "revisionTime": "2018-12-19T17:12:57Z", - "version": "v24.0.0", - "versionExact": "v24.0.0" + "revision": "392ea0b046cfb0cb05942ea92baf22af9ff7f9df", + "revisionTime": "2019-01-15T22:53:05Z", + "version": "v24.1.0", + "versionExact": "v24.1.0" }, { "checksumSHA1": "AUVb80JXsNPSMRGnXGOy+Jr/cd0=",