diff --git a/services/storagesync/mgmt/2018-04-02/storagesync/CHANGELOG.md b/services/storagesync/mgmt/2018-04-02/storagesync/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/storagesync/mgmt/2018-04-02/storagesync/CHANGELOG.md +++ b/services/storagesync/mgmt/2018-04-02/storagesync/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/storagesync/mgmt/2018-04-02/storagesync/_meta.json b/services/storagesync/mgmt/2018-04-02/storagesync/_meta.json index 0c6bee7f58bc..aa0130e3e524 100644 --- a/services/storagesync/mgmt/2018-04-02/storagesync/_meta.json +++ b/services/storagesync/mgmt/2018-04-02/storagesync/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a90c57a07779ab3ffd7d42ccf194a024e55b3bfb", "readme": "/_/azure-rest-api-specs/specification/storagesync/resource-manager/readme.md", "tag": "package-2018-04-02", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/storagesync/mgmt/2018-04-02/storagesync/cloudendpoints.go b/services/storagesync/mgmt/2018-04-02/storagesync/cloudendpoints.go index eaee7f3f065c..547c9bcfff88 100644 --- a/services/storagesync/mgmt/2018-04-02/storagesync/cloudendpoints.go +++ b/services/storagesync/mgmt/2018-04-02/storagesync/cloudendpoints.go @@ -54,8 +54,7 @@ func (client CloudEndpointsClient) Create(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Create", err.Error()) } @@ -149,8 +148,7 @@ func (client CloudEndpointsClient) Delete(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Delete", err.Error()) } @@ -241,8 +239,7 @@ func (client CloudEndpointsClient) Get(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Get", err.Error()) } @@ -330,8 +327,7 @@ func (client CloudEndpointsClient) ListBySyncGroup(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -420,8 +416,7 @@ func (client CloudEndpointsClient) PostBackup(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostBackup", err.Error()) } @@ -516,8 +511,7 @@ func (client CloudEndpointsClient) PostRestore(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostRestore", err.Error()) } @@ -611,8 +605,7 @@ func (client CloudEndpointsClient) PreBackup(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreBackup", err.Error()) } @@ -706,8 +699,7 @@ func (client CloudEndpointsClient) PreRestore(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreRestore", err.Error()) } @@ -800,8 +792,7 @@ func (client CloudEndpointsClient) Restoreheartbeat(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Restoreheartbeat", err.Error()) } diff --git a/services/storagesync/mgmt/2018-04-02/storagesync/registeredservers.go b/services/storagesync/mgmt/2018-04-02/storagesync/registeredservers.go index 1935f8359649..48c1884491c6 100644 --- a/services/storagesync/mgmt/2018-04-02/storagesync/registeredservers.go +++ b/services/storagesync/mgmt/2018-04-02/storagesync/registeredservers.go @@ -54,8 +54,7 @@ func (client RegisteredServersClient) Create(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Create", err.Error()) } @@ -147,8 +146,7 @@ func (client RegisteredServersClient) Delete(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Delete", err.Error()) } @@ -237,8 +235,7 @@ func (client RegisteredServersClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Get", err.Error()) } @@ -324,8 +321,7 @@ func (client RegisteredServersClient) ListByStorageSyncService(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2018-04-02/storagesync/serverendpoints.go b/services/storagesync/mgmt/2018-04-02/storagesync/serverendpoints.go index 7a828d03ffb6..fff04a29d065 100644 --- a/services/storagesync/mgmt/2018-04-02/storagesync/serverendpoints.go +++ b/services/storagesync/mgmt/2018-04-02/storagesync/serverendpoints.go @@ -54,8 +54,7 @@ func (client ServerEndpointsClient) Create(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties.VolumeFreeSpacePercent", Name: validation.Null, Rule: false, @@ -156,8 +155,7 @@ func (client ServerEndpointsClient) Delete(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Delete", err.Error()) } @@ -248,8 +246,7 @@ func (client ServerEndpointsClient) Get(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Get", err.Error()) } @@ -337,8 +334,7 @@ func (client ServerEndpointsClient) ListBySyncGroup(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -427,8 +423,7 @@ func (client ServerEndpointsClient) RecallAction(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "RecallAction", err.Error()) } @@ -522,8 +517,7 @@ func (client ServerEndpointsClient) Update(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2018-04-02/storagesync/services.go b/services/storagesync/mgmt/2018-04-02/storagesync/services.go index 656225a0b784..854a3f332e88 100644 --- a/services/storagesync/mgmt/2018-04-02/storagesync/services.go +++ b/services/storagesync/mgmt/2018-04-02/storagesync/services.go @@ -138,8 +138,7 @@ func (client ServicesClient) Create(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Create", err.Error()) } @@ -226,8 +225,7 @@ func (client ServicesClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Delete", err.Error()) } @@ -311,8 +309,7 @@ func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Get", err.Error()) } @@ -396,8 +393,7 @@ func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "ListByResourceGroup", err.Error()) } @@ -559,8 +555,7 @@ func (client ServicesClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2018-04-02/storagesync/syncgroups.go b/services/storagesync/mgmt/2018-04-02/storagesync/syncgroups.go index caf462b7efa8..092b5b13cd11 100644 --- a/services/storagesync/mgmt/2018-04-02/storagesync/syncgroups.go +++ b/services/storagesync/mgmt/2018-04-02/storagesync/syncgroups.go @@ -53,8 +53,7 @@ func (client SyncGroupsClient) Create(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Create", err.Error()) } @@ -143,8 +142,7 @@ func (client SyncGroupsClient) Delete(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Delete", err.Error()) } @@ -230,8 +228,7 @@ func (client SyncGroupsClient) Get(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Get", err.Error()) } @@ -317,8 +314,7 @@ func (client SyncGroupsClient) ListByStorageSyncService(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2018-04-02/storagesync/workflows.go b/services/storagesync/mgmt/2018-04-02/storagesync/workflows.go index 2a0f83f801c3..58e44274cb78 100644 --- a/services/storagesync/mgmt/2018-04-02/storagesync/workflows.go +++ b/services/storagesync/mgmt/2018-04-02/storagesync/workflows.go @@ -52,8 +52,7 @@ func (client WorkflowsClient) Abort(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Abort", err.Error()) } @@ -139,8 +138,7 @@ func (client WorkflowsClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Get", err.Error()) } diff --git a/services/storagesync/mgmt/2018-07-01/storagesync/CHANGELOG.md b/services/storagesync/mgmt/2018-07-01/storagesync/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/storagesync/mgmt/2018-07-01/storagesync/CHANGELOG.md +++ b/services/storagesync/mgmt/2018-07-01/storagesync/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/storagesync/mgmt/2018-07-01/storagesync/_meta.json b/services/storagesync/mgmt/2018-07-01/storagesync/_meta.json index 3b605cadd1b5..e70741cbb7af 100644 --- a/services/storagesync/mgmt/2018-07-01/storagesync/_meta.json +++ b/services/storagesync/mgmt/2018-07-01/storagesync/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a90c57a07779ab3ffd7d42ccf194a024e55b3bfb", "readme": "/_/azure-rest-api-specs/specification/storagesync/resource-manager/readme.md", "tag": "package-2018-07-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/storagesync/mgmt/2018-07-01/storagesync/cloudendpoints.go b/services/storagesync/mgmt/2018-07-01/storagesync/cloudendpoints.go index a4f0ca69cd2d..7dbd577f623d 100644 --- a/services/storagesync/mgmt/2018-07-01/storagesync/cloudendpoints.go +++ b/services/storagesync/mgmt/2018-07-01/storagesync/cloudendpoints.go @@ -54,8 +54,7 @@ func (client CloudEndpointsClient) Create(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Create", err.Error()) } @@ -149,8 +148,7 @@ func (client CloudEndpointsClient) Delete(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Delete", err.Error()) } @@ -241,8 +239,7 @@ func (client CloudEndpointsClient) Get(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Get", err.Error()) } @@ -330,8 +327,7 @@ func (client CloudEndpointsClient) ListBySyncGroup(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -420,8 +416,7 @@ func (client CloudEndpointsClient) PostBackup(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostBackup", err.Error()) } @@ -516,8 +511,7 @@ func (client CloudEndpointsClient) PostRestore(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostRestore", err.Error()) } @@ -611,8 +605,7 @@ func (client CloudEndpointsClient) PreBackup(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreBackup", err.Error()) } @@ -706,8 +699,7 @@ func (client CloudEndpointsClient) PreRestore(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreRestore", err.Error()) } @@ -800,8 +792,7 @@ func (client CloudEndpointsClient) Restoreheartbeat(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Restoreheartbeat", err.Error()) } diff --git a/services/storagesync/mgmt/2018-07-01/storagesync/registeredservers.go b/services/storagesync/mgmt/2018-07-01/storagesync/registeredservers.go index 317fa5c249c5..6011a84c1bba 100644 --- a/services/storagesync/mgmt/2018-07-01/storagesync/registeredservers.go +++ b/services/storagesync/mgmt/2018-07-01/storagesync/registeredservers.go @@ -54,8 +54,7 @@ func (client RegisteredServersClient) Create(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Create", err.Error()) } @@ -147,8 +146,7 @@ func (client RegisteredServersClient) Delete(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Delete", err.Error()) } @@ -237,8 +235,7 @@ func (client RegisteredServersClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Get", err.Error()) } @@ -324,8 +321,7 @@ func (client RegisteredServersClient) ListByStorageSyncService(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "ListByStorageSyncService", err.Error()) } @@ -412,8 +408,7 @@ func (client RegisteredServersClient) TriggerRollover(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "TriggerRollover", err.Error()) } diff --git a/services/storagesync/mgmt/2018-07-01/storagesync/serverendpoints.go b/services/storagesync/mgmt/2018-07-01/storagesync/serverendpoints.go index e42d0dd44188..5aea76f22c22 100644 --- a/services/storagesync/mgmt/2018-07-01/storagesync/serverendpoints.go +++ b/services/storagesync/mgmt/2018-07-01/storagesync/serverendpoints.go @@ -54,8 +54,7 @@ func (client ServerEndpointsClient) Create(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties.VolumeFreeSpacePercent", Name: validation.Null, Rule: false, @@ -160,8 +159,7 @@ func (client ServerEndpointsClient) Delete(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Delete", err.Error()) } @@ -252,8 +250,7 @@ func (client ServerEndpointsClient) Get(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Get", err.Error()) } @@ -341,8 +338,7 @@ func (client ServerEndpointsClient) ListBySyncGroup(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -431,8 +427,7 @@ func (client ServerEndpointsClient) RecallAction(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "RecallAction", err.Error()) } @@ -526,8 +521,7 @@ func (client ServerEndpointsClient) Update(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2018-07-01/storagesync/services.go b/services/storagesync/mgmt/2018-07-01/storagesync/services.go index 5e846bc284da..fd64bad6b59f 100644 --- a/services/storagesync/mgmt/2018-07-01/storagesync/services.go +++ b/services/storagesync/mgmt/2018-07-01/storagesync/services.go @@ -138,8 +138,7 @@ func (client ServicesClient) Create(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Create", err.Error()) @@ -228,8 +227,7 @@ func (client ServicesClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Delete", err.Error()) } @@ -313,8 +311,7 @@ func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Get", err.Error()) } @@ -398,8 +395,7 @@ func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "ListByResourceGroup", err.Error()) } @@ -561,8 +557,7 @@ func (client ServicesClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2018-07-01/storagesync/syncgroups.go b/services/storagesync/mgmt/2018-07-01/storagesync/syncgroups.go index 7a55e0475037..9536c368a974 100644 --- a/services/storagesync/mgmt/2018-07-01/storagesync/syncgroups.go +++ b/services/storagesync/mgmt/2018-07-01/storagesync/syncgroups.go @@ -53,8 +53,7 @@ func (client SyncGroupsClient) Create(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Create", err.Error()) } @@ -143,8 +142,7 @@ func (client SyncGroupsClient) Delete(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Delete", err.Error()) } @@ -230,8 +228,7 @@ func (client SyncGroupsClient) Get(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Get", err.Error()) } @@ -317,8 +314,7 @@ func (client SyncGroupsClient) ListByStorageSyncService(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2018-07-01/storagesync/workflows.go b/services/storagesync/mgmt/2018-07-01/storagesync/workflows.go index c50899567560..01f0a946b341 100644 --- a/services/storagesync/mgmt/2018-07-01/storagesync/workflows.go +++ b/services/storagesync/mgmt/2018-07-01/storagesync/workflows.go @@ -52,8 +52,7 @@ func (client WorkflowsClient) Abort(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Abort", err.Error()) } @@ -139,8 +138,7 @@ func (client WorkflowsClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Get", err.Error()) } @@ -226,8 +224,7 @@ func (client WorkflowsClient) ListByStorageSyncService(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2018-10-01/storagesync/CHANGELOG.md b/services/storagesync/mgmt/2018-10-01/storagesync/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/storagesync/mgmt/2018-10-01/storagesync/CHANGELOG.md +++ b/services/storagesync/mgmt/2018-10-01/storagesync/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/storagesync/mgmt/2018-10-01/storagesync/_meta.json b/services/storagesync/mgmt/2018-10-01/storagesync/_meta.json index caa97dbd49ee..0de5e8c02591 100644 --- a/services/storagesync/mgmt/2018-10-01/storagesync/_meta.json +++ b/services/storagesync/mgmt/2018-10-01/storagesync/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a90c57a07779ab3ffd7d42ccf194a024e55b3bfb", "readme": "/_/azure-rest-api-specs/specification/storagesync/resource-manager/readme.md", "tag": "package-2018-10-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/storagesync/mgmt/2018-10-01/storagesync/cloudendpoints.go b/services/storagesync/mgmt/2018-10-01/storagesync/cloudendpoints.go index eb01cff1883d..0397683101d0 100644 --- a/services/storagesync/mgmt/2018-10-01/storagesync/cloudendpoints.go +++ b/services/storagesync/mgmt/2018-10-01/storagesync/cloudendpoints.go @@ -54,8 +54,7 @@ func (client CloudEndpointsClient) Create(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Create", err.Error()) } @@ -149,8 +148,7 @@ func (client CloudEndpointsClient) Delete(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Delete", err.Error()) } @@ -241,8 +239,7 @@ func (client CloudEndpointsClient) Get(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Get", err.Error()) } @@ -330,8 +327,7 @@ func (client CloudEndpointsClient) ListBySyncGroup(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -420,8 +416,7 @@ func (client CloudEndpointsClient) PostBackup(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostBackup", err.Error()) } @@ -516,8 +511,7 @@ func (client CloudEndpointsClient) PostRestore(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostRestore", err.Error()) } @@ -611,8 +605,7 @@ func (client CloudEndpointsClient) PreBackup(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreBackup", err.Error()) } @@ -706,8 +699,7 @@ func (client CloudEndpointsClient) PreRestore(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreRestore", err.Error()) } @@ -800,8 +792,7 @@ func (client CloudEndpointsClient) Restoreheartbeat(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Restoreheartbeat", err.Error()) } diff --git a/services/storagesync/mgmt/2018-10-01/storagesync/registeredservers.go b/services/storagesync/mgmt/2018-10-01/storagesync/registeredservers.go index bbe604c12d5a..4a7f8de8948f 100644 --- a/services/storagesync/mgmt/2018-10-01/storagesync/registeredservers.go +++ b/services/storagesync/mgmt/2018-10-01/storagesync/registeredservers.go @@ -54,8 +54,7 @@ func (client RegisteredServersClient) Create(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Create", err.Error()) } @@ -147,8 +146,7 @@ func (client RegisteredServersClient) Delete(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Delete", err.Error()) } @@ -237,8 +235,7 @@ func (client RegisteredServersClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Get", err.Error()) } @@ -324,8 +321,7 @@ func (client RegisteredServersClient) ListByStorageSyncService(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "ListByStorageSyncService", err.Error()) } @@ -412,8 +408,7 @@ func (client RegisteredServersClient) TriggerRollover(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "TriggerRollover", err.Error()) } diff --git a/services/storagesync/mgmt/2018-10-01/storagesync/serverendpoints.go b/services/storagesync/mgmt/2018-10-01/storagesync/serverendpoints.go index f8d76a04d370..b42e1bea1aa9 100644 --- a/services/storagesync/mgmt/2018-10-01/storagesync/serverendpoints.go +++ b/services/storagesync/mgmt/2018-10-01/storagesync/serverendpoints.go @@ -54,8 +54,7 @@ func (client ServerEndpointsClient) Create(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties.VolumeFreeSpacePercent", Name: validation.Null, Rule: false, @@ -160,8 +159,7 @@ func (client ServerEndpointsClient) Delete(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Delete", err.Error()) } @@ -252,8 +250,7 @@ func (client ServerEndpointsClient) Get(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Get", err.Error()) } @@ -341,8 +338,7 @@ func (client ServerEndpointsClient) ListBySyncGroup(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -431,8 +427,7 @@ func (client ServerEndpointsClient) RecallAction(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "RecallAction", err.Error()) } @@ -526,8 +521,7 @@ func (client ServerEndpointsClient) Update(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2018-10-01/storagesync/services.go b/services/storagesync/mgmt/2018-10-01/storagesync/services.go index eed67270b938..39130817d18c 100644 --- a/services/storagesync/mgmt/2018-10-01/storagesync/services.go +++ b/services/storagesync/mgmt/2018-10-01/storagesync/services.go @@ -138,8 +138,7 @@ func (client ServicesClient) Create(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Create", err.Error()) @@ -228,8 +227,7 @@ func (client ServicesClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Delete", err.Error()) } @@ -313,8 +311,7 @@ func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Get", err.Error()) } @@ -398,8 +395,7 @@ func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "ListByResourceGroup", err.Error()) } @@ -561,8 +557,7 @@ func (client ServicesClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2018-10-01/storagesync/syncgroups.go b/services/storagesync/mgmt/2018-10-01/storagesync/syncgroups.go index 07e255b4ac7a..2f967dcee21a 100644 --- a/services/storagesync/mgmt/2018-10-01/storagesync/syncgroups.go +++ b/services/storagesync/mgmt/2018-10-01/storagesync/syncgroups.go @@ -53,8 +53,7 @@ func (client SyncGroupsClient) Create(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Create", err.Error()) } @@ -143,8 +142,7 @@ func (client SyncGroupsClient) Delete(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Delete", err.Error()) } @@ -230,8 +228,7 @@ func (client SyncGroupsClient) Get(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Get", err.Error()) } @@ -317,8 +314,7 @@ func (client SyncGroupsClient) ListByStorageSyncService(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2018-10-01/storagesync/workflows.go b/services/storagesync/mgmt/2018-10-01/storagesync/workflows.go index eddb2f6e5ff7..f4c315989941 100644 --- a/services/storagesync/mgmt/2018-10-01/storagesync/workflows.go +++ b/services/storagesync/mgmt/2018-10-01/storagesync/workflows.go @@ -52,8 +52,7 @@ func (client WorkflowsClient) Abort(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Abort", err.Error()) } @@ -139,8 +138,7 @@ func (client WorkflowsClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Get", err.Error()) } @@ -226,8 +224,7 @@ func (client WorkflowsClient) ListByStorageSyncService(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2019-02-01/storagesync/CHANGELOG.md b/services/storagesync/mgmt/2019-02-01/storagesync/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/storagesync/mgmt/2019-02-01/storagesync/CHANGELOG.md +++ b/services/storagesync/mgmt/2019-02-01/storagesync/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/storagesync/mgmt/2019-02-01/storagesync/_meta.json b/services/storagesync/mgmt/2019-02-01/storagesync/_meta.json index 9770f72d574d..1dea043468f3 100644 --- a/services/storagesync/mgmt/2019-02-01/storagesync/_meta.json +++ b/services/storagesync/mgmt/2019-02-01/storagesync/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a90c57a07779ab3ffd7d42ccf194a024e55b3bfb", "readme": "/_/azure-rest-api-specs/specification/storagesync/resource-manager/readme.md", "tag": "package-2019-02-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/storagesync/mgmt/2019-02-01/storagesync/cloudendpoints.go b/services/storagesync/mgmt/2019-02-01/storagesync/cloudendpoints.go index 1d8f68cb46ac..51f751dd0537 100644 --- a/services/storagesync/mgmt/2019-02-01/storagesync/cloudendpoints.go +++ b/services/storagesync/mgmt/2019-02-01/storagesync/cloudendpoints.go @@ -54,8 +54,7 @@ func (client CloudEndpointsClient) Create(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Create", err.Error()) } @@ -149,8 +148,7 @@ func (client CloudEndpointsClient) Delete(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Delete", err.Error()) } @@ -241,8 +239,7 @@ func (client CloudEndpointsClient) Get(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Get", err.Error()) } @@ -330,8 +327,7 @@ func (client CloudEndpointsClient) ListBySyncGroup(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -420,8 +416,7 @@ func (client CloudEndpointsClient) PostBackup(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostBackup", err.Error()) } @@ -516,8 +511,7 @@ func (client CloudEndpointsClient) PostRestore(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostRestore", err.Error()) } @@ -611,8 +605,7 @@ func (client CloudEndpointsClient) PreBackup(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreBackup", err.Error()) } @@ -706,8 +699,7 @@ func (client CloudEndpointsClient) PreRestore(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreRestore", err.Error()) } @@ -800,8 +792,7 @@ func (client CloudEndpointsClient) Restoreheartbeat(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Restoreheartbeat", err.Error()) } diff --git a/services/storagesync/mgmt/2019-02-01/storagesync/registeredservers.go b/services/storagesync/mgmt/2019-02-01/storagesync/registeredservers.go index 88e84bba721c..aa652ec7824c 100644 --- a/services/storagesync/mgmt/2019-02-01/storagesync/registeredservers.go +++ b/services/storagesync/mgmt/2019-02-01/storagesync/registeredservers.go @@ -54,8 +54,7 @@ func (client RegisteredServersClient) Create(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Create", err.Error()) } @@ -147,8 +146,7 @@ func (client RegisteredServersClient) Delete(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Delete", err.Error()) } @@ -237,8 +235,7 @@ func (client RegisteredServersClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Get", err.Error()) } @@ -324,8 +321,7 @@ func (client RegisteredServersClient) ListByStorageSyncService(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "ListByStorageSyncService", err.Error()) } @@ -412,8 +408,7 @@ func (client RegisteredServersClient) TriggerRollover(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "TriggerRollover", err.Error()) } diff --git a/services/storagesync/mgmt/2019-02-01/storagesync/serverendpoints.go b/services/storagesync/mgmt/2019-02-01/storagesync/serverendpoints.go index 028943c19ef1..8b5ea1d249d2 100644 --- a/services/storagesync/mgmt/2019-02-01/storagesync/serverendpoints.go +++ b/services/storagesync/mgmt/2019-02-01/storagesync/serverendpoints.go @@ -54,8 +54,7 @@ func (client ServerEndpointsClient) Create(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties.VolumeFreeSpacePercent", Name: validation.Null, Rule: false, @@ -160,8 +159,7 @@ func (client ServerEndpointsClient) Delete(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Delete", err.Error()) } @@ -252,8 +250,7 @@ func (client ServerEndpointsClient) Get(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Get", err.Error()) } @@ -341,8 +338,7 @@ func (client ServerEndpointsClient) ListBySyncGroup(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -431,8 +427,7 @@ func (client ServerEndpointsClient) RecallAction(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "RecallAction", err.Error()) } @@ -526,8 +521,7 @@ func (client ServerEndpointsClient) Update(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2019-02-01/storagesync/services.go b/services/storagesync/mgmt/2019-02-01/storagesync/services.go index 5c6d1ada1041..c6b26bb7d3c1 100644 --- a/services/storagesync/mgmt/2019-02-01/storagesync/services.go +++ b/services/storagesync/mgmt/2019-02-01/storagesync/services.go @@ -138,8 +138,7 @@ func (client ServicesClient) Create(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Create", err.Error()) @@ -228,8 +227,7 @@ func (client ServicesClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Delete", err.Error()) } @@ -313,8 +311,7 @@ func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Get", err.Error()) } @@ -398,8 +395,7 @@ func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "ListByResourceGroup", err.Error()) } @@ -561,8 +557,7 @@ func (client ServicesClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2019-02-01/storagesync/syncgroups.go b/services/storagesync/mgmt/2019-02-01/storagesync/syncgroups.go index d7c2df142e78..61480a44258a 100644 --- a/services/storagesync/mgmt/2019-02-01/storagesync/syncgroups.go +++ b/services/storagesync/mgmt/2019-02-01/storagesync/syncgroups.go @@ -53,8 +53,7 @@ func (client SyncGroupsClient) Create(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Create", err.Error()) } @@ -143,8 +142,7 @@ func (client SyncGroupsClient) Delete(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Delete", err.Error()) } @@ -230,8 +228,7 @@ func (client SyncGroupsClient) Get(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Get", err.Error()) } @@ -317,8 +314,7 @@ func (client SyncGroupsClient) ListByStorageSyncService(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2019-02-01/storagesync/workflows.go b/services/storagesync/mgmt/2019-02-01/storagesync/workflows.go index a8bb67fb8c74..d8d020a584cf 100644 --- a/services/storagesync/mgmt/2019-02-01/storagesync/workflows.go +++ b/services/storagesync/mgmt/2019-02-01/storagesync/workflows.go @@ -52,8 +52,7 @@ func (client WorkflowsClient) Abort(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Abort", err.Error()) } @@ -139,8 +138,7 @@ func (client WorkflowsClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Get", err.Error()) } @@ -226,8 +224,7 @@ func (client WorkflowsClient) ListByStorageSyncService(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2019-06-01/storagesync/CHANGELOG.md b/services/storagesync/mgmt/2019-06-01/storagesync/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/storagesync/mgmt/2019-06-01/storagesync/CHANGELOG.md +++ b/services/storagesync/mgmt/2019-06-01/storagesync/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/storagesync/mgmt/2019-06-01/storagesync/_meta.json b/services/storagesync/mgmt/2019-06-01/storagesync/_meta.json index 0fdb38343f65..a02e57ece04f 100644 --- a/services/storagesync/mgmt/2019-06-01/storagesync/_meta.json +++ b/services/storagesync/mgmt/2019-06-01/storagesync/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a90c57a07779ab3ffd7d42ccf194a024e55b3bfb", "readme": "/_/azure-rest-api-specs/specification/storagesync/resource-manager/readme.md", "tag": "package-2019-06-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/storagesync/mgmt/2019-06-01/storagesync/cloudendpoints.go b/services/storagesync/mgmt/2019-06-01/storagesync/cloudendpoints.go index 9dc82ce08bff..28bcedd1d08f 100644 --- a/services/storagesync/mgmt/2019-06-01/storagesync/cloudendpoints.go +++ b/services/storagesync/mgmt/2019-06-01/storagesync/cloudendpoints.go @@ -54,8 +54,7 @@ func (client CloudEndpointsClient) Create(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Create", err.Error()) } @@ -149,8 +148,7 @@ func (client CloudEndpointsClient) Delete(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Delete", err.Error()) } @@ -241,8 +239,7 @@ func (client CloudEndpointsClient) Get(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Get", err.Error()) } @@ -330,8 +327,7 @@ func (client CloudEndpointsClient) ListBySyncGroup(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -420,8 +416,7 @@ func (client CloudEndpointsClient) PostBackup(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostBackup", err.Error()) } @@ -516,8 +511,7 @@ func (client CloudEndpointsClient) PostRestore(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostRestore", err.Error()) } @@ -611,8 +605,7 @@ func (client CloudEndpointsClient) PreBackup(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreBackup", err.Error()) } @@ -706,8 +699,7 @@ func (client CloudEndpointsClient) PreRestore(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreRestore", err.Error()) } @@ -800,8 +792,7 @@ func (client CloudEndpointsClient) Restoreheartbeat(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Restoreheartbeat", err.Error()) } @@ -891,8 +882,7 @@ func (client CloudEndpointsClient) TriggerChangeDetection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "TriggerChangeDetection", err.Error()) } diff --git a/services/storagesync/mgmt/2019-06-01/storagesync/operationstatus.go b/services/storagesync/mgmt/2019-06-01/storagesync/operationstatus.go index 808b0525d463..a015fae23745 100644 --- a/services/storagesync/mgmt/2019-06-01/storagesync/operationstatus.go +++ b/services/storagesync/mgmt/2019-06-01/storagesync/operationstatus.go @@ -53,8 +53,7 @@ func (client OperationStatusClient) Get(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.OperationStatusClient", "Get", err.Error()) } diff --git a/services/storagesync/mgmt/2019-06-01/storagesync/registeredservers.go b/services/storagesync/mgmt/2019-06-01/storagesync/registeredservers.go index 9398ce2df35a..86fd3b50ad93 100644 --- a/services/storagesync/mgmt/2019-06-01/storagesync/registeredservers.go +++ b/services/storagesync/mgmt/2019-06-01/storagesync/registeredservers.go @@ -54,8 +54,7 @@ func (client RegisteredServersClient) Create(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Create", err.Error()) } @@ -147,8 +146,7 @@ func (client RegisteredServersClient) Delete(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Delete", err.Error()) } @@ -237,8 +235,7 @@ func (client RegisteredServersClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Get", err.Error()) } @@ -324,8 +321,7 @@ func (client RegisteredServersClient) ListByStorageSyncService(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "ListByStorageSyncService", err.Error()) } @@ -412,8 +408,7 @@ func (client RegisteredServersClient) TriggerRollover(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "TriggerRollover", err.Error()) } diff --git a/services/storagesync/mgmt/2019-06-01/storagesync/serverendpoints.go b/services/storagesync/mgmt/2019-06-01/storagesync/serverendpoints.go index 95b694333ad0..b8c2ddbe267b 100644 --- a/services/storagesync/mgmt/2019-06-01/storagesync/serverendpoints.go +++ b/services/storagesync/mgmt/2019-06-01/storagesync/serverendpoints.go @@ -54,8 +54,7 @@ func (client ServerEndpointsClient) Create(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties.VolumeFreeSpacePercent", Name: validation.Null, Rule: false, @@ -160,8 +159,7 @@ func (client ServerEndpointsClient) Delete(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Delete", err.Error()) } @@ -252,8 +250,7 @@ func (client ServerEndpointsClient) Get(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Get", err.Error()) } @@ -341,8 +338,7 @@ func (client ServerEndpointsClient) ListBySyncGroup(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -431,8 +427,7 @@ func (client ServerEndpointsClient) RecallAction(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "RecallAction", err.Error()) } @@ -526,8 +521,7 @@ func (client ServerEndpointsClient) Update(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2019-06-01/storagesync/services.go b/services/storagesync/mgmt/2019-06-01/storagesync/services.go index 0fc0e25e749a..84fb3f99b997 100644 --- a/services/storagesync/mgmt/2019-06-01/storagesync/services.go +++ b/services/storagesync/mgmt/2019-06-01/storagesync/services.go @@ -138,8 +138,7 @@ func (client ServicesClient) Create(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Create", err.Error()) @@ -228,8 +227,7 @@ func (client ServicesClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Delete", err.Error()) } @@ -313,8 +311,7 @@ func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Get", err.Error()) } @@ -398,8 +395,7 @@ func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "ListByResourceGroup", err.Error()) } @@ -561,8 +557,7 @@ func (client ServicesClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2019-06-01/storagesync/syncgroups.go b/services/storagesync/mgmt/2019-06-01/storagesync/syncgroups.go index 42fd635481e3..15dd99bce0f6 100644 --- a/services/storagesync/mgmt/2019-06-01/storagesync/syncgroups.go +++ b/services/storagesync/mgmt/2019-06-01/storagesync/syncgroups.go @@ -53,8 +53,7 @@ func (client SyncGroupsClient) Create(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Create", err.Error()) } @@ -143,8 +142,7 @@ func (client SyncGroupsClient) Delete(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Delete", err.Error()) } @@ -230,8 +228,7 @@ func (client SyncGroupsClient) Get(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Get", err.Error()) } @@ -317,8 +314,7 @@ func (client SyncGroupsClient) ListByStorageSyncService(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2019-06-01/storagesync/workflows.go b/services/storagesync/mgmt/2019-06-01/storagesync/workflows.go index b9ba8789c383..c89746fe07e8 100644 --- a/services/storagesync/mgmt/2019-06-01/storagesync/workflows.go +++ b/services/storagesync/mgmt/2019-06-01/storagesync/workflows.go @@ -52,8 +52,7 @@ func (client WorkflowsClient) Abort(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Abort", err.Error()) } @@ -139,8 +138,7 @@ func (client WorkflowsClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Get", err.Error()) } @@ -226,8 +224,7 @@ func (client WorkflowsClient) ListByStorageSyncService(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2019-10-01/storagesync/CHANGELOG.md b/services/storagesync/mgmt/2019-10-01/storagesync/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/storagesync/mgmt/2019-10-01/storagesync/CHANGELOG.md +++ b/services/storagesync/mgmt/2019-10-01/storagesync/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/storagesync/mgmt/2019-10-01/storagesync/_meta.json b/services/storagesync/mgmt/2019-10-01/storagesync/_meta.json index 91a2a157d6a2..8438045cdee0 100644 --- a/services/storagesync/mgmt/2019-10-01/storagesync/_meta.json +++ b/services/storagesync/mgmt/2019-10-01/storagesync/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a90c57a07779ab3ffd7d42ccf194a024e55b3bfb", "readme": "/_/azure-rest-api-specs/specification/storagesync/resource-manager/readme.md", "tag": "package-2019-10-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/storagesync/mgmt/2019-10-01/storagesync/cloudendpoints.go b/services/storagesync/mgmt/2019-10-01/storagesync/cloudendpoints.go index e1e107d978c7..f5e04570f5e5 100644 --- a/services/storagesync/mgmt/2019-10-01/storagesync/cloudendpoints.go +++ b/services/storagesync/mgmt/2019-10-01/storagesync/cloudendpoints.go @@ -54,8 +54,7 @@ func (client CloudEndpointsClient) Create(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Create", err.Error()) } @@ -149,8 +148,7 @@ func (client CloudEndpointsClient) Delete(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Delete", err.Error()) } @@ -241,8 +239,7 @@ func (client CloudEndpointsClient) Get(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Get", err.Error()) } @@ -330,8 +327,7 @@ func (client CloudEndpointsClient) ListBySyncGroup(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -420,8 +416,7 @@ func (client CloudEndpointsClient) PostBackup(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostBackup", err.Error()) } @@ -516,8 +511,7 @@ func (client CloudEndpointsClient) PostRestore(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostRestore", err.Error()) } @@ -611,8 +605,7 @@ func (client CloudEndpointsClient) PreBackup(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreBackup", err.Error()) } @@ -706,8 +699,7 @@ func (client CloudEndpointsClient) PreRestore(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreRestore", err.Error()) } @@ -800,8 +792,7 @@ func (client CloudEndpointsClient) Restoreheartbeat(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Restoreheartbeat", err.Error()) } @@ -891,8 +882,7 @@ func (client CloudEndpointsClient) TriggerChangeDetection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "TriggerChangeDetection", err.Error()) } diff --git a/services/storagesync/mgmt/2019-10-01/storagesync/operationstatus.go b/services/storagesync/mgmt/2019-10-01/storagesync/operationstatus.go index 03f534c41797..dfc17ae30220 100644 --- a/services/storagesync/mgmt/2019-10-01/storagesync/operationstatus.go +++ b/services/storagesync/mgmt/2019-10-01/storagesync/operationstatus.go @@ -53,8 +53,7 @@ func (client OperationStatusClient) Get(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.OperationStatusClient", "Get", err.Error()) } diff --git a/services/storagesync/mgmt/2019-10-01/storagesync/registeredservers.go b/services/storagesync/mgmt/2019-10-01/storagesync/registeredservers.go index cb99fb5b9ff9..ccb26883abf1 100644 --- a/services/storagesync/mgmt/2019-10-01/storagesync/registeredservers.go +++ b/services/storagesync/mgmt/2019-10-01/storagesync/registeredservers.go @@ -54,8 +54,7 @@ func (client RegisteredServersClient) Create(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Create", err.Error()) } @@ -147,8 +146,7 @@ func (client RegisteredServersClient) Delete(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Delete", err.Error()) } @@ -237,8 +235,7 @@ func (client RegisteredServersClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Get", err.Error()) } @@ -324,8 +321,7 @@ func (client RegisteredServersClient) ListByStorageSyncService(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "ListByStorageSyncService", err.Error()) } @@ -412,8 +408,7 @@ func (client RegisteredServersClient) TriggerRollover(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "TriggerRollover", err.Error()) } diff --git a/services/storagesync/mgmt/2019-10-01/storagesync/serverendpoints.go b/services/storagesync/mgmt/2019-10-01/storagesync/serverendpoints.go index 591cfd374cc3..d3679d0059d6 100644 --- a/services/storagesync/mgmt/2019-10-01/storagesync/serverendpoints.go +++ b/services/storagesync/mgmt/2019-10-01/storagesync/serverendpoints.go @@ -54,8 +54,7 @@ func (client ServerEndpointsClient) Create(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties.VolumeFreeSpacePercent", Name: validation.Null, Rule: false, @@ -160,8 +159,7 @@ func (client ServerEndpointsClient) Delete(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Delete", err.Error()) } @@ -252,8 +250,7 @@ func (client ServerEndpointsClient) Get(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Get", err.Error()) } @@ -341,8 +338,7 @@ func (client ServerEndpointsClient) ListBySyncGroup(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -431,8 +427,7 @@ func (client ServerEndpointsClient) RecallAction(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "RecallAction", err.Error()) } @@ -526,8 +521,7 @@ func (client ServerEndpointsClient) Update(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2019-10-01/storagesync/services.go b/services/storagesync/mgmt/2019-10-01/storagesync/services.go index be020190412c..9d7138936cb9 100644 --- a/services/storagesync/mgmt/2019-10-01/storagesync/services.go +++ b/services/storagesync/mgmt/2019-10-01/storagesync/services.go @@ -138,8 +138,7 @@ func (client ServicesClient) Create(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Create", err.Error()) @@ -228,8 +227,7 @@ func (client ServicesClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Delete", err.Error()) } @@ -313,8 +311,7 @@ func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Get", err.Error()) } @@ -398,8 +395,7 @@ func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "ListByResourceGroup", err.Error()) } @@ -561,8 +557,7 @@ func (client ServicesClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2019-10-01/storagesync/syncgroups.go b/services/storagesync/mgmt/2019-10-01/storagesync/syncgroups.go index db73af5b79c0..4a6064dd3cf5 100644 --- a/services/storagesync/mgmt/2019-10-01/storagesync/syncgroups.go +++ b/services/storagesync/mgmt/2019-10-01/storagesync/syncgroups.go @@ -53,8 +53,7 @@ func (client SyncGroupsClient) Create(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Create", err.Error()) } @@ -143,8 +142,7 @@ func (client SyncGroupsClient) Delete(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Delete", err.Error()) } @@ -230,8 +228,7 @@ func (client SyncGroupsClient) Get(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Get", err.Error()) } @@ -317,8 +314,7 @@ func (client SyncGroupsClient) ListByStorageSyncService(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2019-10-01/storagesync/workflows.go b/services/storagesync/mgmt/2019-10-01/storagesync/workflows.go index 5b6fef7e92a1..9818283c5a09 100644 --- a/services/storagesync/mgmt/2019-10-01/storagesync/workflows.go +++ b/services/storagesync/mgmt/2019-10-01/storagesync/workflows.go @@ -52,8 +52,7 @@ func (client WorkflowsClient) Abort(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Abort", err.Error()) } @@ -139,8 +138,7 @@ func (client WorkflowsClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Get", err.Error()) } @@ -226,8 +224,7 @@ func (client WorkflowsClient) ListByStorageSyncService(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/CHANGELOG.md b/services/storagesync/mgmt/2020-03-01/storagesync/CHANGELOG.md index 52911e4cc5e4..4406af34a1ae 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/CHANGELOG.md +++ b/services/storagesync/mgmt/2020-03-01/storagesync/CHANGELOG.md @@ -1,2 +1,51 @@ -# Change History +# Unreleased +## Additive Changes + +### New Constants + +1. RegisteredServerAgentVersionStatus.Blocked +1. RegisteredServerAgentVersionStatus.Expired +1. RegisteredServerAgentVersionStatus.NearExpiry +1. RegisteredServerAgentVersionStatus.Ok +1. ServerEndpointSyncMode.InitialFullDownload +1. ServerEndpointSyncMode.InitialUpload +1. ServerEndpointSyncMode.NamespaceDownload +1. ServerEndpointSyncMode.Regular +1. ServerEndpointSyncMode.SnapshotUpload + +### New Funcs + +1. BaseClient.LocationOperationStatusMethod(context.Context, string, string) (LocationOperationStatus, error) +1. BaseClient.LocationOperationStatusMethodPreparer(context.Context, string, string) (*http.Request, error) +1. BaseClient.LocationOperationStatusMethodResponder(*http.Response) (LocationOperationStatus, error) +1. BaseClient.LocationOperationStatusMethodSender(*http.Request) (*http.Response, error) +1. LocationOperationStatus.MarshalJSON() ([]byte, error) +1. PossibleRegisteredServerAgentVersionStatusValues() []RegisteredServerAgentVersionStatus +1. PossibleServerEndpointSyncModeValues() []ServerEndpointSyncMode +1. RegisteredServerProperties.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### New Structs + +1. InnerErrorDetails +1. LocationOperationStatus +1. OperationProperties +1. OperationResourceMetricSpecification +1. OperationResourceMetricSpecificationDimension +1. OperationResourceServiceSpecification + +#### New Struct Fields + +1. APIError.InnerError +1. ErrorDetails.ExceptionType +1. ErrorDetails.HTTPErrorCode +1. ErrorDetails.HTTPMethod +1. ErrorDetails.HashedMessage +1. ErrorDetails.RequestURI +1. OperationEntity.Properties +1. RegisteredServerProperties.AgentVersionExpirationDate +1. RegisteredServerProperties.AgentVersionStatus +1. ServerEndpointSyncActivityStatus.SyncMode +1. ServerEndpointSyncSessionStatus.LastSyncMode diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/_meta.json b/services/storagesync/mgmt/2020-03-01/storagesync/_meta.json index 04b3aae2de6f..fe2b093282b1 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/_meta.json +++ b/services/storagesync/mgmt/2020-03-01/storagesync/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a90c57a07779ab3ffd7d42ccf194a024e55b3bfb", "readme": "/_/azure-rest-api-specs/specification/storagesync/resource-manager/readme.md", "tag": "package-2020-03-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/client.go b/services/storagesync/mgmt/2020-03-01/storagesync/client.go index c2f221f17070..2ac2880cab70 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/client.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/client.go @@ -10,7 +10,12 @@ package storagesync // 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" ) const ( @@ -39,3 +44,85 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { SubscriptionID: subscriptionID, } } + +// LocationOperationStatusMethod get Operation status +// Parameters: +// locationName - the desired region to obtain information from. +// operationID - operation Id +func (client BaseClient) LocationOperationStatusMethod(ctx context.Context, locationName string, operationID string) (result LocationOperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.LocationOperationStatusMethod") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.BaseClient", "LocationOperationStatusMethod", err.Error()) + } + + req, err := client.LocationOperationStatusMethodPreparer(ctx, locationName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.BaseClient", "LocationOperationStatusMethod", nil, "Failure preparing request") + return + } + + resp, err := client.LocationOperationStatusMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.BaseClient", "LocationOperationStatusMethod", resp, "Failure sending request") + return + } + + result, err = client.LocationOperationStatusMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.BaseClient", "LocationOperationStatusMethod", resp, "Failure responding to request") + return + } + + return +} + +// LocationOperationStatusMethodPreparer prepares the LocationOperationStatusMethod request. +func (client BaseClient) LocationOperationStatusMethodPreparer(ctx context.Context, locationName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "locationName": autorest.Encode("path", locationName), + "operationId": autorest.Encode("path", operationID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/operations/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// LocationOperationStatusMethodSender sends the LocationOperationStatusMethod request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) LocationOperationStatusMethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// LocationOperationStatusMethodResponder handles the response to the LocationOperationStatusMethod request. The method always +// closes the http.Response Body. +func (client BaseClient) LocationOperationStatusMethodResponder(resp *http.Response) (result LocationOperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/cloudendpoints.go b/services/storagesync/mgmt/2020-03-01/storagesync/cloudendpoints.go index e8ff1df42e54..117fcd75c7dc 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/cloudendpoints.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/cloudendpoints.go @@ -54,8 +54,7 @@ func (client CloudEndpointsClient) Create(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Create", err.Error()) } @@ -149,8 +148,7 @@ func (client CloudEndpointsClient) Delete(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Delete", err.Error()) } @@ -241,8 +239,7 @@ func (client CloudEndpointsClient) Get(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Get", err.Error()) } @@ -330,8 +327,7 @@ func (client CloudEndpointsClient) ListBySyncGroup(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -420,8 +416,7 @@ func (client CloudEndpointsClient) PostBackup(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostBackup", err.Error()) } @@ -516,8 +511,7 @@ func (client CloudEndpointsClient) PostRestore(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PostRestore", err.Error()) } @@ -611,8 +605,7 @@ func (client CloudEndpointsClient) PreBackup(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreBackup", err.Error()) } @@ -706,8 +699,7 @@ func (client CloudEndpointsClient) PreRestore(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "PreRestore", err.Error()) } @@ -800,8 +792,7 @@ func (client CloudEndpointsClient) Restoreheartbeat(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "Restoreheartbeat", err.Error()) } @@ -891,8 +882,7 @@ func (client CloudEndpointsClient) TriggerChangeDetection(ctx context.Context, r Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.CloudEndpointsClient", "TriggerChangeDetection", err.Error()) } diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/enums.go b/services/storagesync/mgmt/2020-03-01/storagesync/enums.go index 4c45cc9dfbe6..5bca25db803c 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/enums.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/enums.go @@ -194,6 +194,25 @@ func PossibleReasonValues() []Reason { return []Reason{Deleted, Registered, Suspended, Unregistered, Warned} } +// RegisteredServerAgentVersionStatus enumerates the values for registered server agent version status. +type RegisteredServerAgentVersionStatus string + +const ( + // Blocked ... + Blocked RegisteredServerAgentVersionStatus = "Blocked" + // Expired ... + Expired RegisteredServerAgentVersionStatus = "Expired" + // NearExpiry ... + NearExpiry RegisteredServerAgentVersionStatus = "NearExpiry" + // Ok ... + Ok RegisteredServerAgentVersionStatus = "Ok" +) + +// PossibleRegisteredServerAgentVersionStatusValues returns an array of possible values for the RegisteredServerAgentVersionStatus const type. +func PossibleRegisteredServerAgentVersionStatusValues() []RegisteredServerAgentVersionStatus { + return []RegisteredServerAgentVersionStatus{Blocked, Expired, NearExpiry, Ok} +} + // ServerEndpointCloudTieringHealthState enumerates the values for server endpoint cloud tiering health state. type ServerEndpointCloudTieringHealthState string @@ -267,6 +286,27 @@ func PossibleServerEndpointSyncHealthStateValues() []ServerEndpointSyncHealthSta return []ServerEndpointSyncHealthState{ServerEndpointSyncHealthStateError, ServerEndpointSyncHealthStateHealthy, ServerEndpointSyncHealthStateNoActivity, ServerEndpointSyncHealthStateSyncBlockedForChangeDetectionPostRestore, ServerEndpointSyncHealthStateSyncBlockedForRestore} } +// ServerEndpointSyncMode enumerates the values for server endpoint sync mode. +type ServerEndpointSyncMode string + +const ( + // InitialFullDownload ... + InitialFullDownload ServerEndpointSyncMode = "InitialFullDownload" + // InitialUpload ... + InitialUpload ServerEndpointSyncMode = "InitialUpload" + // NamespaceDownload ... + NamespaceDownload ServerEndpointSyncMode = "NamespaceDownload" + // Regular ... + Regular ServerEndpointSyncMode = "Regular" + // SnapshotUpload ... + SnapshotUpload ServerEndpointSyncMode = "SnapshotUpload" +) + +// PossibleServerEndpointSyncModeValues returns an array of possible values for the ServerEndpointSyncMode const type. +func PossibleServerEndpointSyncModeValues() []ServerEndpointSyncMode { + return []ServerEndpointSyncMode{InitialFullDownload, InitialUpload, NamespaceDownload, Regular, SnapshotUpload} +} + // WorkflowStatus enumerates the values for workflow status. type WorkflowStatus string diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/models.go b/services/storagesync/mgmt/2020-03-01/storagesync/models.go index ff5aff5e17d8..a1bec48887e9 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/models.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/models.go @@ -30,6 +30,8 @@ type APIError struct { Target *string `json:"target,omitempty"` // Details - Error details of the given entry. Details *ErrorDetails `json:"details,omitempty"` + // InnerError - Inner error details of the given entry. + InnerError *InnerErrorDetails `json:"innerError,omitempty"` } // AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. @@ -670,6 +672,16 @@ type ErrorDetails struct { Message *string `json:"message,omitempty"` // Target - Target of the given entry. Target *string `json:"target,omitempty"` + // RequestURI - Request URI of the given entry. + RequestURI *string `json:"requestUri,omitempty"` + // ExceptionType - Exception type of the given entry. + ExceptionType *string `json:"exceptionType,omitempty"` + // HTTPMethod - HTTP method of the given entry. + HTTPMethod *string `json:"httpMethod,omitempty"` + // HashedMessage - Hashed message of the given entry. + HashedMessage *string `json:"hashedMessage,omitempty"` + // HTTPErrorCode - HTTP error code of the given entry. + HTTPErrorCode *string `json:"httpErrorCode,omitempty"` } // FilesNotTieringError files not tiering error object @@ -686,6 +698,43 @@ func (fnte FilesNotTieringError) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// InnerErrorDetails error Details object. +type InnerErrorDetails struct { + // CallStack - Call stack of the error. + CallStack *string `json:"callStack,omitempty"` + // Message - Error message of the error. + Message *string `json:"message,omitempty"` + // InnerException - Exception of the inner error. + InnerException *string `json:"innerException,omitempty"` + // InnerExceptionCallStack - Call stack of the inner error. + InnerExceptionCallStack *string `json:"innerExceptionCallStack,omitempty"` +} + +// LocationOperationStatus operation status object +type LocationOperationStatus struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Operation resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Operation Id + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; Operation status + Status *string `json:"status,omitempty"` + // StartTime - READ-ONLY; Start time of the operation + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; End time of the operation + EndTime *date.Time `json:"endTime,omitempty"` + // Error - READ-ONLY; Error details. + Error *APIError `json:"error,omitempty"` + // PercentComplete - READ-ONLY; Percent complete. + PercentComplete *int32 `json:"percentComplete,omitempty"` +} + +// MarshalJSON is the custom marshaler for LocationOperationStatus. +func (los LocationOperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // OperationDisplayInfo the operation supported by storage sync. type OperationDisplayInfo struct { // Description - The description of the operation. @@ -718,6 +767,8 @@ type OperationEntity struct { Display *OperationDisplayInfo `json:"display,omitempty"` // Origin - The origin. Origin *string `json:"origin,omitempty"` + // Properties - Properties of the operations resource. + Properties *OperationProperties `json:"properties,omitempty"` } // OperationEntityListResult the list of storage sync operations. @@ -879,6 +930,46 @@ func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage } } +// OperationProperties properties of the operations resource. +type OperationProperties struct { + // ServiceSpecification - Service specification for the operations resource. + ServiceSpecification *OperationResourceServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// OperationResourceMetricSpecification operation Display Resource object. +type OperationResourceMetricSpecification struct { + // Name - Name of the metric. + Name *string `json:"name,omitempty"` + // DisplayName - Display name for the metric. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Display description for the metric. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Unit for the metric. + Unit *string `json:"unit,omitempty"` + // AggregationType - Aggregation type for the metric. + AggregationType *string `json:"aggregationType,omitempty"` + // FillGapWithZero - Fill gaps in the metric with zero. + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + // Dimensions - Dimensions for the metric specification. + Dimensions *[]OperationResourceMetricSpecificationDimension `json:"dimensions,omitempty"` +} + +// OperationResourceMetricSpecificationDimension operationResourceMetricSpecificationDimension object. +type OperationResourceMetricSpecificationDimension struct { + // Name - Name of the dimension. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of the dimensions. + DisplayName *string `json:"displayName,omitempty"` + // ToBeExportedForShoebox - Indicates metric should be exported for Shoebox. + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + +// OperationResourceServiceSpecification service specification. +type OperationResourceServiceSpecification struct { + // MetricSpecifications - List of metric specifications. + MetricSpecifications *[]OperationResourceMetricSpecification `json:"metricSpecifications,omitempty"` +} + // OperationStatus operation status object type OperationStatus struct { autorest.Response `json:"-"` @@ -1491,6 +1582,10 @@ type RegisteredServerProperties struct { ServerCertificate *string `json:"serverCertificate,omitempty"` // AgentVersion - Registered Server Agent Version AgentVersion *string `json:"agentVersion,omitempty"` + // AgentVersionStatus - READ-ONLY; Registered Server Agent Version Status. Possible values include: 'Ok', 'NearExpiry', 'Expired', 'Blocked' + AgentVersionStatus RegisteredServerAgentVersionStatus `json:"agentVersionStatus,omitempty"` + // AgentVersionExpirationDate - READ-ONLY; Registered Server Agent Version Expiration Date + AgentVersionExpirationDate *date.Time `json:"agentVersionExpirationDate,omitempty"` // ServerOSVersion - Registered Server OS Version ServerOSVersion *string `json:"serverOSVersion,omitempty"` // ServerManagementErrorCode - Registered Server Management Error Code @@ -1529,6 +1624,72 @@ type RegisteredServerProperties struct { MonitoringConfiguration *string `json:"monitoringConfiguration,omitempty"` } +// MarshalJSON is the custom marshaler for RegisteredServerProperties. +func (rsp RegisteredServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.ServerCertificate != nil { + objectMap["serverCertificate"] = rsp.ServerCertificate + } + if rsp.AgentVersion != nil { + objectMap["agentVersion"] = rsp.AgentVersion + } + if rsp.ServerOSVersion != nil { + objectMap["serverOSVersion"] = rsp.ServerOSVersion + } + if rsp.ServerManagementErrorCode != nil { + objectMap["serverManagementErrorCode"] = rsp.ServerManagementErrorCode + } + if rsp.LastHeartBeat != nil { + objectMap["lastHeartBeat"] = rsp.LastHeartBeat + } + if rsp.ProvisioningState != nil { + objectMap["provisioningState"] = rsp.ProvisioningState + } + if rsp.ServerRole != nil { + objectMap["serverRole"] = rsp.ServerRole + } + if rsp.ClusterID != nil { + objectMap["clusterId"] = rsp.ClusterID + } + if rsp.ClusterName != nil { + objectMap["clusterName"] = rsp.ClusterName + } + if rsp.ServerID != nil { + objectMap["serverId"] = rsp.ServerID + } + if rsp.StorageSyncServiceUID != nil { + objectMap["storageSyncServiceUid"] = rsp.StorageSyncServiceUID + } + if rsp.LastWorkflowID != nil { + objectMap["lastWorkflowId"] = rsp.LastWorkflowID + } + if rsp.LastOperationName != nil { + objectMap["lastOperationName"] = rsp.LastOperationName + } + if rsp.DiscoveryEndpointURI != nil { + objectMap["discoveryEndpointUri"] = rsp.DiscoveryEndpointURI + } + if rsp.ResourceLocation != nil { + objectMap["resourceLocation"] = rsp.ResourceLocation + } + if rsp.ServiceLocation != nil { + objectMap["serviceLocation"] = rsp.ServiceLocation + } + if rsp.FriendlyName != nil { + objectMap["friendlyName"] = rsp.FriendlyName + } + if rsp.ManagementEndpointURI != nil { + objectMap["managementEndpointUri"] = rsp.ManagementEndpointURI + } + if rsp.MonitoringEndpointURI != nil { + objectMap["monitoringEndpointUri"] = rsp.MonitoringEndpointURI + } + if rsp.MonitoringConfiguration != nil { + objectMap["monitoringConfiguration"] = rsp.MonitoringConfiguration + } + return json.Marshal(objectMap) +} + // RegisteredServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RegisteredServersCreateFuture struct { @@ -2180,6 +2341,8 @@ type ServerEndpointSyncActivityStatus struct { AppliedBytes *int64 `json:"appliedBytes,omitempty"` // TotalBytes - READ-ONLY; Total bytes (if available) TotalBytes *int64 `json:"totalBytes,omitempty"` + // SyncMode - READ-ONLY; Sync mode. Possible values include: 'Regular', 'NamespaceDownload', 'InitialUpload', 'SnapshotUpload', 'InitialFullDownload' + SyncMode ServerEndpointSyncMode `json:"syncMode,omitempty"` } // MarshalJSON is the custom marshaler for ServerEndpointSyncActivityStatus. @@ -2204,6 +2367,8 @@ type ServerEndpointSyncSessionStatus struct { TransientFilesNotSyncingCount *int64 `json:"transientFilesNotSyncingCount,omitempty"` // FilesNotSyncingErrors - READ-ONLY; Array of per-item errors coming from the last sync session. FilesNotSyncingErrors *[]ServerEndpointFilesNotSyncingError `json:"filesNotSyncingErrors,omitempty"` + // LastSyncMode - READ-ONLY; Sync mode. Possible values include: 'Regular', 'NamespaceDownload', 'InitialUpload', 'SnapshotUpload', 'InitialFullDownload' + LastSyncMode ServerEndpointSyncMode `json:"lastSyncMode,omitempty"` } // MarshalJSON is the custom marshaler for ServerEndpointSyncSessionStatus. diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/operationstatus.go b/services/storagesync/mgmt/2020-03-01/storagesync/operationstatus.go index 0fc6d79f6e4e..db33b972448e 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/operationstatus.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/operationstatus.go @@ -53,8 +53,7 @@ func (client OperationStatusClient) Get(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.OperationStatusClient", "Get", err.Error()) } diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/privateendpointconnections.go b/services/storagesync/mgmt/2020-03-01/storagesync/privateendpointconnections.go index eadce02ee80f..8ec52cc3ea6a 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/privateendpointconnections.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/privateendpointconnections.go @@ -53,8 +53,7 @@ func (client PrivateEndpointConnectionsClient) Create(ctx context.Context, resou 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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: properties, @@ -150,8 +149,7 @@ func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resou 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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.PrivateEndpointConnectionsClient", "Delete", err.Error()) @@ -241,8 +239,7 @@ func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resource 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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.PrivateEndpointConnectionsClient", "Get", err.Error()) @@ -330,8 +327,7 @@ func (client PrivateEndpointConnectionsClient) ListByStorageSyncService(ctx cont Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.PrivateEndpointConnectionsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/privatelinkresources.go b/services/storagesync/mgmt/2020-03-01/storagesync/privatelinkresources.go index 753e7751c05c..082296d18ab4 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/privatelinkresources.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/privatelinkresources.go @@ -50,8 +50,7 @@ func (client PrivateLinkResourcesClient) ListByStorageSyncService(ctx context.Co 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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.PrivateLinkResourcesClient", "ListByStorageSyncService", err.Error()) diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/registeredservers.go b/services/storagesync/mgmt/2020-03-01/storagesync/registeredservers.go index 9c29ebfc3690..7b4c6fe6dfa9 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/registeredservers.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/registeredservers.go @@ -54,8 +54,7 @@ func (client RegisteredServersClient) Create(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Create", err.Error()) } @@ -147,8 +146,7 @@ func (client RegisteredServersClient) Delete(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Delete", err.Error()) } @@ -237,8 +235,7 @@ func (client RegisteredServersClient) Get(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "Get", err.Error()) } @@ -324,8 +321,7 @@ func (client RegisteredServersClient) ListByStorageSyncService(ctx context.Conte Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "ListByStorageSyncService", err.Error()) } @@ -412,8 +408,7 @@ func (client RegisteredServersClient) TriggerRollover(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.RegisteredServersClient", "TriggerRollover", err.Error()) } diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/serverendpoints.go b/services/storagesync/mgmt/2020-03-01/storagesync/serverendpoints.go index de956dfab7da..42102bd190bf 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/serverendpoints.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/serverendpoints.go @@ -54,8 +54,7 @@ func (client ServerEndpointsClient) Create(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties.VolumeFreeSpacePercent", Name: validation.Null, Rule: false, @@ -160,8 +159,7 @@ func (client ServerEndpointsClient) Delete(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Delete", err.Error()) } @@ -252,8 +250,7 @@ func (client ServerEndpointsClient) Get(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Get", err.Error()) } @@ -341,8 +338,7 @@ func (client ServerEndpointsClient) ListBySyncGroup(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "ListBySyncGroup", err.Error()) } @@ -431,8 +427,7 @@ func (client ServerEndpointsClient) RecallAction(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "RecallAction", err.Error()) } @@ -526,8 +521,7 @@ func (client ServerEndpointsClient) Update(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServerEndpointsClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/services.go b/services/storagesync/mgmt/2020-03-01/storagesync/services.go index 1bf523cc9efa..01ff06ee5d81 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/services.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/services.go @@ -138,8 +138,7 @@ func (client ServicesClient) Create(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Create", err.Error()) @@ -231,8 +230,7 @@ func (client ServicesClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Delete", err.Error()) } @@ -319,8 +317,7 @@ func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Get", err.Error()) } @@ -404,8 +401,7 @@ func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "ListByResourceGroup", err.Error()) } @@ -567,8 +563,7 @@ func (client ServicesClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.ServicesClient", "Update", err.Error()) } diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/storagesyncapi/interfaces.go b/services/storagesync/mgmt/2020-03-01/storagesync/storagesyncapi/interfaces.go index be0a76725593..c55350dc2587 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/storagesyncapi/interfaces.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/storagesyncapi/interfaces.go @@ -12,6 +12,13 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + LocationOperationStatusMethod(ctx context.Context, locationName string, operationID string) (result storagesync.LocationOperationStatus, err error) +} + +var _ BaseClientAPI = (*storagesync.BaseClient)(nil) + // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { List(ctx context.Context) (result storagesync.OperationEntityListResultPage, err error) diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/syncgroups.go b/services/storagesync/mgmt/2020-03-01/storagesync/syncgroups.go index 62293ac6d647..24036a5785bc 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/syncgroups.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/syncgroups.go @@ -53,8 +53,7 @@ func (client SyncGroupsClient) Create(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Create", err.Error()) } @@ -143,8 +142,7 @@ func (client SyncGroupsClient) Delete(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Delete", err.Error()) } @@ -230,8 +228,7 @@ func (client SyncGroupsClient) Get(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "Get", err.Error()) } @@ -317,8 +314,7 @@ func (client SyncGroupsClient) ListByStorageSyncService(ctx context.Context, res Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.SyncGroupsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2020-03-01/storagesync/workflows.go b/services/storagesync/mgmt/2020-03-01/storagesync/workflows.go index 5d2f33f453cd..9229dc8e933e 100644 --- a/services/storagesync/mgmt/2020-03-01/storagesync/workflows.go +++ b/services/storagesync/mgmt/2020-03-01/storagesync/workflows.go @@ -52,8 +52,7 @@ func (client WorkflowsClient) Abort(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Abort", err.Error()) } @@ -139,8 +138,7 @@ func (client WorkflowsClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "Get", err.Error()) } @@ -226,8 +224,7 @@ func (client WorkflowsClient) ListByStorageSyncService(ctx context.Context, reso Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("storagesync.WorkflowsClient", "ListByStorageSyncService", err.Error()) } diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/CHANGELOG.md b/services/storagesync/mgmt/2020-09-01/storagesync/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/_meta.json b/services/storagesync/mgmt/2020-09-01/storagesync/_meta.json new file mode 100644 index 000000000000..44896475bca3 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "a90c57a07779ab3ffd7d42ccf194a024e55b3bfb", + "readme": "/_/azure-rest-api-specs/specification/storagesync/resource-manager/readme.md", + "tag": "package-2020-09-01", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-09-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/storagesync/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/client.go b/services/storagesync/mgmt/2020-09-01/storagesync/client.go new file mode 100644 index 000000000000..8f4ebb65a198 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/client.go @@ -0,0 +1,128 @@ +// Package storagesync implements the Azure ARM Storagesync service API version 2020-09-01. +// +// Microsoft Storage Sync Service API +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Storagesync + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Storagesync. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient 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 NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} + +// LocationOperationStatusMethod get Operation status +// Parameters: +// locationName - the desired region to obtain information from. +// operationID - operation Id +func (client BaseClient) LocationOperationStatusMethod(ctx context.Context, locationName string, operationID string) (result LocationOperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.LocationOperationStatusMethod") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.BaseClient", "LocationOperationStatusMethod", err.Error()) + } + + req, err := client.LocationOperationStatusMethodPreparer(ctx, locationName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.BaseClient", "LocationOperationStatusMethod", nil, "Failure preparing request") + return + } + + resp, err := client.LocationOperationStatusMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.BaseClient", "LocationOperationStatusMethod", resp, "Failure sending request") + return + } + + result, err = client.LocationOperationStatusMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.BaseClient", "LocationOperationStatusMethod", resp, "Failure responding to request") + return + } + + return +} + +// LocationOperationStatusMethodPreparer prepares the LocationOperationStatusMethod request. +func (client BaseClient) LocationOperationStatusMethodPreparer(ctx context.Context, locationName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "locationName": autorest.Encode("path", locationName), + "operationId": autorest.Encode("path", operationID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/operations/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// LocationOperationStatusMethodSender sends the LocationOperationStatusMethod request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) LocationOperationStatusMethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// LocationOperationStatusMethodResponder handles the response to the LocationOperationStatusMethod request. The method always +// closes the http.Response Body. +func (client BaseClient) LocationOperationStatusMethodResponder(resp *http.Response) (result LocationOperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/cloudendpoints.go b/services/storagesync/mgmt/2020-09-01/storagesync/cloudendpoints.go new file mode 100644 index 000000000000..271a1422847a --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/cloudendpoints.go @@ -0,0 +1,954 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CloudEndpointsClient is the microsoft Storage Sync Service API +type CloudEndpointsClient struct { + BaseClient +} + +// NewCloudEndpointsClient creates an instance of the CloudEndpointsClient client. +func NewCloudEndpointsClient(subscriptionID string) CloudEndpointsClient { + return NewCloudEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCloudEndpointsClientWithBaseURI creates an instance of the CloudEndpointsClient 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 NewCloudEndpointsClientWithBaseURI(baseURI string, subscriptionID string) CloudEndpointsClient { + return CloudEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a new CloudEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// cloudEndpointName - name of Cloud Endpoint object. +// parameters - body of Cloud Endpoint resource. +func (client CloudEndpointsClient) Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters CloudEndpointCreateParameters) (result CloudEndpointsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudEndpointsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.CloudEndpointsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client CloudEndpointsClient) CreatePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters CloudEndpointCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudEndpointName": autorest.Encode("path", cloudEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client CloudEndpointsClient) CreateSender(req *http.Request) (future CloudEndpointsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client CloudEndpointsClient) CreateResponder(resp *http.Response) (result CloudEndpoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a given CloudEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// cloudEndpointName - name of Cloud Endpoint object. +func (client CloudEndpointsClient) Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string) (result CloudEndpointsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudEndpointsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.CloudEndpointsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CloudEndpointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudEndpointName": autorest.Encode("path", cloudEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CloudEndpointsClient) DeleteSender(req *http.Request) (future CloudEndpointsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CloudEndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a given CloudEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// cloudEndpointName - name of Cloud Endpoint object. +func (client CloudEndpointsClient) Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string) (result CloudEndpoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudEndpointsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.CloudEndpointsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CloudEndpointsClient) GetPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudEndpointName": autorest.Encode("path", cloudEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", 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 CloudEndpointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CloudEndpointsClient) GetResponder(resp *http.Response) (result CloudEndpoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySyncGroup get a CloudEndpoint List. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +func (client CloudEndpointsClient) ListBySyncGroup(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (result CloudEndpointArray, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudEndpointsClient.ListBySyncGroup") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.CloudEndpointsClient", "ListBySyncGroup", err.Error()) + } + + req, err := client.ListBySyncGroupPreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "ListBySyncGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySyncGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "ListBySyncGroup", resp, "Failure sending request") + return + } + + result, err = client.ListBySyncGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "ListBySyncGroup", resp, "Failure responding to request") + return + } + + return +} + +// ListBySyncGroupPreparer prepares the ListBySyncGroup request. +func (client CloudEndpointsClient) ListBySyncGroupPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySyncGroupSender sends the ListBySyncGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CloudEndpointsClient) ListBySyncGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySyncGroupResponder handles the response to the ListBySyncGroup request. The method always +// closes the http.Response Body. +func (client CloudEndpointsClient) ListBySyncGroupResponder(resp *http.Response) (result CloudEndpointArray, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PostBackup post Backup a given CloudEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// cloudEndpointName - name of Cloud Endpoint object. +// parameters - body of Backup request. +func (client CloudEndpointsClient) PostBackup(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters BackupRequest) (result CloudEndpointsPostBackupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudEndpointsClient.PostBackup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.CloudEndpointsClient", "PostBackup", err.Error()) + } + + req, err := client.PostBackupPreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "PostBackup", nil, "Failure preparing request") + return + } + + result, err = client.PostBackupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "PostBackup", result.Response(), "Failure sending request") + return + } + + return +} + +// PostBackupPreparer prepares the PostBackup request. +func (client CloudEndpointsClient) PostBackupPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters BackupRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudEndpointName": autorest.Encode("path", cloudEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PostBackupSender sends the PostBackup request. The method will close the +// http.Response Body if it receives an error. +func (client CloudEndpointsClient) PostBackupSender(req *http.Request) (future CloudEndpointsPostBackupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PostBackupResponder handles the response to the PostBackup request. The method always +// closes the http.Response Body. +func (client CloudEndpointsClient) PostBackupResponder(resp *http.Response) (result PostBackupResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PostRestore post Restore a given CloudEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// cloudEndpointName - name of Cloud Endpoint object. +// parameters - body of Cloud Endpoint object. +func (client CloudEndpointsClient) PostRestore(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters PostRestoreRequest) (result CloudEndpointsPostRestoreFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudEndpointsClient.PostRestore") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.CloudEndpointsClient", "PostRestore", err.Error()) + } + + req, err := client.PostRestorePreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "PostRestore", nil, "Failure preparing request") + return + } + + result, err = client.PostRestoreSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "PostRestore", result.Response(), "Failure sending request") + return + } + + return +} + +// PostRestorePreparer prepares the PostRestore request. +func (client CloudEndpointsClient) PostRestorePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters PostRestoreRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudEndpointName": autorest.Encode("path", cloudEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PostRestoreSender sends the PostRestore request. The method will close the +// http.Response Body if it receives an error. +func (client CloudEndpointsClient) PostRestoreSender(req *http.Request) (future CloudEndpointsPostRestoreFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PostRestoreResponder handles the response to the PostRestore request. The method always +// closes the http.Response Body. +func (client CloudEndpointsClient) PostRestoreResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// PreBackup pre Backup a given CloudEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// cloudEndpointName - name of Cloud Endpoint object. +// parameters - body of Backup request. +func (client CloudEndpointsClient) PreBackup(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters BackupRequest) (result CloudEndpointsPreBackupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudEndpointsClient.PreBackup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.CloudEndpointsClient", "PreBackup", err.Error()) + } + + req, err := client.PreBackupPreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "PreBackup", nil, "Failure preparing request") + return + } + + result, err = client.PreBackupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "PreBackup", result.Response(), "Failure sending request") + return + } + + return +} + +// PreBackupPreparer prepares the PreBackup request. +func (client CloudEndpointsClient) PreBackupPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters BackupRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudEndpointName": autorest.Encode("path", cloudEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PreBackupSender sends the PreBackup request. The method will close the +// http.Response Body if it receives an error. +func (client CloudEndpointsClient) PreBackupSender(req *http.Request) (future CloudEndpointsPreBackupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PreBackupResponder handles the response to the PreBackup request. The method always +// closes the http.Response Body. +func (client CloudEndpointsClient) PreBackupResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// PreRestore pre Restore a given CloudEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// cloudEndpointName - name of Cloud Endpoint object. +// parameters - body of Cloud Endpoint object. +func (client CloudEndpointsClient) PreRestore(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters PreRestoreRequest) (result CloudEndpointsPreRestoreFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudEndpointsClient.PreRestore") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.CloudEndpointsClient", "PreRestore", err.Error()) + } + + req, err := client.PreRestorePreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "PreRestore", nil, "Failure preparing request") + return + } + + result, err = client.PreRestoreSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "PreRestore", result.Response(), "Failure sending request") + return + } + + return +} + +// PreRestorePreparer prepares the PreRestore request. +func (client CloudEndpointsClient) PreRestorePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters PreRestoreRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudEndpointName": autorest.Encode("path", cloudEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PreRestoreSender sends the PreRestore request. The method will close the +// http.Response Body if it receives an error. +func (client CloudEndpointsClient) PreRestoreSender(req *http.Request) (future CloudEndpointsPreRestoreFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PreRestoreResponder handles the response to the PreRestore request. The method always +// closes the http.Response Body. +func (client CloudEndpointsClient) PreRestoreResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Restoreheartbeat restore Heartbeat a given CloudEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// cloudEndpointName - name of Cloud Endpoint object. +func (client CloudEndpointsClient) Restoreheartbeat(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudEndpointsClient.Restoreheartbeat") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.CloudEndpointsClient", "Restoreheartbeat", err.Error()) + } + + req, err := client.RestoreheartbeatPreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "Restoreheartbeat", nil, "Failure preparing request") + return + } + + resp, err := client.RestoreheartbeatSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "Restoreheartbeat", resp, "Failure sending request") + return + } + + result, err = client.RestoreheartbeatResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "Restoreheartbeat", resp, "Failure responding to request") + return + } + + return +} + +// RestoreheartbeatPreparer prepares the Restoreheartbeat request. +func (client CloudEndpointsClient) RestoreheartbeatPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudEndpointName": autorest.Encode("path", cloudEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreheartbeatSender sends the Restoreheartbeat request. The method will close the +// http.Response Body if it receives an error. +func (client CloudEndpointsClient) RestoreheartbeatSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RestoreheartbeatResponder handles the response to the Restoreheartbeat request. The method always +// closes the http.Response Body. +func (client CloudEndpointsClient) RestoreheartbeatResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// TriggerChangeDetection triggers detection of changes performed on Azure File share connected to the specified Azure +// File Sync Cloud Endpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// cloudEndpointName - name of Cloud Endpoint object. +// parameters - trigger Change Detection Action parameters. +func (client CloudEndpointsClient) TriggerChangeDetection(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters TriggerChangeDetectionParameters) (result CloudEndpointsTriggerChangeDetectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudEndpointsClient.TriggerChangeDetection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.CloudEndpointsClient", "TriggerChangeDetection", err.Error()) + } + + req, err := client.TriggerChangeDetectionPreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "TriggerChangeDetection", nil, "Failure preparing request") + return + } + + result, err = client.TriggerChangeDetectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsClient", "TriggerChangeDetection", result.Response(), "Failure sending request") + return + } + + return +} + +// TriggerChangeDetectionPreparer prepares the TriggerChangeDetection request. +func (client CloudEndpointsClient) TriggerChangeDetectionPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters TriggerChangeDetectionParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudEndpointName": autorest.Encode("path", cloudEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TriggerChangeDetectionSender sends the TriggerChangeDetection request. The method will close the +// http.Response Body if it receives an error. +func (client CloudEndpointsClient) TriggerChangeDetectionSender(req *http.Request) (future CloudEndpointsTriggerChangeDetectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TriggerChangeDetectionResponder handles the response to the TriggerChangeDetection request. The method always +// closes the http.Response Body. +func (client CloudEndpointsClient) TriggerChangeDetectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/enums.go b/services/storagesync/mgmt/2020-09-01/storagesync/enums.go new file mode 100644 index 000000000000..b5f1b4f3b11e --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/enums.go @@ -0,0 +1,357 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ChangeDetectionMode enumerates the values for change detection mode. +type ChangeDetectionMode string + +const ( + // Default ... + Default ChangeDetectionMode = "Default" + // Recursive ... + Recursive ChangeDetectionMode = "Recursive" +) + +// PossibleChangeDetectionModeValues returns an array of possible values for the ChangeDetectionMode const type. +func PossibleChangeDetectionModeValues() []ChangeDetectionMode { + return []ChangeDetectionMode{Default, Recursive} +} + +// CloudEndpointChangeEnumerationActivityState enumerates the values for cloud endpoint change enumeration +// activity state. +type CloudEndpointChangeEnumerationActivityState string + +const ( + // EnumerationInProgress ... + EnumerationInProgress CloudEndpointChangeEnumerationActivityState = "EnumerationInProgress" + // InitialEnumerationInProgress ... + InitialEnumerationInProgress CloudEndpointChangeEnumerationActivityState = "InitialEnumerationInProgress" +) + +// PossibleCloudEndpointChangeEnumerationActivityStateValues returns an array of possible values for the CloudEndpointChangeEnumerationActivityState const type. +func PossibleCloudEndpointChangeEnumerationActivityStateValues() []CloudEndpointChangeEnumerationActivityState { + return []CloudEndpointChangeEnumerationActivityState{EnumerationInProgress, InitialEnumerationInProgress} +} + +// CloudEndpointChangeEnumerationTotalCountsState enumerates the values for cloud endpoint change enumeration +// total counts state. +type CloudEndpointChangeEnumerationTotalCountsState string + +const ( + // Calculating ... + Calculating CloudEndpointChangeEnumerationTotalCountsState = "Calculating" + // Final ... + Final CloudEndpointChangeEnumerationTotalCountsState = "Final" +) + +// PossibleCloudEndpointChangeEnumerationTotalCountsStateValues returns an array of possible values for the CloudEndpointChangeEnumerationTotalCountsState const type. +func PossibleCloudEndpointChangeEnumerationTotalCountsStateValues() []CloudEndpointChangeEnumerationTotalCountsState { + return []CloudEndpointChangeEnumerationTotalCountsState{Calculating, Final} +} + +// FeatureStatus enumerates the values for feature status. +type FeatureStatus string + +const ( + // Off ... + Off FeatureStatus = "off" + // On ... + On FeatureStatus = "on" +) + +// PossibleFeatureStatusValues returns an array of possible values for the FeatureStatus const type. +func PossibleFeatureStatusValues() []FeatureStatus { + return []FeatureStatus{Off, On} +} + +// IncomingTrafficPolicy enumerates the values for incoming traffic policy. +type IncomingTrafficPolicy string + +const ( + // AllowAllTraffic ... + AllowAllTraffic IncomingTrafficPolicy = "AllowAllTraffic" + // AllowVirtualNetworksOnly ... + AllowVirtualNetworksOnly IncomingTrafficPolicy = "AllowVirtualNetworksOnly" +) + +// PossibleIncomingTrafficPolicyValues returns an array of possible values for the IncomingTrafficPolicy const type. +func PossibleIncomingTrafficPolicyValues() []IncomingTrafficPolicy { + return []IncomingTrafficPolicy{AllowAllTraffic, AllowVirtualNetworksOnly} +} + +// InitialDownloadPolicy enumerates the values for initial download policy. +type InitialDownloadPolicy string + +const ( + // AvoidTieredFiles ... + AvoidTieredFiles InitialDownloadPolicy = "AvoidTieredFiles" + // NamespaceOnly ... + NamespaceOnly InitialDownloadPolicy = "NamespaceOnly" + // NamespaceThenModifiedFiles ... + NamespaceThenModifiedFiles InitialDownloadPolicy = "NamespaceThenModifiedFiles" +) + +// PossibleInitialDownloadPolicyValues returns an array of possible values for the InitialDownloadPolicy const type. +func PossibleInitialDownloadPolicyValues() []InitialDownloadPolicy { + return []InitialDownloadPolicy{AvoidTieredFiles, NamespaceOnly, NamespaceThenModifiedFiles} +} + +// InitialUploadPolicy enumerates the values for initial upload policy. +type InitialUploadPolicy string + +const ( + // Merge ... + Merge InitialUploadPolicy = "Merge" + // ServerAuthoritative ... + ServerAuthoritative InitialUploadPolicy = "ServerAuthoritative" +) + +// PossibleInitialUploadPolicyValues returns an array of possible values for the InitialUploadPolicy const type. +func PossibleInitialUploadPolicyValues() []InitialUploadPolicy { + return []InitialUploadPolicy{Merge, ServerAuthoritative} +} + +// LocalCacheMode enumerates the values for local cache mode. +type LocalCacheMode string + +const ( + // DownloadNewAndModifiedFiles ... + DownloadNewAndModifiedFiles LocalCacheMode = "DownloadNewAndModifiedFiles" + // UpdateLocallyCachedFiles ... + UpdateLocallyCachedFiles LocalCacheMode = "UpdateLocallyCachedFiles" +) + +// PossibleLocalCacheModeValues returns an array of possible values for the LocalCacheMode const type. +func PossibleLocalCacheModeValues() []LocalCacheMode { + return []LocalCacheMode{DownloadNewAndModifiedFiles, UpdateLocallyCachedFiles} +} + +// NameAvailabilityReason enumerates the values for name availability reason. +type NameAvailabilityReason string + +const ( + // AlreadyExists ... + AlreadyExists NameAvailabilityReason = "AlreadyExists" + // Invalid ... + Invalid NameAvailabilityReason = "Invalid" +) + +// PossibleNameAvailabilityReasonValues returns an array of possible values for the NameAvailabilityReason const type. +func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { + return []NameAvailabilityReason{AlreadyExists, Invalid} +} + +// OperationDirection enumerates the values for operation direction. +type OperationDirection string + +const ( + // Cancel ... + Cancel OperationDirection = "cancel" + // Do ... + Do OperationDirection = "do" + // Undo ... + Undo OperationDirection = "undo" +) + +// PossibleOperationDirectionValues returns an array of possible values for the OperationDirection const type. +func PossibleOperationDirectionValues() []OperationDirection { + return []OperationDirection{Cancel, Do, Undo} +} + +// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection +// provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + // Creating ... + Creating PrivateEndpointConnectionProvisioningState = "Creating" + // Deleting ... + Deleting PrivateEndpointConnectionProvisioningState = "Deleting" + // Failed ... + Failed PrivateEndpointConnectionProvisioningState = "Failed" + // Succeeded ... + Succeeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{Creating, Deleting, Failed, Succeeded} +} + +// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + // Approved ... + Approved PrivateEndpointServiceConnectionStatus = "Approved" + // Pending ... + Pending PrivateEndpointServiceConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{Approved, Pending, Rejected} +} + +// ProgressType enumerates the values for progress type. +type ProgressType string + +const ( + // Download ... + Download ProgressType = "download" + // Initialize ... + Initialize ProgressType = "initialize" + // None ... + None ProgressType = "none" + // Recall ... + Recall ProgressType = "recall" + // Upload ... + Upload ProgressType = "upload" +) + +// PossibleProgressTypeValues returns an array of possible values for the ProgressType const type. +func PossibleProgressTypeValues() []ProgressType { + return []ProgressType{Download, Initialize, None, Recall, Upload} +} + +// Reason enumerates the values for reason. +type Reason string + +const ( + // Deleted ... + Deleted Reason = "Deleted" + // Registered ... + Registered Reason = "Registered" + // Suspended ... + Suspended Reason = "Suspended" + // Unregistered ... + Unregistered Reason = "Unregistered" + // Warned ... + Warned Reason = "Warned" +) + +// PossibleReasonValues returns an array of possible values for the Reason const type. +func PossibleReasonValues() []Reason { + return []Reason{Deleted, Registered, Suspended, Unregistered, Warned} +} + +// RegisteredServerAgentVersionStatus enumerates the values for registered server agent version status. +type RegisteredServerAgentVersionStatus string + +const ( + // Blocked ... + Blocked RegisteredServerAgentVersionStatus = "Blocked" + // Expired ... + Expired RegisteredServerAgentVersionStatus = "Expired" + // NearExpiry ... + NearExpiry RegisteredServerAgentVersionStatus = "NearExpiry" + // Ok ... + Ok RegisteredServerAgentVersionStatus = "Ok" +) + +// PossibleRegisteredServerAgentVersionStatusValues returns an array of possible values for the RegisteredServerAgentVersionStatus const type. +func PossibleRegisteredServerAgentVersionStatusValues() []RegisteredServerAgentVersionStatus { + return []RegisteredServerAgentVersionStatus{Blocked, Expired, NearExpiry, Ok} +} + +// ServerEndpointHealthState enumerates the values for server endpoint health state. +type ServerEndpointHealthState string + +const ( + // ServerEndpointHealthStateError ... + ServerEndpointHealthStateError ServerEndpointHealthState = "Error" + // ServerEndpointHealthStateHealthy ... + ServerEndpointHealthStateHealthy ServerEndpointHealthState = "Healthy" + // ServerEndpointHealthStateUnavailable ... + ServerEndpointHealthStateUnavailable ServerEndpointHealthState = "Unavailable" +) + +// PossibleServerEndpointHealthStateValues returns an array of possible values for the ServerEndpointHealthState const type. +func PossibleServerEndpointHealthStateValues() []ServerEndpointHealthState { + return []ServerEndpointHealthState{ServerEndpointHealthStateError, ServerEndpointHealthStateHealthy, ServerEndpointHealthStateUnavailable} +} + +// ServerEndpointOfflineDataTransferState enumerates the values for server endpoint offline data transfer +// state. +type ServerEndpointOfflineDataTransferState string + +const ( + // Complete ... + Complete ServerEndpointOfflineDataTransferState = "Complete" + // InProgress ... + InProgress ServerEndpointOfflineDataTransferState = "InProgress" + // NotRunning ... + NotRunning ServerEndpointOfflineDataTransferState = "NotRunning" + // Stopping ... + Stopping ServerEndpointOfflineDataTransferState = "Stopping" +) + +// PossibleServerEndpointOfflineDataTransferStateValues returns an array of possible values for the ServerEndpointOfflineDataTransferState const type. +func PossibleServerEndpointOfflineDataTransferStateValues() []ServerEndpointOfflineDataTransferState { + return []ServerEndpointOfflineDataTransferState{Complete, InProgress, NotRunning, Stopping} +} + +// ServerEndpointSyncActivityState enumerates the values for server endpoint sync activity state. +type ServerEndpointSyncActivityState string + +const ( + // ServerEndpointSyncActivityStateDownload ... + ServerEndpointSyncActivityStateDownload ServerEndpointSyncActivityState = "Download" + // ServerEndpointSyncActivityStateUpload ... + ServerEndpointSyncActivityStateUpload ServerEndpointSyncActivityState = "Upload" + // ServerEndpointSyncActivityStateUploadAndDownload ... + ServerEndpointSyncActivityStateUploadAndDownload ServerEndpointSyncActivityState = "UploadAndDownload" +) + +// PossibleServerEndpointSyncActivityStateValues returns an array of possible values for the ServerEndpointSyncActivityState const type. +func PossibleServerEndpointSyncActivityStateValues() []ServerEndpointSyncActivityState { + return []ServerEndpointSyncActivityState{ServerEndpointSyncActivityStateDownload, ServerEndpointSyncActivityStateUpload, ServerEndpointSyncActivityStateUploadAndDownload} +} + +// ServerEndpointSyncMode enumerates the values for server endpoint sync mode. +type ServerEndpointSyncMode string + +const ( + // InitialFullDownload ... + InitialFullDownload ServerEndpointSyncMode = "InitialFullDownload" + // InitialUpload ... + InitialUpload ServerEndpointSyncMode = "InitialUpload" + // NamespaceDownload ... + NamespaceDownload ServerEndpointSyncMode = "NamespaceDownload" + // Regular ... + Regular ServerEndpointSyncMode = "Regular" + // SnapshotUpload ... + SnapshotUpload ServerEndpointSyncMode = "SnapshotUpload" +) + +// PossibleServerEndpointSyncModeValues returns an array of possible values for the ServerEndpointSyncMode const type. +func PossibleServerEndpointSyncModeValues() []ServerEndpointSyncMode { + return []ServerEndpointSyncMode{InitialFullDownload, InitialUpload, NamespaceDownload, Regular, SnapshotUpload} +} + +// WorkflowStatus enumerates the values for workflow status. +type WorkflowStatus string + +const ( + // WorkflowStatusAborted ... + WorkflowStatusAborted WorkflowStatus = "aborted" + // WorkflowStatusActive ... + WorkflowStatusActive WorkflowStatus = "active" + // WorkflowStatusExpired ... + WorkflowStatusExpired WorkflowStatus = "expired" + // WorkflowStatusFailed ... + WorkflowStatusFailed WorkflowStatus = "failed" + // WorkflowStatusSucceeded ... + WorkflowStatusSucceeded WorkflowStatus = "succeeded" +) + +// PossibleWorkflowStatusValues returns an array of possible values for the WorkflowStatus const type. +func PossibleWorkflowStatusValues() []WorkflowStatus { + return []WorkflowStatus{WorkflowStatusAborted, WorkflowStatusActive, WorkflowStatusExpired, WorkflowStatusFailed, WorkflowStatusSucceeded} +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/models.go b/services/storagesync/mgmt/2020-09-01/storagesync/models.go new file mode 100644 index 000000000000..5c9c00f34480 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/models.go @@ -0,0 +1,3266 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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/storagesync/mgmt/2020-09-01/storagesync" + +// APIError error type +type APIError struct { + // Code - Error code of the given entry. + Code *string `json:"code,omitempty"` + // Message - Error message of the given entry. + Message *string `json:"message,omitempty"` + // Target - Target of the given error entry. + Target *string `json:"target,omitempty"` + // Details - Error details of the given entry. + Details *ErrorDetails `json:"details,omitempty"` + // InnerError - Inner error details of the given entry. + InnerError *InnerErrorDetails `json:"innerError,omitempty"` +} + +// AzureEntityResource the resource model definition for an 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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BackupRequest backup request +type BackupRequest struct { + // AzureFileShare - Azure File Share. + AzureFileShare *string `json:"azureFileShare,omitempty"` +} + +// CheckNameAvailabilityParameters parameters for a check name availability request. +type CheckNameAvailabilityParameters struct { + // Name - The name to check for availability + Name *string `json:"name,omitempty"` + // Type - The resource type. Must be set to Microsoft.StorageSync/storageSyncServices + Type *string `json:"type,omitempty"` +} + +// CheckNameAvailabilityResult the CheckNameAvailability operation response. +type CheckNameAvailabilityResult struct { + autorest.Response `json:"-"` + // NameAvailable - READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - READ-ONLY; Gets the reason that a Storage Sync Service name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'Invalid', 'AlreadyExists' + Reason NameAvailabilityReason `json:"reason,omitempty"` + // Message - READ-ONLY; Gets an error message explaining the Reason value in more detail. + Message *string `json:"message,omitempty"` +} + +// MarshalJSON is the custom marshaler for CheckNameAvailabilityResult. +func (cnar CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CloudEndpoint cloud Endpoint object. +type CloudEndpoint struct { + autorest.Response `json:"-"` + // CloudEndpointProperties - Cloud Endpoint properties. + *CloudEndpointProperties `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudEndpoint. +func (ce CloudEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ce.CloudEndpointProperties != nil { + objectMap["properties"] = ce.CloudEndpointProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CloudEndpoint struct. +func (ce *CloudEndpoint) 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 "properties": + if v != nil { + var cloudEndpointProperties CloudEndpointProperties + err = json.Unmarshal(*v, &cloudEndpointProperties) + if err != nil { + return err + } + ce.CloudEndpointProperties = &cloudEndpointProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ce.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ce.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ce.Type = &typeVar + } + } + } + + return nil +} + +// CloudEndpointArray array of CloudEndpoint +type CloudEndpointArray struct { + autorest.Response `json:"-"` + // Value - Collection of CloudEndpoint. + Value *[]CloudEndpoint `json:"value,omitempty"` +} + +// CloudEndpointChangeEnumerationActivity cloud endpoint change enumeration activity object +type CloudEndpointChangeEnumerationActivity struct { + // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp + LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` + // OperationState - READ-ONLY; Change enumeration operation state. Possible values include: 'InitialEnumerationInProgress', 'EnumerationInProgress' + OperationState CloudEndpointChangeEnumerationActivityState `json:"operationState,omitempty"` + // StatusCode - READ-ONLY; When non-zero, indicates an issue that is delaying change enumeration + StatusCode *int32 `json:"statusCode,omitempty"` + // StartedTimestamp - READ-ONLY; Timestamp when change enumeration started + StartedTimestamp *date.Time `json:"startedTimestamp,omitempty"` + // ProcessedFilesCount - READ-ONLY; Count of files processed + ProcessedFilesCount *int64 `json:"processedFilesCount,omitempty"` + // ProcessedDirectoriesCount - READ-ONLY; Count of directories processed + ProcessedDirectoriesCount *int64 `json:"processedDirectoriesCount,omitempty"` + // TotalFilesCount - READ-ONLY; Total count of files enumerated + TotalFilesCount *int64 `json:"totalFilesCount,omitempty"` + // TotalDirectoriesCount - READ-ONLY; Total count of directories enumerated + TotalDirectoriesCount *int64 `json:"totalDirectoriesCount,omitempty"` + // TotalSizeBytes - READ-ONLY; Total enumerated size in bytes + TotalSizeBytes *int64 `json:"totalSizeBytes,omitempty"` + // ProgressPercent - READ-ONLY; Progress percentage for change enumeration run, excluding processing of deletes + ProgressPercent *int32 `json:"progressPercent,omitempty"` + // MinutesRemaining - READ-ONLY; Estimate of time remaining for the enumeration run + MinutesRemaining *int32 `json:"minutesRemaining,omitempty"` + // TotalCountsState - READ-ONLY; Change enumeration total counts state. Possible values include: 'Calculating', 'Final' + TotalCountsState CloudEndpointChangeEnumerationTotalCountsState `json:"totalCountsState,omitempty"` + // DeletesProgressPercent - READ-ONLY; Progress percentage for processing deletes. This is done separately from the rest of the enumeration run + DeletesProgressPercent *int32 `json:"deletesProgressPercent,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudEndpointChangeEnumerationActivity. +func (cecea CloudEndpointChangeEnumerationActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CloudEndpointChangeEnumerationStatus cloud endpoint change enumeration status object +type CloudEndpointChangeEnumerationStatus struct { + // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp + LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` + // LastEnumerationStatus - READ-ONLY; Status of last completed change enumeration + LastEnumerationStatus *CloudEndpointLastChangeEnumerationStatus `json:"lastEnumerationStatus,omitempty"` + // Activity - READ-ONLY; Change enumeration activity + Activity *CloudEndpointChangeEnumerationActivity `json:"activity,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudEndpointChangeEnumerationStatus. +func (ceces CloudEndpointChangeEnumerationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CloudEndpointCreateParameters the parameters used when creating a cloud endpoint. +type CloudEndpointCreateParameters struct { + // CloudEndpointCreateParametersProperties - The parameters used to create the cloud endpoint. + *CloudEndpointCreateParametersProperties `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudEndpointCreateParameters. +func (cecp CloudEndpointCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cecp.CloudEndpointCreateParametersProperties != nil { + objectMap["properties"] = cecp.CloudEndpointCreateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CloudEndpointCreateParameters struct. +func (cecp *CloudEndpointCreateParameters) 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 "properties": + if v != nil { + var cloudEndpointCreateParametersProperties CloudEndpointCreateParametersProperties + err = json.Unmarshal(*v, &cloudEndpointCreateParametersProperties) + if err != nil { + return err + } + cecp.CloudEndpointCreateParametersProperties = &cloudEndpointCreateParametersProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cecp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cecp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cecp.Type = &typeVar + } + } + } + + return nil +} + +// CloudEndpointCreateParametersProperties cloudEndpoint Properties object. +type CloudEndpointCreateParametersProperties struct { + // StorageAccountResourceID - Storage Account Resource Id + StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` + // AzureFileShareName - Azure file share name + AzureFileShareName *string `json:"azureFileShareName,omitempty"` + // StorageAccountTenantID - Storage Account Tenant Id + StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"` + // FriendlyName - Friendly Name + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// CloudEndpointLastChangeEnumerationStatus cloud endpoint change enumeration status object +type CloudEndpointLastChangeEnumerationStatus struct { + // StartedTimestamp - READ-ONLY; Timestamp when change enumeration started + StartedTimestamp *date.Time `json:"startedTimestamp,omitempty"` + // CompletedTimestamp - READ-ONLY; Timestamp when change enumeration completed + CompletedTimestamp *date.Time `json:"completedTimestamp,omitempty"` + // NamespaceFilesCount - READ-ONLY; Count of files in the namespace + NamespaceFilesCount *int64 `json:"namespaceFilesCount,omitempty"` + // NamespaceDirectoriesCount - READ-ONLY; Count of directories in the namespace + NamespaceDirectoriesCount *int64 `json:"namespaceDirectoriesCount,omitempty"` + // NamespaceSizeBytes - READ-ONLY; Namespace size in bytes + NamespaceSizeBytes *int64 `json:"namespaceSizeBytes,omitempty"` + // NextRunTimestamp - READ-ONLY; Timestamp of when change enumeration is expected to run again + NextRunTimestamp *date.Time `json:"nextRunTimestamp,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudEndpointLastChangeEnumerationStatus. +func (celces CloudEndpointLastChangeEnumerationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CloudEndpointProperties cloudEndpoint Properties object. +type CloudEndpointProperties struct { + // StorageAccountResourceID - Storage Account Resource Id + StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` + // AzureFileShareName - Azure file share name + AzureFileShareName *string `json:"azureFileShareName,omitempty"` + // StorageAccountTenantID - Storage Account Tenant Id + StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"` + // PartnershipID - Partnership Id + PartnershipID *string `json:"partnershipId,omitempty"` + // FriendlyName - Friendly Name + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupEnabled - READ-ONLY; Backup Enabled + BackupEnabled *string `json:"backupEnabled,omitempty"` + // ProvisioningState - CloudEndpoint Provisioning State + ProvisioningState *string `json:"provisioningState,omitempty"` + // LastWorkflowID - CloudEndpoint lastWorkflowId + LastWorkflowID *string `json:"lastWorkflowId,omitempty"` + // LastOperationName - Resource Last Operation Name + LastOperationName *string `json:"lastOperationName,omitempty"` + // ChangeEnumerationStatus - READ-ONLY; Cloud endpoint change enumeration status + ChangeEnumerationStatus *CloudEndpointChangeEnumerationStatus `json:"changeEnumerationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudEndpointProperties. +func (cep CloudEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cep.StorageAccountResourceID != nil { + objectMap["storageAccountResourceId"] = cep.StorageAccountResourceID + } + if cep.AzureFileShareName != nil { + objectMap["azureFileShareName"] = cep.AzureFileShareName + } + if cep.StorageAccountTenantID != nil { + objectMap["storageAccountTenantId"] = cep.StorageAccountTenantID + } + if cep.PartnershipID != nil { + objectMap["partnershipId"] = cep.PartnershipID + } + if cep.FriendlyName != nil { + objectMap["friendlyName"] = cep.FriendlyName + } + if cep.ProvisioningState != nil { + objectMap["provisioningState"] = cep.ProvisioningState + } + if cep.LastWorkflowID != nil { + objectMap["lastWorkflowId"] = cep.LastWorkflowID + } + if cep.LastOperationName != nil { + objectMap["lastOperationName"] = cep.LastOperationName + } + return json.Marshal(objectMap) +} + +// CloudEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CloudEndpointsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudEndpointsClient) (CloudEndpoint, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudEndpointsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudEndpointsCreateFuture.Result. +func (future *CloudEndpointsCreateFuture) result(client CloudEndpointsClient) (ce CloudEndpoint, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ce.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ce.Response.Response, err = future.GetResult(sender); err == nil && ce.Response.Response.StatusCode != http.StatusNoContent { + ce, err = client.CreateResponder(ce.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsCreateFuture", "Result", ce.Response.Response, "Failure responding to request") + } + } + return +} + +// CloudEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CloudEndpointsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudEndpointsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudEndpointsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudEndpointsDeleteFuture.Result. +func (future *CloudEndpointsDeleteFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudEndpointsPostBackupFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CloudEndpointsPostBackupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudEndpointsClient) (PostBackupResponse, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudEndpointsPostBackupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudEndpointsPostBackupFuture.Result. +func (future *CloudEndpointsPostBackupFuture) result(client CloudEndpointsClient) (pbr PostBackupResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostBackupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pbr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPostBackupFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pbr.Response.Response, err = future.GetResult(sender); err == nil && pbr.Response.Response.StatusCode != http.StatusNoContent { + pbr, err = client.PostBackupResponder(pbr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostBackupFuture", "Result", pbr.Response.Response, "Failure responding to request") + } + } + return +} + +// CloudEndpointsPostRestoreFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CloudEndpointsPostRestoreFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudEndpointsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudEndpointsPostRestoreFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudEndpointsPostRestoreFuture.Result. +func (future *CloudEndpointsPostRestoreFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostRestoreFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPostRestoreFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudEndpointsPreBackupFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CloudEndpointsPreBackupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudEndpointsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudEndpointsPreBackupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudEndpointsPreBackupFuture.Result. +func (future *CloudEndpointsPreBackupFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPreBackupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPreBackupFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudEndpointsPreRestoreFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CloudEndpointsPreRestoreFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudEndpointsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudEndpointsPreRestoreFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudEndpointsPreRestoreFuture.Result. +func (future *CloudEndpointsPreRestoreFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPreRestoreFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPreRestoreFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudEndpointsTriggerChangeDetectionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CloudEndpointsTriggerChangeDetectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudEndpointsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudEndpointsTriggerChangeDetectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudEndpointsTriggerChangeDetectionFuture.Result. +func (future *CloudEndpointsTriggerChangeDetectionFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsTriggerChangeDetectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsTriggerChangeDetectionFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudTieringCachePerformance server endpoint cloud tiering status object. +type CloudTieringCachePerformance struct { + // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp + LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` + // CacheHitBytes - READ-ONLY; Count of bytes that were served from the local server + CacheHitBytes *int64 `json:"cacheHitBytes,omitempty"` + // CacheMissBytes - READ-ONLY; Count of bytes that were served from the cloud + CacheMissBytes *int64 `json:"cacheMissBytes,omitempty"` + // CacheHitBytesPercent - READ-ONLY; Percentage of total bytes (hit + miss) that were served from the local server + CacheHitBytesPercent *int32 `json:"cacheHitBytesPercent,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudTieringCachePerformance. +func (ctcp CloudTieringCachePerformance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CloudTieringDatePolicyStatus status of the date policy +type CloudTieringDatePolicyStatus struct { + // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp + LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` + // TieredFilesMostRecentAccessTimestamp - READ-ONLY; Most recent access time of tiered files + TieredFilesMostRecentAccessTimestamp *date.Time `json:"tieredFilesMostRecentAccessTimestamp,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudTieringDatePolicyStatus. +func (ctdps CloudTieringDatePolicyStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CloudTieringFilesNotTiering server endpoint cloud tiering status object. +type CloudTieringFilesNotTiering struct { + // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp + LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` + // TotalFileCount - READ-ONLY; Last cloud tiering result (HResult) + TotalFileCount *int64 `json:"totalFileCount,omitempty"` + // Errors - READ-ONLY; Array of tiering errors + Errors *[]FilesNotTieringError `json:"errors,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudTieringFilesNotTiering. +func (ctfnt CloudTieringFilesNotTiering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CloudTieringSpaceSavings server endpoint cloud tiering status object. +type CloudTieringSpaceSavings struct { + // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp + LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` + // VolumeSizeBytes - READ-ONLY; Volume size + VolumeSizeBytes *int64 `json:"volumeSizeBytes,omitempty"` + // TotalSizeCloudBytes - READ-ONLY; Total size of content in the azure file share + TotalSizeCloudBytes *int64 `json:"totalSizeCloudBytes,omitempty"` + // CachedSizeBytes - READ-ONLY; Cached content size on the server + CachedSizeBytes *int64 `json:"cachedSizeBytes,omitempty"` + // SpaceSavingsPercent - READ-ONLY; Percentage of cached size over total size + SpaceSavingsPercent *int32 `json:"spaceSavingsPercent,omitempty"` + // SpaceSavingsBytes - READ-ONLY; Count of bytes saved on the server + SpaceSavingsBytes *int64 `json:"spaceSavingsBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudTieringSpaceSavings. +func (ctss CloudTieringSpaceSavings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CloudTieringVolumeFreeSpacePolicyStatus status of the volume free space policy +type CloudTieringVolumeFreeSpacePolicyStatus struct { + // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp + LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` + // EffectiveVolumeFreeSpacePolicy - READ-ONLY; In the case where multiple server endpoints are present in a volume, an effective free space policy is applied. + EffectiveVolumeFreeSpacePolicy *int32 `json:"effectiveVolumeFreeSpacePolicy,omitempty"` + // CurrentVolumeFreeSpacePercent - READ-ONLY; Current volume free space percentage. + CurrentVolumeFreeSpacePercent *int32 `json:"currentVolumeFreeSpacePercent,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudTieringVolumeFreeSpacePolicyStatus. +func (ctvfsps CloudTieringVolumeFreeSpacePolicyStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Error error type +type Error struct { + // Error - Error details of the given entry. + Error *APIError `json:"error,omitempty"` + // Innererror - Error details of the given entry. + Innererror *APIError `json:"innererror,omitempty"` +} + +// ErrorDetails error Details object. +type ErrorDetails struct { + // Code - Error code of the given entry. + Code *string `json:"code,omitempty"` + // Message - Error message of the given entry. + Message *string `json:"message,omitempty"` + // Target - Target of the given entry. + Target *string `json:"target,omitempty"` + // RequestURI - Request URI of the given entry. + RequestURI *string `json:"requestUri,omitempty"` + // ExceptionType - Exception type of the given entry. + ExceptionType *string `json:"exceptionType,omitempty"` + // HTTPMethod - HTTP method of the given entry. + HTTPMethod *string `json:"httpMethod,omitempty"` + // HashedMessage - Hashed message of the given entry. + HashedMessage *string `json:"hashedMessage,omitempty"` + // HTTPErrorCode - HTTP error code of the given entry. + HTTPErrorCode *string `json:"httpErrorCode,omitempty"` +} + +// FilesNotTieringError files not tiering error object +type FilesNotTieringError struct { + // ErrorCode - READ-ONLY; Error code (HResult) + ErrorCode *int32 `json:"errorCode,omitempty"` + // FileCount - READ-ONLY; Count of files with this error + FileCount *int64 `json:"fileCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for FilesNotTieringError. +func (fnte FilesNotTieringError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InnerErrorDetails error Details object. +type InnerErrorDetails struct { + // CallStack - Call stack of the error. + CallStack *string `json:"callStack,omitempty"` + // Message - Error message of the error. + Message *string `json:"message,omitempty"` + // InnerException - Exception of the inner error. + InnerException *string `json:"innerException,omitempty"` + // InnerExceptionCallStack - Call stack of the inner error. + InnerExceptionCallStack *string `json:"innerExceptionCallStack,omitempty"` +} + +// LocationOperationStatus operation status object +type LocationOperationStatus struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Operation resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Operation Id + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; Operation status + Status *string `json:"status,omitempty"` + // StartTime - READ-ONLY; Start time of the operation + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; End time of the operation + EndTime *date.Time `json:"endTime,omitempty"` + // Error - READ-ONLY; Error details. + Error *APIError `json:"error,omitempty"` + // PercentComplete - READ-ONLY; Percent complete. + PercentComplete *int32 `json:"percentComplete,omitempty"` +} + +// MarshalJSON is the custom marshaler for LocationOperationStatus. +func (los LocationOperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationDisplayInfo the operation supported by storage sync. +type OperationDisplayInfo struct { + // Description - The description of the operation. + Description *string `json:"description,omitempty"` + // Operation - The action that users can perform, based on their permission level. + Operation *string `json:"operation,omitempty"` + // Provider - Service provider: Microsoft StorageSync. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` +} + +// OperationDisplayResource operation Display Resource object. +type OperationDisplayResource struct { + // Provider - Operation Display Resource Provider. + Provider *string `json:"provider,omitempty"` + // Resource - Operation Display Resource. + Resource *string `json:"resource,omitempty"` + // Operation - Operation Display Resource Operation. + Operation *string `json:"operation,omitempty"` + // Description - Operation Display Resource Description. + Description *string `json:"description,omitempty"` +} + +// OperationEntity the operation supported by storage sync. +type OperationEntity struct { + // Name - Operation name: {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + // Display - The operation supported by storage sync. + Display *OperationDisplayInfo `json:"display,omitempty"` + // Origin - The origin. + Origin *string `json:"origin,omitempty"` + // Properties - Properties of the operations resource. + Properties *OperationProperties `json:"properties,omitempty"` +} + +// OperationEntityListResult the list of storage sync operations. +type OperationEntityListResult struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` + // Value - The list of operations. + Value *[]OperationEntity `json:"value,omitempty"` +} + +// OperationEntityListResultIterator provides access to a complete listing of OperationEntity values. +type OperationEntityListResultIterator struct { + i int + page OperationEntityListResultPage +} + +// 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 *OperationEntityListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultIterator.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 *OperationEntityListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationEntityListResultIterator) 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 OperationEntityListResultIterator) Response() OperationEntityListResult { + 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 OperationEntityListResultIterator) Value() OperationEntity { + if !iter.page.NotDone() { + return OperationEntity{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationEntityListResultIterator type. +func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator { + return OperationEntityListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (oelr OperationEntityListResult) IsEmpty() bool { + return oelr.Value == nil || len(*oelr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (oelr OperationEntityListResult) hasNextLink() bool { + return oelr.NextLink != nil && len(*oelr.NextLink) != 0 +} + +// operationEntityListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oelr OperationEntityListResult) operationEntityListResultPreparer(ctx context.Context) (*http.Request, error) { + if !oelr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oelr.NextLink))) +} + +// OperationEntityListResultPage contains a page of OperationEntity values. +type OperationEntityListResultPage struct { + fn func(context.Context, OperationEntityListResult) (OperationEntityListResult, error) + oelr OperationEntityListResult +} + +// 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 *OperationEntityListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.oelr) + if err != nil { + return err + } + page.oelr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *OperationEntityListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationEntityListResultPage) NotDone() bool { + return !page.oelr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationEntityListResultPage) Response() OperationEntityListResult { + return page.oelr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationEntityListResultPage) Values() []OperationEntity { + if page.oelr.IsEmpty() { + return nil + } + return *page.oelr.Value +} + +// Creates a new instance of the OperationEntityListResultPage type. +func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage { + return OperationEntityListResultPage{ + fn: getNextPage, + oelr: cur, + } +} + +// OperationProperties properties of the operations resource. +type OperationProperties struct { + // ServiceSpecification - Service specification for the operations resource. + ServiceSpecification *OperationResourceServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// OperationResourceMetricSpecification operation Display Resource object. +type OperationResourceMetricSpecification struct { + // Name - Name of the metric. + Name *string `json:"name,omitempty"` + // DisplayName - Display name for the metric. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Display description for the metric. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Unit for the metric. + Unit *string `json:"unit,omitempty"` + // AggregationType - Aggregation type for the metric. + AggregationType *string `json:"aggregationType,omitempty"` + // FillGapWithZero - Fill gaps in the metric with zero. + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + // Dimensions - Dimensions for the metric specification. + Dimensions *[]OperationResourceMetricSpecificationDimension `json:"dimensions,omitempty"` +} + +// OperationResourceMetricSpecificationDimension operationResourceMetricSpecificationDimension object. +type OperationResourceMetricSpecificationDimension struct { + // Name - Name of the dimension. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of the dimensions. + DisplayName *string `json:"displayName,omitempty"` + // ToBeExportedForShoebox - Indicates metric should be exported for Shoebox. + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + +// OperationResourceServiceSpecification service specification. +type OperationResourceServiceSpecification struct { + // MetricSpecifications - List of metric specifications. + MetricSpecifications *[]OperationResourceMetricSpecification `json:"metricSpecifications,omitempty"` +} + +// OperationStatus operation status object +type OperationStatus struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Operation Id + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; Operation status + Status *string `json:"status,omitempty"` + // StartTime - READ-ONLY; Start time of the operation + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; End time of the operation + EndTime *date.Time `json:"endTime,omitempty"` + // Error - READ-ONLY; Error details. + Error *APIError `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatus. +func (osVar OperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PostBackupResponse post Backup Response +type PostBackupResponse struct { + autorest.Response `json:"-"` + // PostBackupResponseProperties - Post Backup Response Properties + *PostBackupResponseProperties `json:"backupMetadata,omitempty"` +} + +// MarshalJSON is the custom marshaler for PostBackupResponse. +func (pbr PostBackupResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pbr.PostBackupResponseProperties != nil { + objectMap["backupMetadata"] = pbr.PostBackupResponseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PostBackupResponse struct. +func (pbr *PostBackupResponse) 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 "backupMetadata": + if v != nil { + var postBackupResponseProperties PostBackupResponseProperties + err = json.Unmarshal(*v, &postBackupResponseProperties) + if err != nil { + return err + } + pbr.PostBackupResponseProperties = &postBackupResponseProperties + } + } + } + + return nil +} + +// PostBackupResponseProperties post Backup Response Properties object. +type PostBackupResponseProperties struct { + // CloudEndpointName - READ-ONLY; cloud endpoint Name. + CloudEndpointName *string `json:"cloudEndpointName,omitempty"` +} + +// MarshalJSON is the custom marshaler for PostBackupResponseProperties. +func (pbrp PostBackupResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PostRestoreRequest post Restore Request +type PostRestoreRequest struct { + // Partition - Post Restore partition. + Partition *string `json:"partition,omitempty"` + // ReplicaGroup - Post Restore replica group. + ReplicaGroup *string `json:"replicaGroup,omitempty"` + // RequestID - Post Restore request id. + RequestID *string `json:"requestId,omitempty"` + // AzureFileShareURI - Post Restore Azure file share uri. + AzureFileShareURI *string `json:"azureFileShareUri,omitempty"` + // Status - Post Restore Azure status. + Status *string `json:"status,omitempty"` + // SourceAzureFileShareURI - Post Restore Azure source azure file share uri. + SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"` + // FailedFileList - Post Restore Azure failed file list. + FailedFileList *string `json:"failedFileList,omitempty"` + // RestoreFileSpec - Post Restore restore file spec array. + RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"` +} + +// PreRestoreRequest pre Restore request object. +type PreRestoreRequest struct { + // Partition - Pre Restore partition. + Partition *string `json:"partition,omitempty"` + // ReplicaGroup - Pre Restore replica group. + ReplicaGroup *string `json:"replicaGroup,omitempty"` + // RequestID - Pre Restore request id. + RequestID *string `json:"requestId,omitempty"` + // AzureFileShareURI - Pre Restore Azure file share uri. + AzureFileShareURI *string `json:"azureFileShareUri,omitempty"` + // Status - Pre Restore Azure status. + Status *string `json:"status,omitempty"` + // SourceAzureFileShareURI - Pre Restore Azure source azure file share uri. + SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"` + // BackupMetadataPropertyBag - Pre Restore backup metadata property bag. + BackupMetadataPropertyBag *string `json:"backupMetadataPropertyBag,omitempty"` + // RestoreFileSpec - Pre Restore restore file spec array. + RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"` + // PauseWaitForSyncDrainTimePeriodInSeconds - Pre Restore pause wait for sync drain time period in seconds. + PauseWaitForSyncDrainTimePeriodInSeconds *int32 `json:"pauseWaitForSyncDrainTimePeriodInSeconds,omitempty"` +} + +// PrivateEndpoint the Private Endpoint resource. +type PrivateEndpoint struct { + // ID - READ-ONLY; The ARM identifier for Private Endpoint + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpoint. +func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateEndpointConnection the Private Endpoint Connection resource. +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) 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 "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult list of private endpoint connection associated with the specified +// storage account +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Array of private endpoint connections + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} + +// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - The resource of private end point. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` +} + +// PrivateEndpointConnectionsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsCreateFuture.Result. +func (future *PrivateEndpointConnectionsCreateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.PrivateEndpointConnectionsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.CreateResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsCreateFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. +func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) 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 "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - The private link resource Private link DNS zone name. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plrp.RequiredZoneNames != nil { + objectMap["requiredZoneNames"] = plrp.RequiredZoneNames + } + return json.Marshal(objectMap) +} + +// PrivateLinkServiceConnectionState a collection of information about the state of the connection between +// service consumer and provider. +type PrivateLinkServiceConnectionState struct { + // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected' + Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` + // Description - The reason for approval/rejection of the connection. + Description *string `json:"description,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RecallActionParameters the parameters used when calling recall action on server endpoint. +type RecallActionParameters struct { + // Pattern - Pattern of the files. + Pattern *string `json:"pattern,omitempty"` + // RecallPath - Recall path. + RecallPath *string `json:"recallPath,omitempty"` +} + +// RegisteredServer registered Server resource. +type RegisteredServer struct { + autorest.Response `json:"-"` + // RegisteredServerProperties - RegisteredServer properties. + *RegisteredServerProperties `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegisteredServer. +func (rs RegisteredServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rs.RegisteredServerProperties != nil { + objectMap["properties"] = rs.RegisteredServerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RegisteredServer struct. +func (rs *RegisteredServer) 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 "properties": + if v != nil { + var registeredServerProperties RegisteredServerProperties + err = json.Unmarshal(*v, ®isteredServerProperties) + if err != nil { + return err + } + rs.RegisteredServerProperties = ®isteredServerProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rs.Type = &typeVar + } + } + } + + return nil +} + +// RegisteredServerArray array of RegisteredServer +type RegisteredServerArray struct { + autorest.Response `json:"-"` + // Value - Collection of Registered Server. + Value *[]RegisteredServer `json:"value,omitempty"` +} + +// RegisteredServerCreateParameters the parameters used when creating a registered server. +type RegisteredServerCreateParameters struct { + // RegisteredServerCreateParametersProperties - The parameters used to create the registered server. + *RegisteredServerCreateParametersProperties `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegisteredServerCreateParameters. +func (rscp RegisteredServerCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rscp.RegisteredServerCreateParametersProperties != nil { + objectMap["properties"] = rscp.RegisteredServerCreateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RegisteredServerCreateParameters struct. +func (rscp *RegisteredServerCreateParameters) 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 "properties": + if v != nil { + var registeredServerCreateParametersProperties RegisteredServerCreateParametersProperties + err = json.Unmarshal(*v, ®isteredServerCreateParametersProperties) + if err != nil { + return err + } + rscp.RegisteredServerCreateParametersProperties = ®isteredServerCreateParametersProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rscp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rscp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rscp.Type = &typeVar + } + } + } + + return nil +} + +// RegisteredServerCreateParametersProperties registeredServer Create Properties object. +type RegisteredServerCreateParametersProperties struct { + // ServerCertificate - Registered Server Certificate + ServerCertificate *string `json:"serverCertificate,omitempty"` + // AgentVersion - Registered Server Agent Version + AgentVersion *string `json:"agentVersion,omitempty"` + // ServerOSVersion - Registered Server OS Version + ServerOSVersion *string `json:"serverOSVersion,omitempty"` + // LastHeartBeat - Registered Server last heart beat + LastHeartBeat *string `json:"lastHeartBeat,omitempty"` + // ServerRole - Registered Server serverRole + ServerRole *string `json:"serverRole,omitempty"` + // ClusterID - Registered Server clusterId + ClusterID *string `json:"clusterId,omitempty"` + // ClusterName - Registered Server clusterName + ClusterName *string `json:"clusterName,omitempty"` + // ServerID - Registered Server serverId + ServerID *string `json:"serverId,omitempty"` + // FriendlyName - Friendly Name + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// RegisteredServerProperties registeredServer Properties object. +type RegisteredServerProperties struct { + // ServerCertificate - Registered Server Certificate + ServerCertificate *string `json:"serverCertificate,omitempty"` + // AgentVersion - Registered Server Agent Version + AgentVersion *string `json:"agentVersion,omitempty"` + // AgentVersionStatus - READ-ONLY; Registered Server Agent Version Status. Possible values include: 'Ok', 'NearExpiry', 'Expired', 'Blocked' + AgentVersionStatus RegisteredServerAgentVersionStatus `json:"agentVersionStatus,omitempty"` + // AgentVersionExpirationDate - READ-ONLY; Registered Server Agent Version Expiration Date + AgentVersionExpirationDate *date.Time `json:"agentVersionExpirationDate,omitempty"` + // ServerOSVersion - Registered Server OS Version + ServerOSVersion *string `json:"serverOSVersion,omitempty"` + // ServerManagementErrorCode - Registered Server Management Error Code + ServerManagementErrorCode *int32 `json:"serverManagementErrorCode,omitempty"` + // LastHeartBeat - Registered Server last heart beat + LastHeartBeat *string `json:"lastHeartBeat,omitempty"` + // ProvisioningState - Registered Server Provisioning State + ProvisioningState *string `json:"provisioningState,omitempty"` + // ServerRole - Registered Server serverRole + ServerRole *string `json:"serverRole,omitempty"` + // ClusterID - Registered Server clusterId + ClusterID *string `json:"clusterId,omitempty"` + // ClusterName - Registered Server clusterName + ClusterName *string `json:"clusterName,omitempty"` + // ServerID - Registered Server serverId + ServerID *string `json:"serverId,omitempty"` + // StorageSyncServiceUID - Registered Server storageSyncServiceUid + StorageSyncServiceUID *string `json:"storageSyncServiceUid,omitempty"` + // LastWorkflowID - Registered Server lastWorkflowId + LastWorkflowID *string `json:"lastWorkflowId,omitempty"` + // LastOperationName - Resource Last Operation Name + LastOperationName *string `json:"lastOperationName,omitempty"` + // DiscoveryEndpointURI - Resource discoveryEndpointUri + DiscoveryEndpointURI *string `json:"discoveryEndpointUri,omitempty"` + // ResourceLocation - Resource Location + ResourceLocation *string `json:"resourceLocation,omitempty"` + // ServiceLocation - Service Location + ServiceLocation *string `json:"serviceLocation,omitempty"` + // FriendlyName - Friendly Name + FriendlyName *string `json:"friendlyName,omitempty"` + // ManagementEndpointURI - Management Endpoint Uri + ManagementEndpointURI *string `json:"managementEndpointUri,omitempty"` + // MonitoringEndpointURI - Telemetry Endpoint Uri + MonitoringEndpointURI *string `json:"monitoringEndpointUri,omitempty"` + // MonitoringConfiguration - Monitoring Configuration + MonitoringConfiguration *string `json:"monitoringConfiguration,omitempty"` + // ServerName - READ-ONLY; Server name + ServerName *string `json:"serverName,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegisteredServerProperties. +func (rsp RegisteredServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.ServerCertificate != nil { + objectMap["serverCertificate"] = rsp.ServerCertificate + } + if rsp.AgentVersion != nil { + objectMap["agentVersion"] = rsp.AgentVersion + } + if rsp.ServerOSVersion != nil { + objectMap["serverOSVersion"] = rsp.ServerOSVersion + } + if rsp.ServerManagementErrorCode != nil { + objectMap["serverManagementErrorCode"] = rsp.ServerManagementErrorCode + } + if rsp.LastHeartBeat != nil { + objectMap["lastHeartBeat"] = rsp.LastHeartBeat + } + if rsp.ProvisioningState != nil { + objectMap["provisioningState"] = rsp.ProvisioningState + } + if rsp.ServerRole != nil { + objectMap["serverRole"] = rsp.ServerRole + } + if rsp.ClusterID != nil { + objectMap["clusterId"] = rsp.ClusterID + } + if rsp.ClusterName != nil { + objectMap["clusterName"] = rsp.ClusterName + } + if rsp.ServerID != nil { + objectMap["serverId"] = rsp.ServerID + } + if rsp.StorageSyncServiceUID != nil { + objectMap["storageSyncServiceUid"] = rsp.StorageSyncServiceUID + } + if rsp.LastWorkflowID != nil { + objectMap["lastWorkflowId"] = rsp.LastWorkflowID + } + if rsp.LastOperationName != nil { + objectMap["lastOperationName"] = rsp.LastOperationName + } + if rsp.DiscoveryEndpointURI != nil { + objectMap["discoveryEndpointUri"] = rsp.DiscoveryEndpointURI + } + if rsp.ResourceLocation != nil { + objectMap["resourceLocation"] = rsp.ResourceLocation + } + if rsp.ServiceLocation != nil { + objectMap["serviceLocation"] = rsp.ServiceLocation + } + if rsp.FriendlyName != nil { + objectMap["friendlyName"] = rsp.FriendlyName + } + if rsp.ManagementEndpointURI != nil { + objectMap["managementEndpointUri"] = rsp.ManagementEndpointURI + } + if rsp.MonitoringEndpointURI != nil { + objectMap["monitoringEndpointUri"] = rsp.MonitoringEndpointURI + } + if rsp.MonitoringConfiguration != nil { + objectMap["monitoringConfiguration"] = rsp.MonitoringConfiguration + } + return json.Marshal(objectMap) +} + +// RegisteredServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegisteredServersCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegisteredServersClient) (RegisteredServer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegisteredServersCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegisteredServersCreateFuture.Result. +func (future *RegisteredServersCreateFuture) result(client RegisteredServersClient) (rs RegisteredServer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rs.Response.Response, err = future.GetResult(sender); err == nil && rs.Response.Response.StatusCode != http.StatusNoContent { + rs, err = client.CreateResponder(rs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersCreateFuture", "Result", rs.Response.Response, "Failure responding to request") + } + } + return +} + +// RegisteredServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegisteredServersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegisteredServersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegisteredServersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegisteredServersDeleteFuture.Result. +func (future *RegisteredServersDeleteFuture) result(client RegisteredServersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RegisteredServersTriggerRolloverFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type RegisteredServersTriggerRolloverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegisteredServersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegisteredServersTriggerRolloverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegisteredServersTriggerRolloverFuture.Result. +func (future *RegisteredServersTriggerRolloverFuture) result(client RegisteredServersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersTriggerRolloverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersTriggerRolloverFuture") + return + } + ar.Response = future.Response() + return +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourcesMoveInfo resource Move Info. +type ResourcesMoveInfo struct { + // TargetResourceGroup - Target resource group. + TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` + // Resources - Collection of Resources. + Resources *[]string `json:"resources,omitempty"` +} + +// RestoreFileSpec restore file spec. +type RestoreFileSpec struct { + // Path - Restore file spec path + Path *string `json:"path,omitempty"` + // Isdir - Restore file spec isdir + Isdir *bool `json:"isdir,omitempty"` +} + +// ServerEndpoint server Endpoint object. +type ServerEndpoint struct { + autorest.Response `json:"-"` + // ServerEndpointProperties - Server Endpoint properties. + *ServerEndpointProperties `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpoint. +func (se ServerEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if se.ServerEndpointProperties != nil { + objectMap["properties"] = se.ServerEndpointProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServerEndpoint struct. +func (se *ServerEndpoint) 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 "properties": + if v != nil { + var serverEndpointProperties ServerEndpointProperties + err = json.Unmarshal(*v, &serverEndpointProperties) + if err != nil { + return err + } + se.ServerEndpointProperties = &serverEndpointProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + se.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + se.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + se.Type = &typeVar + } + } + } + + return nil +} + +// ServerEndpointArray array of ServerEndpoint +type ServerEndpointArray struct { + autorest.Response `json:"-"` + // Value - Collection of ServerEndpoint. + Value *[]ServerEndpoint `json:"value,omitempty"` +} + +// ServerEndpointBackgroundDataDownloadActivity background data download activity object +type ServerEndpointBackgroundDataDownloadActivity struct { + // Timestamp - READ-ONLY; Timestamp when properties were updated + Timestamp *date.Time `json:"timestamp,omitempty"` + // StartedTimestamp - READ-ONLY; Timestamp when the operation started + StartedTimestamp *date.Time `json:"startedTimestamp,omitempty"` + // PercentProgress - READ-ONLY; Progress percentage + PercentProgress *int32 `json:"percentProgress,omitempty"` + // DownloadedBytes - READ-ONLY; Running count of bytes downloaded + DownloadedBytes *int64 `json:"downloadedBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointBackgroundDataDownloadActivity. +func (sebdda ServerEndpointBackgroundDataDownloadActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServerEndpointCloudTieringStatus server endpoint cloud tiering status object. +type ServerEndpointCloudTieringStatus struct { + // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp + LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` + // Health - READ-ONLY; Cloud tiering health state. Possible values include: 'ServerEndpointHealthStateUnavailable', 'ServerEndpointHealthStateHealthy', 'ServerEndpointHealthStateError' + Health ServerEndpointHealthState `json:"health,omitempty"` + // HealthLastUpdatedTimestamp - READ-ONLY; The last updated timestamp of health state + HealthLastUpdatedTimestamp *date.Time `json:"healthLastUpdatedTimestamp,omitempty"` + // LastCloudTieringResult - READ-ONLY; Last cloud tiering result (HResult) + LastCloudTieringResult *int32 `json:"lastCloudTieringResult,omitempty"` + // LastSuccessTimestamp - READ-ONLY; Last cloud tiering success timestamp + LastSuccessTimestamp *date.Time `json:"lastSuccessTimestamp,omitempty"` + // SpaceSavings - READ-ONLY; Information regarding how much local space cloud tiering is saving. + SpaceSavings *CloudTieringSpaceSavings `json:"spaceSavings,omitempty"` + // CachePerformance - READ-ONLY; Information regarding how well the local cache on the server is performing. + CachePerformance *CloudTieringCachePerformance `json:"cachePerformance,omitempty"` + // FilesNotTiering - READ-ONLY; Information regarding files that failed to be tiered + FilesNotTiering *CloudTieringFilesNotTiering `json:"filesNotTiering,omitempty"` + // VolumeFreeSpacePolicyStatus - READ-ONLY; Status of the volume free space policy + VolumeFreeSpacePolicyStatus *CloudTieringVolumeFreeSpacePolicyStatus `json:"volumeFreeSpacePolicyStatus,omitempty"` + // DatePolicyStatus - READ-ONLY; Status of the date policy + DatePolicyStatus *CloudTieringDatePolicyStatus `json:"datePolicyStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointCloudTieringStatus. +func (sects ServerEndpointCloudTieringStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServerEndpointCreateParameters the parameters used when creating a server endpoint. +type ServerEndpointCreateParameters struct { + // ServerEndpointCreateParametersProperties - The parameters used to create the server endpoint. + *ServerEndpointCreateParametersProperties `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointCreateParameters. +func (secp ServerEndpointCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if secp.ServerEndpointCreateParametersProperties != nil { + objectMap["properties"] = secp.ServerEndpointCreateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServerEndpointCreateParameters struct. +func (secp *ServerEndpointCreateParameters) 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 "properties": + if v != nil { + var serverEndpointCreateParametersProperties ServerEndpointCreateParametersProperties + err = json.Unmarshal(*v, &serverEndpointCreateParametersProperties) + if err != nil { + return err + } + secp.ServerEndpointCreateParametersProperties = &serverEndpointCreateParametersProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + secp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + secp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + secp.Type = &typeVar + } + } + } + + return nil +} + +// ServerEndpointCreateParametersProperties serverEndpoint Properties object. +type ServerEndpointCreateParametersProperties struct { + // ServerLocalPath - Server Local path. + ServerLocalPath *string `json:"serverLocalPath,omitempty"` + // CloudTiering - Cloud Tiering. Possible values include: 'On', 'Off' + CloudTiering FeatureStatus `json:"cloudTiering,omitempty"` + // VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled. + VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"` + // TierFilesOlderThanDays - Tier files older than days. + TierFilesOlderThanDays *int32 `json:"tierFilesOlderThanDays,omitempty"` + // FriendlyName - Friendly Name + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerResourceID - Server Resource Id. + ServerResourceID *string `json:"serverResourceId,omitempty"` + // OfflineDataTransfer - Offline data transfer. Possible values include: 'On', 'Off' + OfflineDataTransfer FeatureStatus `json:"offlineDataTransfer,omitempty"` + // OfflineDataTransferShareName - Offline data transfer share name + OfflineDataTransferShareName *string `json:"offlineDataTransferShareName,omitempty"` + // InitialDownloadPolicy - Policy for how namespace and files are recalled during FastDr. Possible values include: 'NamespaceOnly', 'NamespaceThenModifiedFiles', 'AvoidTieredFiles' + InitialDownloadPolicy InitialDownloadPolicy `json:"initialDownloadPolicy,omitempty"` + // LocalCacheMode - Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. Possible values include: 'DownloadNewAndModifiedFiles', 'UpdateLocallyCachedFiles' + LocalCacheMode LocalCacheMode `json:"localCacheMode,omitempty"` + // InitialUploadPolicy - Policy for how the initial upload sync session is performed. Possible values include: 'ServerAuthoritative', 'Merge' + InitialUploadPolicy InitialUploadPolicy `json:"initialUploadPolicy,omitempty"` +} + +// ServerEndpointFilesNotSyncingError files not syncing error object +type ServerEndpointFilesNotSyncingError struct { + // ErrorCode - READ-ONLY; Error code (HResult) + ErrorCode *int32 `json:"errorCode,omitempty"` + // PersistentCount - READ-ONLY; Count of persistent files not syncing with the specified error code + PersistentCount *int64 `json:"persistentCount,omitempty"` + // TransientCount - READ-ONLY; Count of transient files not syncing with the specified error code + TransientCount *int64 `json:"transientCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointFilesNotSyncingError. +func (sefnse ServerEndpointFilesNotSyncingError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServerEndpointProperties serverEndpoint Properties object. +type ServerEndpointProperties struct { + // ServerLocalPath - Server Local path. + ServerLocalPath *string `json:"serverLocalPath,omitempty"` + // CloudTiering - Cloud Tiering. Possible values include: 'On', 'Off' + CloudTiering FeatureStatus `json:"cloudTiering,omitempty"` + // VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled. + VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"` + // TierFilesOlderThanDays - Tier files older than days. + TierFilesOlderThanDays *int32 `json:"tierFilesOlderThanDays,omitempty"` + // FriendlyName - Friendly Name + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerResourceID - Server Resource Id. + ServerResourceID *string `json:"serverResourceId,omitempty"` + // ProvisioningState - READ-ONLY; ServerEndpoint Provisioning State + ProvisioningState *string `json:"provisioningState,omitempty"` + // LastWorkflowID - READ-ONLY; ServerEndpoint lastWorkflowId + LastWorkflowID *string `json:"lastWorkflowId,omitempty"` + // LastOperationName - READ-ONLY; Resource Last Operation Name + LastOperationName *string `json:"lastOperationName,omitempty"` + // SyncStatus - READ-ONLY; Server Endpoint sync status + SyncStatus *ServerEndpointSyncStatus `json:"syncStatus,omitempty"` + // OfflineDataTransfer - Offline data transfer. Possible values include: 'On', 'Off' + OfflineDataTransfer FeatureStatus `json:"offlineDataTransfer,omitempty"` + // OfflineDataTransferStorageAccountResourceID - READ-ONLY; Offline data transfer storage account resource ID + OfflineDataTransferStorageAccountResourceID *string `json:"offlineDataTransferStorageAccountResourceId,omitempty"` + // OfflineDataTransferStorageAccountTenantID - READ-ONLY; Offline data transfer storage account tenant ID + OfflineDataTransferStorageAccountTenantID *string `json:"offlineDataTransferStorageAccountTenantId,omitempty"` + // OfflineDataTransferShareName - Offline data transfer share name + OfflineDataTransferShareName *string `json:"offlineDataTransferShareName,omitempty"` + // CloudTieringStatus - READ-ONLY; Cloud tiering status. Only populated if cloud tiering is enabled. + CloudTieringStatus *ServerEndpointCloudTieringStatus `json:"cloudTieringStatus,omitempty"` + // RecallStatus - READ-ONLY; Recall status. Only populated if cloud tiering is enabled. + RecallStatus *ServerEndpointRecallStatus `json:"recallStatus,omitempty"` + // InitialDownloadPolicy - Policy for how namespace and files are recalled during FastDr. Possible values include: 'NamespaceOnly', 'NamespaceThenModifiedFiles', 'AvoidTieredFiles' + InitialDownloadPolicy InitialDownloadPolicy `json:"initialDownloadPolicy,omitempty"` + // LocalCacheMode - Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. Possible values include: 'DownloadNewAndModifiedFiles', 'UpdateLocallyCachedFiles' + LocalCacheMode LocalCacheMode `json:"localCacheMode,omitempty"` + // InitialUploadPolicy - Policy for how the initial upload sync session is performed. Possible values include: 'ServerAuthoritative', 'Merge' + InitialUploadPolicy InitialUploadPolicy `json:"initialUploadPolicy,omitempty"` + // ServerName - READ-ONLY; Server name + ServerName *string `json:"serverName,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointProperties. +func (sep ServerEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sep.ServerLocalPath != nil { + objectMap["serverLocalPath"] = sep.ServerLocalPath + } + if sep.CloudTiering != "" { + objectMap["cloudTiering"] = sep.CloudTiering + } + if sep.VolumeFreeSpacePercent != nil { + objectMap["volumeFreeSpacePercent"] = sep.VolumeFreeSpacePercent + } + if sep.TierFilesOlderThanDays != nil { + objectMap["tierFilesOlderThanDays"] = sep.TierFilesOlderThanDays + } + if sep.FriendlyName != nil { + objectMap["friendlyName"] = sep.FriendlyName + } + if sep.ServerResourceID != nil { + objectMap["serverResourceId"] = sep.ServerResourceID + } + if sep.OfflineDataTransfer != "" { + objectMap["offlineDataTransfer"] = sep.OfflineDataTransfer + } + if sep.OfflineDataTransferShareName != nil { + objectMap["offlineDataTransferShareName"] = sep.OfflineDataTransferShareName + } + if sep.InitialDownloadPolicy != "" { + objectMap["initialDownloadPolicy"] = sep.InitialDownloadPolicy + } + if sep.LocalCacheMode != "" { + objectMap["localCacheMode"] = sep.LocalCacheMode + } + if sep.InitialUploadPolicy != "" { + objectMap["initialUploadPolicy"] = sep.InitialUploadPolicy + } + return json.Marshal(objectMap) +} + +// ServerEndpointRecallError server endpoint recall error object +type ServerEndpointRecallError struct { + // ErrorCode - READ-ONLY; Error code (HResult) + ErrorCode *int32 `json:"errorCode,omitempty"` + // Count - READ-ONLY; Count of occurences of the error + Count *int64 `json:"count,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointRecallError. +func (sere ServerEndpointRecallError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServerEndpointRecallStatus server endpoint recall status object. +type ServerEndpointRecallStatus struct { + // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp + LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` + // TotalRecallErrorsCount - READ-ONLY; Total count of recall errors. + TotalRecallErrorsCount *int64 `json:"totalRecallErrorsCount,omitempty"` + // RecallErrors - READ-ONLY; Array of recall errors + RecallErrors *[]ServerEndpointRecallError `json:"recallErrors,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointRecallStatus. +func (sers ServerEndpointRecallStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServerEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServerEndpointsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServerEndpointsClient) (ServerEndpoint, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServerEndpointsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServerEndpointsCreateFuture.Result. +func (future *ServerEndpointsCreateFuture) result(client ServerEndpointsClient) (se ServerEndpoint, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + se.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent { + se, err = client.CreateResponder(se.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServerEndpointsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServerEndpointsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServerEndpointsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServerEndpointsDeleteFuture.Result. +func (future *ServerEndpointsDeleteFuture) result(client ServerEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ServerEndpointsRecallActionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServerEndpointsRecallActionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServerEndpointsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServerEndpointsRecallActionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServerEndpointsRecallActionFuture.Result. +func (future *ServerEndpointsRecallActionFuture) result(client ServerEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsRecallActionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsRecallActionFuture") + return + } + ar.Response = future.Response() + return +} + +// ServerEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServerEndpointsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServerEndpointsClient) (ServerEndpoint, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServerEndpointsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServerEndpointsUpdateFuture.Result. +func (future *ServerEndpointsUpdateFuture) result(client ServerEndpointsClient) (se ServerEndpoint, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + se.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent { + se, err = client.UpdateResponder(se.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request") + } + } + return +} + +// ServerEndpointSyncActivityStatus sync Session status object. +type ServerEndpointSyncActivityStatus struct { + // Timestamp - READ-ONLY; Timestamp when properties were updated + Timestamp *date.Time `json:"timestamp,omitempty"` + // PerItemErrorCount - READ-ONLY; Per item error count + PerItemErrorCount *int64 `json:"perItemErrorCount,omitempty"` + // AppliedItemCount - READ-ONLY; Applied item count. + AppliedItemCount *int64 `json:"appliedItemCount,omitempty"` + // TotalItemCount - READ-ONLY; Total item count (if available) + TotalItemCount *int64 `json:"totalItemCount,omitempty"` + // AppliedBytes - READ-ONLY; Applied bytes + AppliedBytes *int64 `json:"appliedBytes,omitempty"` + // TotalBytes - READ-ONLY; Total bytes (if available) + TotalBytes *int64 `json:"totalBytes,omitempty"` + // SyncMode - READ-ONLY; Sync mode. Possible values include: 'Regular', 'NamespaceDownload', 'InitialUpload', 'SnapshotUpload', 'InitialFullDownload' + SyncMode ServerEndpointSyncMode `json:"syncMode,omitempty"` + // SessionMinutesRemaining - READ-ONLY; Session minutes remaining (if available) + SessionMinutesRemaining *int32 `json:"sessionMinutesRemaining,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointSyncActivityStatus. +func (sesas ServerEndpointSyncActivityStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServerEndpointSyncSessionStatus sync Session status object. +type ServerEndpointSyncSessionStatus struct { + // LastSyncResult - READ-ONLY; Last sync result (HResult) + LastSyncResult *int32 `json:"lastSyncResult,omitempty"` + // LastSyncTimestamp - READ-ONLY; Last sync timestamp + LastSyncTimestamp *date.Time `json:"lastSyncTimestamp,omitempty"` + // LastSyncSuccessTimestamp - READ-ONLY; Last sync success timestamp + LastSyncSuccessTimestamp *date.Time `json:"lastSyncSuccessTimestamp,omitempty"` + // LastSyncPerItemErrorCount - READ-ONLY; Last sync per item error count. + LastSyncPerItemErrorCount *int64 `json:"lastSyncPerItemErrorCount,omitempty"` + // PersistentFilesNotSyncingCount - READ-ONLY; Count of persistent files not syncing. + PersistentFilesNotSyncingCount *int64 `json:"persistentFilesNotSyncingCount,omitempty"` + // TransientFilesNotSyncingCount - READ-ONLY; Count of transient files not syncing. + TransientFilesNotSyncingCount *int64 `json:"transientFilesNotSyncingCount,omitempty"` + // FilesNotSyncingErrors - READ-ONLY; Array of per-item errors coming from the last sync session. + FilesNotSyncingErrors *[]ServerEndpointFilesNotSyncingError `json:"filesNotSyncingErrors,omitempty"` + // LastSyncMode - READ-ONLY; Sync mode. Possible values include: 'Regular', 'NamespaceDownload', 'InitialUpload', 'SnapshotUpload', 'InitialFullDownload' + LastSyncMode ServerEndpointSyncMode `json:"lastSyncMode,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointSyncSessionStatus. +func (sesss ServerEndpointSyncSessionStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServerEndpointSyncStatus server Endpoint sync status +type ServerEndpointSyncStatus struct { + // DownloadHealth - READ-ONLY; Download Health Status. Possible values include: 'ServerEndpointHealthStateUnavailable', 'ServerEndpointHealthStateHealthy', 'ServerEndpointHealthStateError' + DownloadHealth ServerEndpointHealthState `json:"downloadHealth,omitempty"` + // UploadHealth - READ-ONLY; Upload Health Status. Possible values include: 'ServerEndpointHealthStateUnavailable', 'ServerEndpointHealthStateHealthy', 'ServerEndpointHealthStateError' + UploadHealth ServerEndpointHealthState `json:"uploadHealth,omitempty"` + // CombinedHealth - READ-ONLY; Combined Health Status. Possible values include: 'ServerEndpointHealthStateUnavailable', 'ServerEndpointHealthStateHealthy', 'ServerEndpointHealthStateError' + CombinedHealth ServerEndpointHealthState `json:"combinedHealth,omitempty"` + // SyncActivity - READ-ONLY; Sync activity. Possible values include: 'ServerEndpointSyncActivityStateUpload', 'ServerEndpointSyncActivityStateDownload', 'ServerEndpointSyncActivityStateUploadAndDownload' + SyncActivity ServerEndpointSyncActivityState `json:"syncActivity,omitempty"` + // TotalPersistentFilesNotSyncingCount - READ-ONLY; Total count of persistent files not syncing (combined upload + download). + TotalPersistentFilesNotSyncingCount *int64 `json:"totalPersistentFilesNotSyncingCount,omitempty"` + // LastUpdatedTimestamp - READ-ONLY; Last Updated Timestamp + LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` + // UploadStatus - READ-ONLY; Upload Status + UploadStatus *ServerEndpointSyncSessionStatus `json:"uploadStatus,omitempty"` + // DownloadStatus - READ-ONLY; Download Status + DownloadStatus *ServerEndpointSyncSessionStatus `json:"downloadStatus,omitempty"` + // UploadActivity - READ-ONLY; Upload sync activity + UploadActivity *ServerEndpointSyncActivityStatus `json:"uploadActivity,omitempty"` + // DownloadActivity - READ-ONLY; Download sync activity + DownloadActivity *ServerEndpointSyncActivityStatus `json:"downloadActivity,omitempty"` + // OfflineDataTransferStatus - READ-ONLY; Offline Data Transfer State. Possible values include: 'InProgress', 'Stopping', 'NotRunning', 'Complete' + OfflineDataTransferStatus ServerEndpointOfflineDataTransferState `json:"offlineDataTransferStatus,omitempty"` + // BackgroundDataDownloadActivity - READ-ONLY; Background data download activity + BackgroundDataDownloadActivity *ServerEndpointBackgroundDataDownloadActivity `json:"backgroundDataDownloadActivity,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointSyncStatus. +func (sess ServerEndpointSyncStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServerEndpointUpdateParameters parameters for updating an Server Endpoint. +type ServerEndpointUpdateParameters struct { + // ServerEndpointUpdateProperties - The properties of the server endpoint. + *ServerEndpointUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerEndpointUpdateParameters. +func (seup ServerEndpointUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if seup.ServerEndpointUpdateProperties != nil { + objectMap["properties"] = seup.ServerEndpointUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServerEndpointUpdateParameters struct. +func (seup *ServerEndpointUpdateParameters) 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 "properties": + if v != nil { + var serverEndpointUpdateProperties ServerEndpointUpdateProperties + err = json.Unmarshal(*v, &serverEndpointUpdateProperties) + if err != nil { + return err + } + seup.ServerEndpointUpdateProperties = &serverEndpointUpdateProperties + } + } + } + + return nil +} + +// ServerEndpointUpdateProperties serverEndpoint Update Properties object. +type ServerEndpointUpdateProperties struct { + // CloudTiering - Cloud Tiering. Possible values include: 'On', 'Off' + CloudTiering FeatureStatus `json:"cloudTiering,omitempty"` + // VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled. + VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"` + // TierFilesOlderThanDays - Tier files older than days. + TierFilesOlderThanDays *int32 `json:"tierFilesOlderThanDays,omitempty"` + // OfflineDataTransfer - Offline data transfer. Possible values include: 'On', 'Off' + OfflineDataTransfer FeatureStatus `json:"offlineDataTransfer,omitempty"` + // OfflineDataTransferShareName - Offline data transfer share name + OfflineDataTransferShareName *string `json:"offlineDataTransferShareName,omitempty"` + // LocalCacheMode - Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. Possible values include: 'DownloadNewAndModifiedFiles', 'UpdateLocallyCachedFiles' + LocalCacheMode LocalCacheMode `json:"localCacheMode,omitempty"` +} + +// Service storage Sync Service object. +type Service struct { + autorest.Response `json:"-"` + // ServiceProperties - Storage Sync Service properties. + *ServiceProperties `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 resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Service. +func (s Service) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ServiceProperties != nil { + objectMap["properties"] = s.ServiceProperties + } + if s.Tags != nil { + objectMap["tags"] = s.Tags + } + if s.Location != nil { + objectMap["location"] = s.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Service struct. +func (s *Service) 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 "properties": + if v != nil { + var serviceProperties ServiceProperties + err = json.Unmarshal(*v, &serviceProperties) + if err != nil { + return err + } + s.ServiceProperties = &serviceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ServiceArray array of StorageSyncServices +type ServiceArray struct { + autorest.Response `json:"-"` + // Value - Collection of StorageSyncServices. + Value *[]Service `json:"value,omitempty"` +} + +// ServiceCreateParameters the parameters used when creating a storage sync service. +type ServiceCreateParameters struct { + // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. + Tags map[string]*string `json:"tags"` + // ServiceCreateParametersProperties - The parameters used to create the storage sync service. + *ServiceCreateParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceCreateParameters. +func (scp ServiceCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scp.Location != nil { + objectMap["location"] = scp.Location + } + if scp.Tags != nil { + objectMap["tags"] = scp.Tags + } + if scp.ServiceCreateParametersProperties != nil { + objectMap["properties"] = scp.ServiceCreateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceCreateParameters struct. +func (scp *ServiceCreateParameters) 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 + } + scp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + scp.Tags = tags + } + case "properties": + if v != nil { + var serviceCreateParametersProperties ServiceCreateParametersProperties + err = json.Unmarshal(*v, &serviceCreateParametersProperties) + if err != nil { + return err + } + scp.ServiceCreateParametersProperties = &serviceCreateParametersProperties + } + } + } + + return nil +} + +// ServiceCreateParametersProperties storageSyncService Properties object. +type ServiceCreateParametersProperties struct { + // IncomingTrafficPolicy - Incoming Traffic Policy. Possible values include: 'AllowAllTraffic', 'AllowVirtualNetworksOnly' + IncomingTrafficPolicy IncomingTrafficPolicy `json:"incomingTrafficPolicy,omitempty"` +} + +// ServiceProperties storage Sync Service Properties object. +type ServiceProperties struct { + // IncomingTrafficPolicy - Incoming Traffic Policy. Possible values include: 'AllowAllTraffic', 'AllowVirtualNetworksOnly' + IncomingTrafficPolicy IncomingTrafficPolicy `json:"incomingTrafficPolicy,omitempty"` + // StorageSyncServiceStatus - READ-ONLY; Storage Sync service status. + StorageSyncServiceStatus *int32 `json:"storageSyncServiceStatus,omitempty"` + // StorageSyncServiceUID - READ-ONLY; Storage Sync service Uid + StorageSyncServiceUID *string `json:"storageSyncServiceUid,omitempty"` + // ProvisioningState - READ-ONLY; StorageSyncService Provisioning State + ProvisioningState *string `json:"provisioningState,omitempty"` + // LastWorkflowID - READ-ONLY; StorageSyncService lastWorkflowId + LastWorkflowID *string `json:"lastWorkflowId,omitempty"` + // LastOperationName - READ-ONLY; Resource Last Operation Name + LastOperationName *string `json:"lastOperationName,omitempty"` + // PrivateEndpointConnections - READ-ONLY; List of private endpoint connection associated with the specified storage sync service + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceProperties. +func (sp ServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.IncomingTrafficPolicy != "" { + objectMap["incomingTrafficPolicy"] = sp.IncomingTrafficPolicy + } + return json.Marshal(objectMap) +} + +// ServicesCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServicesClient) (Service, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServicesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServicesCreateFuture.Result. +func (future *ServicesCreateFuture) result(client ServicesClient) (s Service, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.ServicesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesCreateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// ServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServicesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServicesDeleteFuture.Result. +func (future *ServicesDeleteFuture) result(client ServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.ServicesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServicesClient) (Service, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServicesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServicesUpdateFuture.Result. +func (future *ServicesUpdateFuture) result(client ServicesClient) (s Service, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("storagesync.ServicesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.UpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// ServiceUpdateParameters parameters for updating an Storage sync service. +type ServiceUpdateParameters struct { + // Tags - The user-specified tags associated with the storage sync service. + Tags map[string]*string `json:"tags"` + // ServiceUpdateProperties - The properties of the server endpoint. + *ServiceUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceUpdateParameters. +func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.Tags != nil { + objectMap["tags"] = sup.Tags + } + if sup.ServiceUpdateProperties != nil { + objectMap["properties"] = sup.ServiceUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. +func (sup *ServiceUpdateParameters) 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 "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sup.Tags = tags + } + case "properties": + if v != nil { + var serviceUpdateProperties ServiceUpdateProperties + err = json.Unmarshal(*v, &serviceUpdateProperties) + if err != nil { + return err + } + sup.ServiceUpdateProperties = &serviceUpdateProperties + } + } + } + + return nil +} + +// ServiceUpdateProperties storageSyncService Properties object. +type ServiceUpdateProperties struct { + // IncomingTrafficPolicy - Incoming Traffic Policy. Possible values include: 'AllowAllTraffic', 'AllowVirtualNetworksOnly' + IncomingTrafficPolicy IncomingTrafficPolicy `json:"incomingTrafficPolicy,omitempty"` +} + +// SubscriptionState subscription State object. +type SubscriptionState struct { + // State - State of Azure Subscription. Possible values include: 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted' + State Reason `json:"state,omitempty"` + // Istransitioning - READ-ONLY; Is Transitioning + Istransitioning *bool `json:"istransitioning,omitempty"` + // Properties - Subscription state properties. + Properties interface{} `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubscriptionState. +func (ss SubscriptionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.State != "" { + objectMap["state"] = ss.State + } + if ss.Properties != nil { + objectMap["properties"] = ss.Properties + } + return json.Marshal(objectMap) +} + +// SyncGroup sync Group object. +type SyncGroup struct { + autorest.Response `json:"-"` + // SyncGroupProperties - SyncGroup properties. + *SyncGroupProperties `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SyncGroup. +func (sg SyncGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sg.SyncGroupProperties != nil { + objectMap["properties"] = sg.SyncGroupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SyncGroup struct. +func (sg *SyncGroup) 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 "properties": + if v != nil { + var syncGroupProperties SyncGroupProperties + err = json.Unmarshal(*v, &syncGroupProperties) + if err != nil { + return err + } + sg.SyncGroupProperties = &syncGroupProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sg.Type = &typeVar + } + } + } + + return nil +} + +// SyncGroupArray array of SyncGroup +type SyncGroupArray struct { + autorest.Response `json:"-"` + // Value - Collection of SyncGroup. + Value *[]SyncGroup `json:"value,omitempty"` +} + +// SyncGroupCreateParameters the parameters used when creating a sync group. +type SyncGroupCreateParameters struct { + // Properties - The parameters used to create the sync group + Properties interface{} `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SyncGroupCreateParameters. +func (sgcp SyncGroupCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sgcp.Properties != nil { + objectMap["properties"] = sgcp.Properties + } + return json.Marshal(objectMap) +} + +// SyncGroupProperties syncGroup Properties object. +type SyncGroupProperties struct { + // UniqueID - READ-ONLY; Unique Id + UniqueID *string `json:"uniqueId,omitempty"` + // SyncGroupStatus - READ-ONLY; Sync group status + SyncGroupStatus *string `json:"syncGroupStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for SyncGroupProperties. +func (sgp SyncGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +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. E.g. "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) +} + +// TriggerChangeDetectionParameters the parameters used when calling trigger change detection action on +// cloud endpoint. +type TriggerChangeDetectionParameters struct { + // DirectoryPath - Relative path to a directory Azure File share for which change detection is to be performed. + DirectoryPath *string `json:"directoryPath,omitempty"` + // ChangeDetectionMode - Change Detection Mode. Applies to a directory specified in directoryPath parameter. Possible values include: 'Default', 'Recursive' + ChangeDetectionMode ChangeDetectionMode `json:"changeDetectionMode,omitempty"` + // Paths - Array of relative paths on the Azure File share to be included in the change detection. Can be files and directories. + Paths *[]string `json:"paths,omitempty"` +} + +// TriggerRolloverRequest trigger Rollover Request. +type TriggerRolloverRequest struct { + // ServerCertificate - Certificate Data + ServerCertificate *string `json:"serverCertificate,omitempty"` +} + +// Workflow workflow resource. +type Workflow struct { + autorest.Response `json:"-"` + // WorkflowProperties - Workflow properties. + *WorkflowProperties `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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Workflow. +func (w Workflow) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WorkflowProperties != nil { + objectMap["properties"] = w.WorkflowProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Workflow struct. +func (w *Workflow) 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 "properties": + if v != nil { + var workflowProperties WorkflowProperties + err = json.Unmarshal(*v, &workflowProperties) + if err != nil { + return err + } + w.WorkflowProperties = &workflowProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + } + } + + return nil +} + +// WorkflowArray array of Workflow +type WorkflowArray struct { + autorest.Response `json:"-"` + // Value - Collection of workflow items. + Value *[]Workflow `json:"value,omitempty"` +} + +// WorkflowProperties workflow Properties object. +type WorkflowProperties struct { + // LastStepName - last step name + LastStepName *string `json:"lastStepName,omitempty"` + // Status - workflow status. Possible values include: 'WorkflowStatusActive', 'WorkflowStatusExpired', 'WorkflowStatusSucceeded', 'WorkflowStatusAborted', 'WorkflowStatusFailed' + Status WorkflowStatus `json:"status,omitempty"` + // Operation - operation direction. Possible values include: 'Do', 'Undo', 'Cancel' + Operation OperationDirection `json:"operation,omitempty"` + // Steps - workflow steps + Steps *string `json:"steps,omitempty"` + // LastOperationID - workflow last operation identifier. + LastOperationID *string `json:"lastOperationId,omitempty"` + // CommandName - READ-ONLY; workflow command name. + CommandName *string `json:"commandName,omitempty"` + // CreatedTimestamp - READ-ONLY; workflow created timestamp. + CreatedTimestamp *date.Time `json:"createdTimestamp,omitempty"` + // LastStatusTimestamp - READ-ONLY; workflow last status timestamp. + LastStatusTimestamp *date.Time `json:"lastStatusTimestamp,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkflowProperties. +func (wp WorkflowProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.LastStepName != nil { + objectMap["lastStepName"] = wp.LastStepName + } + if wp.Status != "" { + objectMap["status"] = wp.Status + } + if wp.Operation != "" { + objectMap["operation"] = wp.Operation + } + if wp.Steps != nil { + objectMap["steps"] = wp.Steps + } + if wp.LastOperationID != nil { + objectMap["lastOperationId"] = wp.LastOperationID + } + return json.Marshal(objectMap) +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/operations.go b/services/storagesync/mgmt/2020-09-01/storagesync/operations.go new file mode 100644 index 000000000000..d8f48a3f5028 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/operations.go @@ -0,0 +1,140 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" +) + +// OperationsClient is the microsoft Storage Sync Service API +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient 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 NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Storage Sync Rest API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationEntityListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.oelr.Response.Response != nil { + sc = result.oelr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.oelr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.oelr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.oelr.hasNextLink() && result.oelr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.StorageSync/operations"), + 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 OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(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 OperationsClient) ListResponder(resp *http.Response) (result OperationEntityListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationEntityListResult) (result OperationEntityListResult, err error) { + req, err := lastResults.operationEntityListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storagesync.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "storagesync.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationEntityListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.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/services/storagesync/mgmt/2020-09-01/storagesync/operationstatus.go b/services/storagesync/mgmt/2020-09-01/storagesync/operationstatus.go new file mode 100644 index 000000000000..b01a24948a80 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/operationstatus.go @@ -0,0 +1,121 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationStatusClient is the microsoft Storage Sync Service API +type OperationStatusClient struct { + BaseClient +} + +// NewOperationStatusClient creates an instance of the OperationStatusClient client. +func NewOperationStatusClient(subscriptionID string) OperationStatusClient { + return NewOperationStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationStatusClientWithBaseURI creates an instance of the OperationStatusClient 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 NewOperationStatusClientWithBaseURI(baseURI string, subscriptionID string) OperationStatusClient { + return OperationStatusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get Operation status +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// locationName - the desired region to obtain information from. +// workflowID - workflow Id +// operationID - operation Id +func (client OperationStatusClient) Get(ctx context.Context, resourceGroupName string, locationName string, workflowID string, operationID string) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationStatusClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.OperationStatusClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, locationName, workflowID, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.OperationStatusClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.OperationStatusClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.OperationStatusClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationStatusClient) GetPreparer(ctx context.Context, resourceGroupName string, locationName string, workflowID string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "locationName": autorest.Encode("path", locationName), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowId": autorest.Encode("path", workflowID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/locations/{locationName}/workflows/{workflowId}/operations/{operationId}", 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 OperationStatusClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OperationStatusClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/privateendpointconnections.go b/services/storagesync/mgmt/2020-09-01/storagesync/privateendpointconnections.go new file mode 100644 index 000000000000..ef5e1ea53063 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/privateendpointconnections.go @@ -0,0 +1,393 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionsClient is the microsoft Storage Sync Service API +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient 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 NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create update the state of specified private endpoint connection associated with the storage sync service. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - the name of the storage sync service name within the specified resource group. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Azure +// resource +// properties - the private endpoint connection properties. +func (client PrivateEndpointConnectionsClient) Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (result PrivateEndpointConnectionsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: properties, + Constraints: []validation.Constraint{{Target: "properties.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "properties.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("storagesync.PrivateEndpointConnectionsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client PrivateEndpointConnectionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) CreateSender(req *http.Request) (future PrivateEndpointConnectionsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) CreateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified private endpoint connection associated with the storage sync service. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - the name of the storage sync service name within the specified resource group. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Azure +// resource +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, storageSyncServiceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified private endpoint connection associated with the storage sync service. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - the name of the storage sync service name within the specified resource group. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Azure +// resource +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, storageSyncServiceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByStorageSyncService get a PrivateEndpointConnection List. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +func (client PrivateEndpointConnectionsClient) ListByStorageSyncService(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result PrivateEndpointConnectionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByStorageSyncService") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.PrivateEndpointConnectionsClient", "ListByStorageSyncService", err.Error()) + } + + req, err := client.ListByStorageSyncServicePreparer(ctx, resourceGroupName, storageSyncServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsClient", "ListByStorageSyncService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByStorageSyncServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsClient", "ListByStorageSyncService", resp, "Failure sending request") + return + } + + result, err = client.ListByStorageSyncServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateEndpointConnectionsClient", "ListByStorageSyncService", resp, "Failure responding to request") + return + } + + return +} + +// ListByStorageSyncServicePreparer prepares the ListByStorageSyncService request. +func (client PrivateEndpointConnectionsClient) ListByStorageSyncServicePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByStorageSyncServiceSender sends the ListByStorageSyncService request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) ListByStorageSyncServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByStorageSyncServiceResponder handles the response to the ListByStorageSyncService request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) ListByStorageSyncServiceResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/privatelinkresources.go b/services/storagesync/mgmt/2020-09-01/storagesync/privatelinkresources.go new file mode 100644 index 000000000000..8bcd7044be82 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/privatelinkresources.go @@ -0,0 +1,118 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkResourcesClient is the microsoft Storage Sync Service API +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient 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 NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByStorageSyncService gets the private link resources that need to be created for a storage sync service. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - the name of the storage sync service name within the specified resource group. +func (client PrivateLinkResourcesClient) ListByStorageSyncService(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result PrivateLinkResourceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByStorageSyncService") + 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}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.PrivateLinkResourcesClient", "ListByStorageSyncService", err.Error()) + } + + req, err := client.ListByStorageSyncServicePreparer(ctx, resourceGroupName, storageSyncServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateLinkResourcesClient", "ListByStorageSyncService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByStorageSyncServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.PrivateLinkResourcesClient", "ListByStorageSyncService", resp, "Failure sending request") + return + } + + result, err = client.ListByStorageSyncServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.PrivateLinkResourcesClient", "ListByStorageSyncService", resp, "Failure responding to request") + return + } + + return +} + +// ListByStorageSyncServicePreparer prepares the ListByStorageSyncService request. +func (client PrivateLinkResourcesClient) ListByStorageSyncServicePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByStorageSyncServiceSender sends the ListByStorageSyncService request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) ListByStorageSyncServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByStorageSyncServiceResponder handles the response to the ListByStorageSyncService request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) ListByStorageSyncServiceResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/registeredservers.go b/services/storagesync/mgmt/2020-09-01/storagesync/registeredservers.go new file mode 100644 index 000000000000..9205cc76ae7d --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/registeredservers.go @@ -0,0 +1,479 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RegisteredServersClient is the microsoft Storage Sync Service API +type RegisteredServersClient struct { + BaseClient +} + +// NewRegisteredServersClient creates an instance of the RegisteredServersClient client. +func NewRegisteredServersClient(subscriptionID string) RegisteredServersClient { + return NewRegisteredServersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRegisteredServersClientWithBaseURI creates an instance of the RegisteredServersClient 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 NewRegisteredServersClientWithBaseURI(baseURI string, subscriptionID string) RegisteredServersClient { + return RegisteredServersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create add a new registered server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// serverID - GUID identifying the on-premises server. +// parameters - body of Registered Server object. +func (client RegisteredServersClient) Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string, parameters RegisteredServerCreateParameters) (result RegisteredServersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredServersClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.RegisteredServersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, storageSyncServiceName, serverID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client RegisteredServersClient) CreatePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string, parameters RegisteredServerCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverId": autorest.Encode("path", serverID), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client RegisteredServersClient) CreateSender(req *http.Request) (future RegisteredServersCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client RegisteredServersClient) CreateResponder(resp *http.Response) (result RegisteredServer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the given registered server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// serverID - GUID identifying the on-premises server. +func (client RegisteredServersClient) Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string) (result RegisteredServersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredServersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.RegisteredServersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, storageSyncServiceName, serverID) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RegisteredServersClient) DeletePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverId": autorest.Encode("path", serverID), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RegisteredServersClient) DeleteSender(req *http.Request) (future RegisteredServersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RegisteredServersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a given registered server. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// serverID - GUID identifying the on-premises server. +func (client RegisteredServersClient) Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string) (result RegisteredServer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredServersClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.RegisteredServersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, storageSyncServiceName, serverID) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RegisteredServersClient) GetPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverId": autorest.Encode("path", serverID), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", 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 RegisteredServersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RegisteredServersClient) GetResponder(resp *http.Response) (result RegisteredServer, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByStorageSyncService get a given registered server list. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +func (client RegisteredServersClient) ListByStorageSyncService(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result RegisteredServerArray, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredServersClient.ListByStorageSyncService") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.RegisteredServersClient", "ListByStorageSyncService", err.Error()) + } + + req, err := client.ListByStorageSyncServicePreparer(ctx, resourceGroupName, storageSyncServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "ListByStorageSyncService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByStorageSyncServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "ListByStorageSyncService", resp, "Failure sending request") + return + } + + result, err = client.ListByStorageSyncServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "ListByStorageSyncService", resp, "Failure responding to request") + return + } + + return +} + +// ListByStorageSyncServicePreparer prepares the ListByStorageSyncService request. +func (client RegisteredServersClient) ListByStorageSyncServicePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByStorageSyncServiceSender sends the ListByStorageSyncService request. The method will close the +// http.Response Body if it receives an error. +func (client RegisteredServersClient) ListByStorageSyncServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByStorageSyncServiceResponder handles the response to the ListByStorageSyncService request. The method always +// closes the http.Response Body. +func (client RegisteredServersClient) ListByStorageSyncServiceResponder(resp *http.Response) (result RegisteredServerArray, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TriggerRollover triggers Server certificate rollover. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// serverID - server Id +// parameters - body of Trigger Rollover request. +func (client RegisteredServersClient) TriggerRollover(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string, parameters TriggerRolloverRequest) (result RegisteredServersTriggerRolloverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredServersClient.TriggerRollover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.RegisteredServersClient", "TriggerRollover", err.Error()) + } + + req, err := client.TriggerRolloverPreparer(ctx, resourceGroupName, storageSyncServiceName, serverID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "TriggerRollover", nil, "Failure preparing request") + return + } + + result, err = client.TriggerRolloverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersClient", "TriggerRollover", result.Response(), "Failure sending request") + return + } + + return +} + +// TriggerRolloverPreparer prepares the TriggerRollover request. +func (client RegisteredServersClient) TriggerRolloverPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string, parameters TriggerRolloverRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverId": autorest.Encode("path", serverID), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TriggerRolloverSender sends the TriggerRollover request. The method will close the +// http.Response Body if it receives an error. +func (client RegisteredServersClient) TriggerRolloverSender(req *http.Request) (future RegisteredServersTriggerRolloverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TriggerRolloverResponder handles the response to the TriggerRollover request. The method always +// closes the http.Response Body. +func (client RegisteredServersClient) TriggerRolloverResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/serverendpoints.go b/services/storagesync/mgmt/2020-09-01/storagesync/serverendpoints.go new file mode 100644 index 000000000000..95b5fec4eab3 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/serverendpoints.go @@ -0,0 +1,597 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServerEndpointsClient is the microsoft Storage Sync Service API +type ServerEndpointsClient struct { + BaseClient +} + +// NewServerEndpointsClient creates an instance of the ServerEndpointsClient client. +func NewServerEndpointsClient(subscriptionID string) ServerEndpointsClient { + return NewServerEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServerEndpointsClientWithBaseURI creates an instance of the ServerEndpointsClient 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 NewServerEndpointsClientWithBaseURI(baseURI string, subscriptionID string) ServerEndpointsClient { + return ServerEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a new ServerEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// serverEndpointName - name of Server Endpoint object. +// parameters - body of Server Endpoint object. +func (client ServerEndpointsClient) Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters ServerEndpointCreateParameters) (result ServerEndpointsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerEndpointsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties.VolumeFreeSpacePercent", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties.VolumeFreeSpacePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.ServerEndpointCreateParametersProperties.VolumeFreeSpacePercent", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "parameters.ServerEndpointCreateParametersProperties.TierFilesOlderThanDays", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ServerEndpointCreateParametersProperties.TierFilesOlderThanDays", Name: validation.InclusiveMaximum, Rule: int64(2147483647), Chain: nil}, + {Target: "parameters.ServerEndpointCreateParametersProperties.TierFilesOlderThanDays", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("storagesync.ServerEndpointsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ServerEndpointsClient) CreatePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters ServerEndpointCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverEndpointName": autorest.Encode("path", serverEndpointName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ServerEndpointsClient) CreateSender(req *http.Request) (future ServerEndpointsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ServerEndpointsClient) CreateResponder(resp *http.Response) (result ServerEndpoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a given ServerEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// serverEndpointName - name of Server Endpoint object. +func (client ServerEndpointsClient) Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string) (result ServerEndpointsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerEndpointsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServerEndpointsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServerEndpointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverEndpointName": autorest.Encode("path", serverEndpointName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ServerEndpointsClient) DeleteSender(req *http.Request) (future ServerEndpointsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ServerEndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a ServerEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// serverEndpointName - name of Server Endpoint object. +func (client ServerEndpointsClient) Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string) (result ServerEndpoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerEndpointsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServerEndpointsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServerEndpointsClient) GetPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverEndpointName": autorest.Encode("path", serverEndpointName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", 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 ServerEndpointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ServerEndpointsClient) GetResponder(resp *http.Response) (result ServerEndpoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySyncGroup get a ServerEndpoint list. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +func (client ServerEndpointsClient) ListBySyncGroup(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (result ServerEndpointArray, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerEndpointsClient.ListBySyncGroup") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServerEndpointsClient", "ListBySyncGroup", err.Error()) + } + + req, err := client.ListBySyncGroupPreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "ListBySyncGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySyncGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "ListBySyncGroup", resp, "Failure sending request") + return + } + + result, err = client.ListBySyncGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "ListBySyncGroup", resp, "Failure responding to request") + return + } + + return +} + +// ListBySyncGroupPreparer prepares the ListBySyncGroup request. +func (client ServerEndpointsClient) ListBySyncGroupPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySyncGroupSender sends the ListBySyncGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ServerEndpointsClient) ListBySyncGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySyncGroupResponder handles the response to the ListBySyncGroup request. The method always +// closes the http.Response Body. +func (client ServerEndpointsClient) ListBySyncGroupResponder(resp *http.Response) (result ServerEndpointArray, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RecallAction recall a server endpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// serverEndpointName - name of Server Endpoint object. +// parameters - body of Recall Action object. +func (client ServerEndpointsClient) RecallAction(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters RecallActionParameters) (result ServerEndpointsRecallActionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerEndpointsClient.RecallAction") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServerEndpointsClient", "RecallAction", err.Error()) + } + + req, err := client.RecallActionPreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "RecallAction", nil, "Failure preparing request") + return + } + + result, err = client.RecallActionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "RecallAction", result.Response(), "Failure sending request") + return + } + + return +} + +// RecallActionPreparer prepares the RecallAction request. +func (client ServerEndpointsClient) RecallActionPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters RecallActionParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverEndpointName": autorest.Encode("path", serverEndpointName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecallActionSender sends the RecallAction request. The method will close the +// http.Response Body if it receives an error. +func (client ServerEndpointsClient) RecallActionSender(req *http.Request) (future ServerEndpointsRecallActionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RecallActionResponder handles the response to the RecallAction request. The method always +// closes the http.Response Body. +func (client ServerEndpointsClient) RecallActionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update patch a given ServerEndpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// serverEndpointName - name of Server Endpoint object. +// parameters - any of the properties applicable in PUT request. +func (client ServerEndpointsClient) Update(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters *ServerEndpointUpdateParameters) (result ServerEndpointsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServerEndpointsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServerEndpointsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServerEndpointsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters *ServerEndpointUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverEndpointName": autorest.Encode("path", serverEndpointName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + 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.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + 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 ServerEndpointsClient) UpdateSender(req *http.Request) (future ServerEndpointsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ServerEndpointsClient) UpdateResponder(resp *http.Response) (result ServerEndpoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/services.go b/services/storagesync/mgmt/2020-09-01/storagesync/services.go new file mode 100644 index 000000000000..87c21f6b7c27 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/services.go @@ -0,0 +1,637 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServicesClient is the microsoft Storage Sync Service API +type ServicesClient struct { + BaseClient +} + +// NewServicesClient creates an instance of the ServicesClient client. +func NewServicesClient(subscriptionID string) ServicesClient { + return NewServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServicesClientWithBaseURI creates an instance of the ServicesClient 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 NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return ServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability check the give namespace name availability. +// Parameters: +// locationName - the desired region for the name check. +// parameters - parameters to check availability of the given namespace name +func (client ServicesClient) CheckNameAvailability(ctx context.Context, locationName string, parameters CheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.CheckNameAvailability") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServicesClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, locationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ServicesClient) CheckNameAvailabilityPreparer(ctx context.Context, locationName string, parameters CheckNameAvailabilityParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "locationName": autorest.Encode("path", locationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + 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("/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ServicesClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create create a new StorageSyncService. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// parameters - storage Sync Service resource name. +func (client ServicesClient) Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, parameters ServiceCreateParameters) (result ServicesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServicesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, storageSyncServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ServicesClient) CreatePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, parameters ServiceCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) CreateSender(req *http.Request) (future ServicesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ServicesClient) CreateResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a given StorageSyncService. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +func (client ServicesClient) Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result ServicesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServicesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, storageSyncServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) DeleteSender(req *http.Request) (future ServicesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a given StorageSyncService. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result Service, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServicesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, storageSyncServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", 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 ServicesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup get a StorageSyncService list by Resource group name. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServiceArray, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListByResourceGroup") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServicesClient", "ListByResourceGroup", err.Error()) + } + + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceArray, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySubscription get a StorageSyncService list by subscription. +func (client ServicesClient) ListBySubscription(ctx context.Context) (result ServiceArray, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListBySubscription") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServicesClient", "ListBySubscription", err.Error()) + } + + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "ListBySubscription", resp, "Failure responding to request") + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ServicesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client ServicesClient) ListBySubscriptionResponder(resp *http.Response) (result ServiceArray, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update patch a given StorageSyncService. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// parameters - storage Sync Service resource. +func (client ServicesClient) Update(ctx context.Context, resourceGroupName string, storageSyncServiceName string, parameters *ServiceUpdateParameters) (result ServicesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.ServicesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, storageSyncServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.ServicesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, parameters *ServiceUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + 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.StorageSync/storageSyncServices/{storageSyncServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + 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 ServicesClient) UpdateSender(req *http.Request) (future ServicesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ServicesClient) UpdateResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/storagesyncapi/interfaces.go b/services/storagesync/mgmt/2020-09-01/storagesync/storagesyncapi/interfaces.go new file mode 100644 index 000000000000..333ca4fb15a1 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/storagesyncapi/interfaces.go @@ -0,0 +1,123 @@ +package storagesyncapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/azure-sdk-for-go/services/storagesync/mgmt/2020-09-01/storagesync" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + LocationOperationStatusMethod(ctx context.Context, locationName string, operationID string) (result storagesync.LocationOperationStatus, err error) +} + +var _ BaseClientAPI = (*storagesync.BaseClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result storagesync.OperationEntityListResultPage, err error) + ListComplete(ctx context.Context) (result storagesync.OperationEntityListResultIterator, err error) +} + +var _ OperationsClientAPI = (*storagesync.OperationsClient)(nil) + +// ServicesClientAPI contains the set of methods on the ServicesClient type. +type ServicesClientAPI interface { + CheckNameAvailability(ctx context.Context, locationName string, parameters storagesync.CheckNameAvailabilityParameters) (result storagesync.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, parameters storagesync.ServiceCreateParameters) (result storagesync.ServicesCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result storagesync.ServicesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result storagesync.Service, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result storagesync.ServiceArray, err error) + ListBySubscription(ctx context.Context) (result storagesync.ServiceArray, err error) + Update(ctx context.Context, resourceGroupName string, storageSyncServiceName string, parameters *storagesync.ServiceUpdateParameters) (result storagesync.ServicesUpdateFuture, err error) +} + +var _ ServicesClientAPI = (*storagesync.ServicesClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + ListByStorageSyncService(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result storagesync.PrivateLinkResourceListResult, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*storagesync.PrivateLinkResourcesClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string, properties storagesync.PrivateEndpointConnection) (result storagesync.PrivateEndpointConnectionsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string) (result storagesync.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string) (result storagesync.PrivateEndpointConnection, err error) + ListByStorageSyncService(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result storagesync.PrivateEndpointConnectionListResult, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*storagesync.PrivateEndpointConnectionsClient)(nil) + +// SyncGroupsClientAPI contains the set of methods on the SyncGroupsClient type. +type SyncGroupsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, parameters storagesync.SyncGroupCreateParameters) (result storagesync.SyncGroup, err error) + Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (result storagesync.SyncGroup, err error) + ListByStorageSyncService(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result storagesync.SyncGroupArray, err error) +} + +var _ SyncGroupsClientAPI = (*storagesync.SyncGroupsClient)(nil) + +// CloudEndpointsClientAPI contains the set of methods on the CloudEndpointsClient type. +type CloudEndpointsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters storagesync.CloudEndpointCreateParameters) (result storagesync.CloudEndpointsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string) (result storagesync.CloudEndpointsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string) (result storagesync.CloudEndpoint, err error) + ListBySyncGroup(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (result storagesync.CloudEndpointArray, err error) + PostBackup(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters storagesync.BackupRequest) (result storagesync.CloudEndpointsPostBackupFuture, err error) + PostRestore(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters storagesync.PostRestoreRequest) (result storagesync.CloudEndpointsPostRestoreFuture, err error) + PreBackup(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters storagesync.BackupRequest) (result storagesync.CloudEndpointsPreBackupFuture, err error) + PreRestore(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters storagesync.PreRestoreRequest) (result storagesync.CloudEndpointsPreRestoreFuture, err error) + Restoreheartbeat(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string) (result autorest.Response, err error) + TriggerChangeDetection(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters storagesync.TriggerChangeDetectionParameters) (result storagesync.CloudEndpointsTriggerChangeDetectionFuture, err error) +} + +var _ CloudEndpointsClientAPI = (*storagesync.CloudEndpointsClient)(nil) + +// ServerEndpointsClientAPI contains the set of methods on the ServerEndpointsClient type. +type ServerEndpointsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters storagesync.ServerEndpointCreateParameters) (result storagesync.ServerEndpointsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string) (result storagesync.ServerEndpointsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string) (result storagesync.ServerEndpoint, err error) + ListBySyncGroup(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (result storagesync.ServerEndpointArray, err error) + RecallAction(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters storagesync.RecallActionParameters) (result storagesync.ServerEndpointsRecallActionFuture, err error) + Update(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters *storagesync.ServerEndpointUpdateParameters) (result storagesync.ServerEndpointsUpdateFuture, err error) +} + +var _ ServerEndpointsClientAPI = (*storagesync.ServerEndpointsClient)(nil) + +// RegisteredServersClientAPI contains the set of methods on the RegisteredServersClient type. +type RegisteredServersClientAPI interface { + Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string, parameters storagesync.RegisteredServerCreateParameters) (result storagesync.RegisteredServersCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string) (result storagesync.RegisteredServersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string) (result storagesync.RegisteredServer, err error) + ListByStorageSyncService(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result storagesync.RegisteredServerArray, err error) + TriggerRollover(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string, parameters storagesync.TriggerRolloverRequest) (result storagesync.RegisteredServersTriggerRolloverFuture, err error) +} + +var _ RegisteredServersClientAPI = (*storagesync.RegisteredServersClient)(nil) + +// WorkflowsClientAPI contains the set of methods on the WorkflowsClient type. +type WorkflowsClientAPI interface { + Abort(ctx context.Context, resourceGroupName string, storageSyncServiceName string, workflowID string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, workflowID string) (result storagesync.Workflow, err error) + ListByStorageSyncService(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result storagesync.WorkflowArray, err error) +} + +var _ WorkflowsClientAPI = (*storagesync.WorkflowsClient)(nil) + +// OperationStatusClientAPI contains the set of methods on the OperationStatusClient type. +type OperationStatusClientAPI interface { + Get(ctx context.Context, resourceGroupName string, locationName string, workflowID string, operationID string) (result storagesync.OperationStatus, err error) +} + +var _ OperationStatusClientAPI = (*storagesync.OperationStatusClient)(nil) diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/syncgroups.go b/services/storagesync/mgmt/2020-09-01/storagesync/syncgroups.go new file mode 100644 index 000000000000..223844b781ca --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/syncgroups.go @@ -0,0 +1,380 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SyncGroupsClient is the microsoft Storage Sync Service API +type SyncGroupsClient struct { + BaseClient +} + +// NewSyncGroupsClient creates an instance of the SyncGroupsClient client. +func NewSyncGroupsClient(subscriptionID string) SyncGroupsClient { + return NewSyncGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSyncGroupsClientWithBaseURI creates an instance of the SyncGroupsClient 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 NewSyncGroupsClientWithBaseURI(baseURI string, subscriptionID string) SyncGroupsClient { + return SyncGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a new SyncGroup. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +// parameters - sync Group Body +func (client SyncGroupsClient) Create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, parameters SyncGroupCreateParameters) (result SyncGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.SyncGroupsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SyncGroupsClient) CreatePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, parameters SyncGroupCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SyncGroupsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SyncGroupsClient) CreateResponder(resp *http.Response) (result SyncGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a given SyncGroup. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +func (client SyncGroupsClient) Delete(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.SyncGroupsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SyncGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SyncGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SyncGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a given SyncGroup. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// syncGroupName - name of Sync Group resource. +func (client SyncGroupsClient) Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (result SyncGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.SyncGroupsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, storageSyncServiceName, syncGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SyncGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "syncGroupName": autorest.Encode("path", syncGroupName), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}", 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 SyncGroupsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SyncGroupsClient) GetResponder(resp *http.Response) (result SyncGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByStorageSyncService get a SyncGroup List. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +func (client SyncGroupsClient) ListByStorageSyncService(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result SyncGroupArray, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupsClient.ListByStorageSyncService") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.SyncGroupsClient", "ListByStorageSyncService", err.Error()) + } + + req, err := client.ListByStorageSyncServicePreparer(ctx, resourceGroupName, storageSyncServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "ListByStorageSyncService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByStorageSyncServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "ListByStorageSyncService", resp, "Failure sending request") + return + } + + result, err = client.ListByStorageSyncServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.SyncGroupsClient", "ListByStorageSyncService", resp, "Failure responding to request") + return + } + + return +} + +// ListByStorageSyncServicePreparer prepares the ListByStorageSyncService request. +func (client SyncGroupsClient) ListByStorageSyncServicePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByStorageSyncServiceSender sends the ListByStorageSyncService request. The method will close the +// http.Response Body if it receives an error. +func (client SyncGroupsClient) ListByStorageSyncServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByStorageSyncServiceResponder handles the response to the ListByStorageSyncService request. The method always +// closes the http.Response Body. +func (client SyncGroupsClient) ListByStorageSyncServiceResponder(resp *http.Response) (result SyncGroupArray, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/version.go b/services/storagesync/mgmt/2020-09-01/storagesync/version.go new file mode 100644 index 000000000000..fed37c2bfb5f --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/version.go @@ -0,0 +1,19 @@ +package storagesync + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " storagesync/2020-09-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/storagesync/mgmt/2020-09-01/storagesync/workflows.go b/services/storagesync/mgmt/2020-09-01/storagesync/workflows.go new file mode 100644 index 000000000000..4e6a01d00d18 --- /dev/null +++ b/services/storagesync/mgmt/2020-09-01/storagesync/workflows.go @@ -0,0 +1,290 @@ +package storagesync + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// WorkflowsClient is the microsoft Storage Sync Service API +type WorkflowsClient struct { + BaseClient +} + +// NewWorkflowsClient creates an instance of the WorkflowsClient client. +func NewWorkflowsClient(subscriptionID string) WorkflowsClient { + return NewWorkflowsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowsClientWithBaseURI creates an instance of the WorkflowsClient 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 NewWorkflowsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowsClient { + return WorkflowsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Abort abort the given workflow. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// workflowID - workflow Id +func (client WorkflowsClient) Abort(ctx context.Context, resourceGroupName string, storageSyncServiceName string, workflowID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.Abort") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.WorkflowsClient", "Abort", err.Error()) + } + + req, err := client.AbortPreparer(ctx, resourceGroupName, storageSyncServiceName, workflowID) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.WorkflowsClient", "Abort", nil, "Failure preparing request") + return + } + + resp, err := client.AbortSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storagesync.WorkflowsClient", "Abort", resp, "Failure sending request") + return + } + + result, err = client.AbortResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.WorkflowsClient", "Abort", resp, "Failure responding to request") + return + } + + return +} + +// AbortPreparer prepares the Abort request. +func (client WorkflowsClient) AbortPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, workflowID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowId": autorest.Encode("path", workflowID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AbortSender sends the Abort request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowsClient) AbortSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// AbortResponder handles the response to the Abort request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) AbortResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get Workflows resource +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +// workflowID - workflow Id +func (client WorkflowsClient) Get(ctx context.Context, resourceGroupName string, storageSyncServiceName string, workflowID string) (result Workflow, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.WorkflowsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, storageSyncServiceName, workflowID) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.WorkflowsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.WorkflowsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.WorkflowsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowsClient) GetPreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string, workflowID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowId": autorest.Encode("path", workflowID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}", 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 WorkflowsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) GetResponder(resp *http.Response) (result Workflow, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByStorageSyncService get a Workflow List +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// storageSyncServiceName - name of Storage Sync Service resource. +func (client WorkflowsClient) ListByStorageSyncService(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (result WorkflowArray, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkflowsClient.ListByStorageSyncService") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storagesync.WorkflowsClient", "ListByStorageSyncService", err.Error()) + } + + req, err := client.ListByStorageSyncServicePreparer(ctx, resourceGroupName, storageSyncServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.WorkflowsClient", "ListByStorageSyncService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByStorageSyncServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagesync.WorkflowsClient", "ListByStorageSyncService", resp, "Failure sending request") + return + } + + result, err = client.ListByStorageSyncServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagesync.WorkflowsClient", "ListByStorageSyncService", resp, "Failure responding to request") + return + } + + return +} + +// ListByStorageSyncServicePreparer prepares the ListByStorageSyncService request. +func (client WorkflowsClient) ListByStorageSyncServicePreparer(ctx context.Context, resourceGroupName string, storageSyncServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageSyncServiceName": autorest.Encode("path", storageSyncServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByStorageSyncServiceSender sends the ListByStorageSyncService request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowsClient) ListByStorageSyncServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByStorageSyncServiceResponder handles the response to the ListByStorageSyncService request. The method always +// closes the http.Response Body. +func (client WorkflowsClient) ListByStorageSyncServiceResponder(resp *http.Response) (result WorkflowArray, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +}