diff --git a/profiles/latest/eventgrid/mgmt/eventgrid/eventgridapi/models.go b/profiles/latest/eventgrid/mgmt/eventgrid/eventgridapi/models.go index 2f27b17da2a8..9499b7e2eeac 100644 --- a/profiles/latest/eventgrid/mgmt/eventgrid/eventgridapi/models.go +++ b/profiles/latest/eventgrid/mgmt/eventgrid/eventgridapi/models.go @@ -19,7 +19,7 @@ package eventgridapi -import original "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2018-01-01/eventgrid/eventgridapi" +import original "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2019-01-01/eventgrid/eventgridapi" type EventSubscriptionsClientAPI = original.EventSubscriptionsClientAPI type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/latest/eventgrid/mgmt/eventgrid/models.go b/profiles/latest/eventgrid/mgmt/eventgrid/models.go index 54cdbaafe6aa..dffc43e278bb 100644 --- a/profiles/latest/eventgrid/mgmt/eventgrid/models.go +++ b/profiles/latest/eventgrid/mgmt/eventgrid/models.go @@ -19,7 +19,7 @@ package eventgrid -import original "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2018-01-01/eventgrid" +import original "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2019-01-01/eventgrid" const ( DefaultBaseURI = original.DefaultBaseURI @@ -30,18 +30,28 @@ type EndpointType = original.EndpointType const ( EndpointTypeEventHub EndpointType = original.EndpointTypeEventHub EndpointTypeEventSubscriptionDestination EndpointType = original.EndpointTypeEventSubscriptionDestination + EndpointTypeHybridConnection EndpointType = original.EndpointTypeHybridConnection + EndpointTypeStorageQueue EndpointType = original.EndpointTypeStorageQueue EndpointTypeWebHook EndpointType = original.EndpointTypeWebHook ) +type EndpointTypeBasicDeadLetterDestination = original.EndpointTypeBasicDeadLetterDestination + +const ( + EndpointTypeDeadLetterDestination EndpointTypeBasicDeadLetterDestination = original.EndpointTypeDeadLetterDestination + EndpointTypeStorageBlob EndpointTypeBasicDeadLetterDestination = original.EndpointTypeStorageBlob +) + type EventSubscriptionProvisioningState = original.EventSubscriptionProvisioningState const ( - Canceled EventSubscriptionProvisioningState = original.Canceled - Creating EventSubscriptionProvisioningState = original.Creating - Deleting EventSubscriptionProvisioningState = original.Deleting - Failed EventSubscriptionProvisioningState = original.Failed - Succeeded EventSubscriptionProvisioningState = original.Succeeded - Updating EventSubscriptionProvisioningState = original.Updating + AwaitingManualAction EventSubscriptionProvisioningState = original.AwaitingManualAction + Canceled EventSubscriptionProvisioningState = original.Canceled + Creating EventSubscriptionProvisioningState = original.Creating + Deleting EventSubscriptionProvisioningState = original.Deleting + Failed EventSubscriptionProvisioningState = original.Failed + Succeeded EventSubscriptionProvisioningState = original.Succeeded + Updating EventSubscriptionProvisioningState = original.Updating ) type ResourceRegionType = original.ResourceRegionType @@ -74,7 +84,9 @@ const ( ) type BaseClient = original.BaseClient +type BasicDeadLetterDestination = original.BasicDeadLetterDestination type BasicEventSubscriptionDestination = original.BasicEventSubscriptionDestination +type DeadLetterDestination = original.DeadLetterDestination type EventHubEventSubscriptionDestination = original.EventHubEventSubscriptionDestination type EventHubEventSubscriptionDestinationProperties = original.EventHubEventSubscriptionDestinationProperties type EventSubscription = original.EventSubscription @@ -91,11 +103,18 @@ type EventSubscriptionsUpdateFuture = original.EventSubscriptionsUpdateFuture type EventType = original.EventType type EventTypeProperties = original.EventTypeProperties type EventTypesListResult = original.EventTypesListResult +type HybridConnectionEventSubscriptionDestination = original.HybridConnectionEventSubscriptionDestination +type HybridConnectionEventSubscriptionDestinationProperties = original.HybridConnectionEventSubscriptionDestinationProperties type Operation = original.Operation type OperationInfo = original.OperationInfo type OperationsClient = original.OperationsClient type OperationsListResult = original.OperationsListResult type Resource = original.Resource +type RetryPolicy = original.RetryPolicy +type StorageBlobDeadLetterDestination = original.StorageBlobDeadLetterDestination +type StorageBlobDeadLetterDestinationProperties = original.StorageBlobDeadLetterDestinationProperties +type StorageQueueEventSubscriptionDestination = original.StorageQueueEventSubscriptionDestination +type StorageQueueEventSubscriptionDestinationProperties = original.StorageQueueEventSubscriptionDestinationProperties type Topic = original.Topic type TopicProperties = original.TopicProperties type TopicRegenerateKeyRequest = original.TopicRegenerateKeyRequest @@ -144,6 +163,9 @@ func NewTopicsClientWithBaseURI(baseURI string, subscriptionID string) TopicsCli func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleEndpointTypeBasicDeadLetterDestinationValues() []EndpointTypeBasicDeadLetterDestination { + return original.PossibleEndpointTypeBasicDeadLetterDestinationValues() +} func PossibleEndpointTypeValues() []EndpointType { return original.PossibleEndpointTypeValues() } diff --git a/profiles/preview/preview/hanaonazure/mgmt/hanaonazure/models.go b/profiles/preview/preview/hanaonazure/mgmt/hanaonazure/models.go index 46b2927b5e57..918c6caa9775 100644 --- a/profiles/preview/preview/hanaonazure/mgmt/hanaonazure/models.go +++ b/profiles/preview/preview/hanaonazure/mgmt/hanaonazure/models.go @@ -89,6 +89,7 @@ type OperationList = original.OperationList type OperationsClient = original.OperationsClient type Resource = original.Resource type StorageProfile = original.StorageProfile +type Tags = original.Tags func New(subscriptionID string) BaseClient { return original.New(subscriptionID) diff --git a/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/hanainstances.go b/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/hanainstances.go index eac79936b34f..a77751e56ab9 100644 --- a/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/hanainstances.go +++ b/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/hanainstances.go @@ -417,3 +417,84 @@ func (client HanaInstancesClient) RestartResponder(resp *http.Response) (result result.Response = resp return } + +// Update patches the Tags field of a SAP HANA instance for the specified subscription, resource group, and instance +// name. +// Parameters: +// resourceGroupName - name of the resource group. +// hanaInstanceName - name of the SAP HANA on Azure instance. +// tagsParameter - request body that only contains the new Tags field +func (client HanaInstancesClient) Update(ctx context.Context, resourceGroupName string, hanaInstanceName string, tagsParameter Tags) (result HanaInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HanaInstancesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, hanaInstanceName, tagsParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hanaonazure.HanaInstancesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client HanaInstancesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hanaInstanceName string, tagsParameter Tags) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hanaInstanceName": autorest.Encode("path", hanaInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-11-03-preview" + 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}", pathParameters), + autorest.WithJSON(tagsParameter), + 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 HanaInstancesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client HanaInstancesClient) UpdateResponder(resp *http.Response) (result HanaInstance, 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/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/hanaonazureapi/interfaces.go b/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/hanaonazureapi/interfaces.go index 85b274f5d369..98fe2147b536 100644 --- a/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/hanaonazureapi/interfaces.go +++ b/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/hanaonazureapi/interfaces.go @@ -36,6 +36,7 @@ type HanaInstancesClientAPI interface { List(ctx context.Context) (result hanaonazure.HanaInstancesListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result hanaonazure.HanaInstancesListResultPage, err error) Restart(ctx context.Context, resourceGroupName string, hanaInstanceName string) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroupName string, hanaInstanceName string, tagsParameter hanaonazure.Tags) (result hanaonazure.HanaInstance, err error) } var _ HanaInstancesClientAPI = (*hanaonazure.HanaInstancesClient)(nil) diff --git a/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/models.go b/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/models.go index cc14ffc4ec98..04a44f88ef2c 100644 --- a/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/models.go +++ b/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/models.go @@ -507,3 +507,18 @@ type StorageProfile struct { // OsDisks - Specifies information about the operating system disk used by the hana instance. OsDisks *[]Disk `json:"osDisks,omitempty"` } + +// Tags tags field of the HANA instance. +type Tags struct { + // Tags - Tags field of the HANA instance. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Tags. +func (t Tags) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.Tags != nil { + objectMap["tags"] = t.Tags + } + return json.Marshal(objectMap) +}