diff --git a/services/msi/mgmt/2018-11-30/msi/models.go b/services/msi/mgmt/2018-11-30/msi/models.go index de91eb24a7c2..dbb26e3a07ba 100644 --- a/services/msi/mgmt/2018-11-30/msi/models.go +++ b/services/msi/mgmt/2018-11-30/msi/models.go @@ -30,17 +30,16 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi" -// UserAssignedIdentities enumerates the values for user assigned identities. -type UserAssignedIdentities string - -const ( - // MicrosoftManagedIdentityuserAssignedIdentities ... - MicrosoftManagedIdentityuserAssignedIdentities UserAssignedIdentities = "Microsoft.ManagedIdentity/userAssignedIdentities" -) - -// PossibleUserAssignedIdentitiesValues returns an array of possible values for the UserAssignedIdentities const type. -func PossibleUserAssignedIdentitiesValues() []UserAssignedIdentities { - return []UserAssignedIdentities{MicrosoftManagedIdentityuserAssignedIdentities} +// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` } // CloudError an error response from the ManagedServiceIdentity service. @@ -64,31 +63,28 @@ type CloudErrorBody struct { // Identity describes an identity resource. type Identity struct { autorest.Response `json:"-"` - // ID - READ-ONLY; The id of the created identity. + // UserAssignedIdentityProperties - READ-ONLY; The properties associated with the identity. + *UserAssignedIdentityProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the created identity. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Location - The Azure region where the identity lives. - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // IdentityProperties - The properties associated with the identity. - *IdentityProperties `json:"properties,omitempty"` - // Type - READ-ONLY; The type of resource i.e. Microsoft.ManagedIdentity/userAssignedIdentities. Possible values include: 'MicrosoftManagedIdentityuserAssignedIdentities' - Type UserAssignedIdentities `json:"type,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for Identity. func (i Identity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if i.Location != nil { - objectMap["location"] = i.Location - } if i.Tags != nil { objectMap["tags"] = i.Tags } - if i.IdentityProperties != nil { - objectMap["properties"] = i.IdentityProperties + if i.Location != nil { + objectMap["location"] = i.Location } return json.Marshal(objectMap) } @@ -102,6 +98,33 @@ func (i *Identity) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var userAssignedIdentityProperties UserAssignedIdentityProperties + err = json.Unmarshal(*v, &userAssignedIdentityProperties) + if err != nil { + return err + } + i.UserAssignedIdentityProperties = &userAssignedIdentityProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + i.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + i.Location = &location + } case "id": if v != nil { var ID string @@ -120,6 +143,58 @@ func (i *Identity) UnmarshalJSON(body []byte) error { } i.Name = &name } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + i.Type = &typeVar + } + } + } + + return nil +} + +// IdentityUpdate describes an identity resource. +type IdentityUpdate struct { + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // UserAssignedIdentityProperties - READ-ONLY; The properties associated with the identity. + *UserAssignedIdentityProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityUpdate. +func (iu IdentityUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iu.Location != nil { + objectMap["location"] = iu.Location + } + if iu.Tags != nil { + objectMap["tags"] = iu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IdentityUpdate struct. +func (iu *IdentityUpdate) 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 { case "location": if v != nil { var location string @@ -127,7 +202,7 @@ func (i *Identity) UnmarshalJSON(body []byte) error { if err != nil { return err } - i.Location = &location + iu.Location = &location } case "tags": if v != nil { @@ -136,25 +211,43 @@ func (i *Identity) UnmarshalJSON(body []byte) error { if err != nil { return err } - i.Tags = tags + iu.Tags = tags } case "properties": if v != nil { - var identityProperties IdentityProperties - err = json.Unmarshal(*v, &identityProperties) + var userAssignedIdentityProperties UserAssignedIdentityProperties + err = json.Unmarshal(*v, &userAssignedIdentityProperties) + if err != nil { + return err + } + iu.UserAssignedIdentityProperties = &userAssignedIdentityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - i.IdentityProperties = &identityProperties + iu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iu.Name = &name } case "type": if v != nil { - var typeVar UserAssignedIdentities + var typeVar string err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - i.Type = typeVar + iu.Type = &typeVar } } } @@ -162,18 +255,6 @@ func (i *Identity) UnmarshalJSON(body []byte) error { return nil } -// IdentityProperties the properties associated with the identity. -type IdentityProperties struct { - // TenantID - READ-ONLY; The id of the tenant which the identity belongs to. - TenantID *uuid.UUID `json:"tenantId,omitempty"` - // PrincipalID - READ-ONLY; The id of the service principal object associated with the created identity. - PrincipalID *uuid.UUID `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The id of the app associated with the identity. This is a random generated UUID by MSI. - ClientID *uuid.UUID `json:"clientId,omitempty"` - // ClientSecretURL - READ-ONLY; The ManagedServiceIdentity DataPlane URL that can be queried to obtain the identity credentials. If identity is user assigned, then the clientSecretUrl will not be present in the response, otherwise it will be present. - ClientSecretURL *string `json:"clientSecretUrl,omitempty"` -} - // Operation operation supported by the Microsoft.ManagedIdentity REST API. type Operation struct { // Name - The name of the REST Operation. This is of the format {provider}/{resource}/{operation}. @@ -340,6 +421,163 @@ func NewOperationListResultPage(getNextPage func(context.Context, OperationListR return OperationListResultPage{fn: getNextPage} } +// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than +// required location and tags +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// Resource ... +type Resource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// SystemAssignedIdentity describes a system assigned identity resource. +type SystemAssignedIdentity struct { + autorest.Response `json:"-"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // SystemAssignedIdentityProperties - READ-ONLY; The properties associated with the identity. + *SystemAssignedIdentityProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SystemAssignedIdentity. +func (sai SystemAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sai.Location != nil { + objectMap["location"] = sai.Location + } + if sai.Tags != nil { + objectMap["tags"] = sai.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SystemAssignedIdentity struct. +func (sai *SystemAssignedIdentity) 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 { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sai.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sai.Tags = tags + } + case "properties": + if v != nil { + var systemAssignedIdentityProperties SystemAssignedIdentityProperties + err = json.Unmarshal(*v, &systemAssignedIdentityProperties) + if err != nil { + return err + } + sai.SystemAssignedIdentityProperties = &systemAssignedIdentityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sai.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sai.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sai.Type = &typeVar + } + } + } + + return nil +} + +// SystemAssignedIdentityProperties the properties associated with the system assigned identity. +type SystemAssignedIdentityProperties struct { + // TenantID - READ-ONLY; The id of the tenant which the identity belongs to. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // PrincipalID - READ-ONLY; The id of the service principal object associated with the created identity. + PrincipalID *uuid.UUID `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The id of the app associated with the identity. This is a random generated UUID by MSI. + ClientID *uuid.UUID `json:"clientId,omitempty"` + // ClientSecretURL - READ-ONLY; The ManagedServiceIdentity DataPlane URL that can be queried to obtain the identity credentials. + ClientSecretURL *string `json:"clientSecretUrl,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + // UserAssignedIdentitiesListResult values returned by the List operation. type UserAssignedIdentitiesListResult struct { autorest.Response `json:"-"` @@ -485,3 +723,13 @@ func (page UserAssignedIdentitiesListResultPage) Values() []Identity { func NewUserAssignedIdentitiesListResultPage(getNextPage func(context.Context, UserAssignedIdentitiesListResult) (UserAssignedIdentitiesListResult, error)) UserAssignedIdentitiesListResultPage { return UserAssignedIdentitiesListResultPage{fn: getNextPage} } + +// UserAssignedIdentityProperties the properties associated with the user assigned identity. +type UserAssignedIdentityProperties struct { + // TenantID - READ-ONLY; The id of the tenant which the identity belongs to. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // PrincipalID - READ-ONLY; The id of the service principal object associated with the created identity. + PrincipalID *uuid.UUID `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The id of the app associated with the identity. This is a random generated UUID by MSI. + ClientID *uuid.UUID `json:"clientId,omitempty"` +} diff --git a/services/msi/mgmt/2018-11-30/msi/msiapi/interfaces.go b/services/msi/mgmt/2018-11-30/msi/msiapi/interfaces.go index 5d6051d6bb02..5a4de3ecc347 100644 --- a/services/msi/mgmt/2018-11-30/msi/msiapi/interfaces.go +++ b/services/msi/mgmt/2018-11-30/msi/msiapi/interfaces.go @@ -23,6 +23,13 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// SystemAssignedIdentitiesClientAPI contains the set of methods on the SystemAssignedIdentitiesClient type. +type SystemAssignedIdentitiesClientAPI interface { + GetByScope(ctx context.Context, scope string) (result msi.SystemAssignedIdentity, err error) +} + +var _ SystemAssignedIdentitiesClientAPI = (*msi.SystemAssignedIdentitiesClient)(nil) + // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { List(ctx context.Context) (result msi.OperationListResultPage, err error) @@ -40,7 +47,7 @@ type UserAssignedIdentitiesClientAPI interface { ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result msi.UserAssignedIdentitiesListResultIterator, err error) ListBySubscription(ctx context.Context) (result msi.UserAssignedIdentitiesListResultPage, err error) ListBySubscriptionComplete(ctx context.Context) (result msi.UserAssignedIdentitiesListResultIterator, err error) - Update(ctx context.Context, resourceGroupName string, resourceName string, parameters msi.Identity) (result msi.Identity, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, parameters msi.IdentityUpdate) (result msi.Identity, err error) } var _ UserAssignedIdentitiesClientAPI = (*msi.UserAssignedIdentitiesClient)(nil) diff --git a/services/msi/mgmt/2018-11-30/msi/operations.go b/services/msi/mgmt/2018-11-30/msi/operations.go index d126589c210e..5092cd22a411 100644 --- a/services/msi/mgmt/2018-11-30/msi/operations.go +++ b/services/msi/mgmt/2018-11-30/msi/operations.go @@ -93,8 +93,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always diff --git a/services/msi/mgmt/2018-11-30/msi/systemassignedidentities.go b/services/msi/mgmt/2018-11-30/msi/systemassignedidentities.go new file mode 100644 index 000000000000..e166907e1785 --- /dev/null +++ b/services/msi/mgmt/2018-11-30/msi/systemassignedidentities.go @@ -0,0 +1,116 @@ +package msi + +// 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/tracing" + "net/http" +) + +// SystemAssignedIdentitiesClient is the the Managed Service Identity Client. +type SystemAssignedIdentitiesClient struct { + BaseClient +} + +// NewSystemAssignedIdentitiesClient creates an instance of the SystemAssignedIdentitiesClient client. +func NewSystemAssignedIdentitiesClient(subscriptionID string) SystemAssignedIdentitiesClient { + return NewSystemAssignedIdentitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSystemAssignedIdentitiesClientWithBaseURI creates an instance of the SystemAssignedIdentitiesClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSystemAssignedIdentitiesClientWithBaseURI(baseURI string, subscriptionID string) SystemAssignedIdentitiesClient { + return SystemAssignedIdentitiesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetByScope gets the systemAssignedIdentity available under the specified RP scope. +// Parameters: +// scope - the resource provider scope of the resource. Parent resource being extended by Managed Identities. +func (client SystemAssignedIdentitiesClient) GetByScope(ctx context.Context, scope string) (result SystemAssignedIdentity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SystemAssignedIdentitiesClient.GetByScope") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByScopePreparer(ctx, scope) + if err != nil { + err = autorest.NewErrorWithError(err, "msi.SystemAssignedIdentitiesClient", "GetByScope", nil, "Failure preparing request") + return + } + + resp, err := client.GetByScopeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "msi.SystemAssignedIdentitiesClient", "GetByScope", resp, "Failure sending request") + return + } + + result, err = client.GetByScopeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "msi.SystemAssignedIdentitiesClient", "GetByScope", resp, "Failure responding to request") + } + + return +} + +// GetByScopePreparer prepares the GetByScope request. +func (client SystemAssignedIdentitiesClient) GetByScopePreparer(ctx context.Context, scope string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": scope, + } + + const APIVersion = "2018-11-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.ManagedIdentity/identities/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByScopeSender sends the GetByScope request. The method will close the +// http.Response Body if it receives an error. +func (client SystemAssignedIdentitiesClient) GetByScopeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByScopeResponder handles the response to the GetByScope request. The method always +// closes the http.Response Body. +func (client SystemAssignedIdentitiesClient) GetByScopeResponder(resp *http.Response) (result SystemAssignedIdentity, 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/services/msi/mgmt/2018-11-30/msi/userassignedidentities.go b/services/msi/mgmt/2018-11-30/msi/userassignedidentities.go index 997e67790fb6..8859904d2896 100644 --- a/services/msi/mgmt/2018-11-30/msi/userassignedidentities.go +++ b/services/msi/mgmt/2018-11-30/msi/userassignedidentities.go @@ -92,9 +92,7 @@ func (client UserAssignedIdentitiesClient) CreateOrUpdatePreparer(ctx context.Co "api-version": APIVersion, } - parameters.ID = nil - parameters.Name = nil - parameters.Type = "" + parameters.UserAssignedIdentityProperties = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), @@ -108,8 +106,7 @@ func (client UserAssignedIdentitiesClient) CreateOrUpdatePreparer(ctx context.Co // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client UserAssignedIdentitiesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -185,8 +182,7 @@ func (client UserAssignedIdentitiesClient) DeletePreparer(ctx context.Context, r // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client UserAssignedIdentitiesClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -261,8 +257,7 @@ func (client UserAssignedIdentitiesClient) GetPreparer(ctx context.Context, reso // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client UserAssignedIdentitiesClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -337,8 +332,7 @@ func (client UserAssignedIdentitiesClient) ListByResourceGroupPreparer(ctx conte // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client UserAssignedIdentitiesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always @@ -447,8 +441,7 @@ func (client UserAssignedIdentitiesClient) ListBySubscriptionPreparer(ctx contex // ListBySubscriptionSender sends the ListBySubscription request. The method will close the // http.Response Body if it receives an error. func (client UserAssignedIdentitiesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always @@ -506,7 +499,7 @@ func (client UserAssignedIdentitiesClient) ListBySubscriptionComplete(ctx contex // resourceGroupName - the name of the Resource Group to which the identity belongs. // resourceName - the name of the identity resource. // parameters - parameters to update the identity -func (client UserAssignedIdentitiesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, parameters Identity) (result Identity, err error) { +func (client UserAssignedIdentitiesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, parameters IdentityUpdate) (result Identity, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserAssignedIdentitiesClient.Update") defer func() { @@ -539,7 +532,7 @@ func (client UserAssignedIdentitiesClient) Update(ctx context.Context, resourceG } // UpdatePreparer prepares the Update request. -func (client UserAssignedIdentitiesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters Identity) (*http.Request, error) { +func (client UserAssignedIdentitiesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters IdentityUpdate) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceName": autorest.Encode("path", resourceName), @@ -551,9 +544,7 @@ func (client UserAssignedIdentitiesClient) UpdatePreparer(ctx context.Context, r "api-version": APIVersion, } - parameters.ID = nil - parameters.Name = nil - parameters.Type = "" + parameters.UserAssignedIdentityProperties = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), @@ -567,8 +558,7 @@ func (client UserAssignedIdentitiesClient) UpdatePreparer(ctx context.Context, r // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client UserAssignedIdentitiesClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always