diff --git a/services/customerinsights/mgmt/2017-01-01/customerinsights/CHANGELOG.md b/services/customerinsights/mgmt/2017-01-01/customerinsights/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/customerinsights/mgmt/2017-01-01/customerinsights/CHANGELOG.md +++ b/services/customerinsights/mgmt/2017-01-01/customerinsights/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/customerinsights/mgmt/2017-01-01/customerinsights/_meta.json b/services/customerinsights/mgmt/2017-01-01/customerinsights/_meta.json index 66214781b1d7..e9b1659be0fe 100644 --- a/services/customerinsights/mgmt/2017-01-01/customerinsights/_meta.json +++ b/services/customerinsights/mgmt/2017-01-01/customerinsights/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/customer-insights/resource-manager/readme.md", "tag": "package-2017-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/customerinsights/mgmt/2017-04-26/customerinsights/CHANGELOG.md b/services/customerinsights/mgmt/2017-04-26/customerinsights/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/customerinsights/mgmt/2017-04-26/customerinsights/CHANGELOG.md +++ b/services/customerinsights/mgmt/2017-04-26/customerinsights/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/customerinsights/mgmt/2017-04-26/customerinsights/_meta.json b/services/customerinsights/mgmt/2017-04-26/customerinsights/_meta.json index 20cf5d474573..8bbf072ee618 100644 --- a/services/customerinsights/mgmt/2017-04-26/customerinsights/_meta.json +++ b/services/customerinsights/mgmt/2017-04-26/customerinsights/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/customer-insights/resource-manager/readme.md", "tag": "package-2017-04", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/datamigration/mgmt/2018-04-19/datamigration/CHANGELOG.md b/services/datamigration/mgmt/2018-04-19/datamigration/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/datamigration/mgmt/2018-04-19/datamigration/CHANGELOG.md +++ b/services/datamigration/mgmt/2018-04-19/datamigration/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/datamigration/mgmt/2018-04-19/datamigration/_meta.json b/services/datamigration/mgmt/2018-04-19/datamigration/_meta.json index 4c7c423f5d09..6a81d8605e77 100644 --- a/services/datamigration/mgmt/2018-04-19/datamigration/_meta.json +++ b/services/datamigration/mgmt/2018-04-19/datamigration/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/datamigration/resource-manager/readme.md", "tag": "package-2018-04-19", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/CHANGELOG.md b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/CHANGELOG.md index 52911e4cc5e4..e4883e46635b 100644 --- a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/CHANGELOG.md +++ b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/CHANGELOG.md @@ -1,2 +1,34 @@ -# Change History +# Unreleased +## Breaking Changes + +### Struct Changes + +#### Removed Struct Fields + +1. DelegatedSubnet.Properties + +### Signature Changes + +#### Funcs + +1. OrchestratorInstanceServiceClient.Delete + - Params + - From: context.Context, string, string + - To: context.Context, string, string, *bool +1. OrchestratorInstanceServiceClient.DeletePreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, *bool + +## Additive Changes + +### New Funcs + +1. *DelegatedSubnet.UnmarshalJSON([]byte) error + +### Struct Changes + +#### New Struct Fields + +1. DelegatedSubnet.*DelegatedSubnetProperties diff --git a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/_meta.json b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/_meta.json index 9cf95b971dfa..436d7775d2d7 100644 --- a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/_meta.json +++ b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/_meta.json @@ -1,5 +1,5 @@ { - "commit": "394395ed0bdc1c5c05cb37a031379ca03bfebbb5", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/dnc/resource-manager/readme.md", "tag": "package-2021-03-15", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/controller.go b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/controller.go index ba9d16ab0aec..f447aaeb21c3 100644 --- a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/controller.go +++ b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/controller.go @@ -50,8 +50,7 @@ func (client ControllerClient) Create(ctx context.Context, resourceGroupName str 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -146,8 +145,7 @@ func (client ControllerClient) Delete(ctx context.Context, resourceGroupName str 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -238,8 +236,7 @@ func (client ControllerClient) GetDetails(ctx context.Context, resourceGroupName 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -329,8 +326,7 @@ func (client ControllerClient) Patch(ctx context.Context, resourceGroupName stri 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatednetwork.go b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatednetwork.go index c91752cb58bf..8705868a105f 100644 --- a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatednetwork.go +++ b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatednetwork.go @@ -48,8 +48,7 @@ func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName 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("delegatednetwork.Client", "ListByResourceGroup", err.Error()) diff --git a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatednetworkapi/interfaces.go b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatednetworkapi/interfaces.go index 096985ef944d..215ee02e00e4 100644 --- a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatednetworkapi/interfaces.go +++ b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatednetworkapi/interfaces.go @@ -34,7 +34,7 @@ var _ ClientAPI = (*delegatednetwork.Client)(nil) // OrchestratorInstanceServiceClientAPI contains the set of methods on the OrchestratorInstanceServiceClient type. type OrchestratorInstanceServiceClientAPI interface { Create(ctx context.Context, resourceGroupName string, resourceName string, parameters delegatednetwork.Orchestrator) (result delegatednetwork.OrchestratorInstanceServiceCreateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, resourceName string) (result delegatednetwork.OrchestratorInstanceServiceDeleteFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, forceDelete *bool) (result delegatednetwork.OrchestratorInstanceServiceDeleteFuture, err error) GetDetails(ctx context.Context, resourceGroupName string, resourceName string) (result delegatednetwork.Orchestrator, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result delegatednetwork.OrchestratorsPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result delegatednetwork.OrchestratorsIterator, err error) diff --git a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatedsubnetservice.go b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatedsubnetservice.go index 8d11a4962d28..4d4f957753ba 100644 --- a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatedsubnetservice.go +++ b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/delegatedsubnetservice.go @@ -51,8 +51,7 @@ func (client DelegatedSubnetServiceClient) DeleteDetails(ctx context.Context, re 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -146,8 +145,7 @@ func (client DelegatedSubnetServiceClient) GetDetails(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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -235,8 +233,7 @@ func (client DelegatedSubnetServiceClient) ListByResourceGroup(ctx context.Conte 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("delegatednetwork.DelegatedSubnetServiceClient", "ListByResourceGroup", err.Error()) @@ -482,8 +479,7 @@ func (client DelegatedSubnetServiceClient) PatchDetails(ctx context.Context, res 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -578,8 +574,7 @@ func (client DelegatedSubnetServiceClient) PutDetails(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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/models.go b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/models.go index 73345eb45088..19cb5f7c620b 100644 --- a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/models.go +++ b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/models.go @@ -366,8 +366,8 @@ func NewDelegatedControllersPage(cur DelegatedControllers, getNextPage func(cont // DelegatedSubnet represents an instance of a orchestrator. type DelegatedSubnet struct { autorest.Response `json:"-"` - // Properties - Properties of the provision operation request. - Properties *DelegatedSubnetProperties `json:"properties,omitempty"` + // DelegatedSubnetProperties - Properties of the provision operation request. + *DelegatedSubnetProperties `json:"properties,omitempty"` // ID - READ-ONLY; An identifier that represents the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource. @@ -383,8 +383,8 @@ type DelegatedSubnet struct { // MarshalJSON is the custom marshaler for DelegatedSubnet. func (ds DelegatedSubnet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ds.Properties != nil { - objectMap["properties"] = ds.Properties + if ds.DelegatedSubnetProperties != nil { + objectMap["properties"] = ds.DelegatedSubnetProperties } if ds.Location != nil { objectMap["location"] = ds.Location @@ -395,6 +395,75 @@ func (ds DelegatedSubnet) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON is the custom unmarshaler for DelegatedSubnet struct. +func (ds *DelegatedSubnet) 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 delegatedSubnetProperties DelegatedSubnetProperties + err = json.Unmarshal(*v, &delegatedSubnetProperties) + if err != nil { + return err + } + ds.DelegatedSubnetProperties = &delegatedSubnetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ds.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ds.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ds.Tags = tags + } + } + } + + return nil +} + // DelegatedSubnetProperties properties of delegated subnet type DelegatedSubnetProperties struct { // ResourceGUID - READ-ONLY; Resource guid. diff --git a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/orchestratorinstanceservice.go b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/orchestratorinstanceservice.go index 2b45c740e5b2..8b336b320a34 100644 --- a/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/orchestratorinstanceservice.go +++ b/services/delegatednetwork/mgmt/2021-03-15/delegatednetwork/orchestratorinstanceservice.go @@ -51,8 +51,7 @@ func (client OrchestratorInstanceServiceClient) Create(ctx context.Context, reso 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -135,7 +134,8 @@ func (client OrchestratorInstanceServiceClient) CreateResponder(resp *http.Respo // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. -func (client OrchestratorInstanceServiceClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result OrchestratorInstanceServiceDeleteFuture, err error) { +// forceDelete - force delete resource +func (client OrchestratorInstanceServiceClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, forceDelete *bool) (result OrchestratorInstanceServiceDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OrchestratorInstanceServiceClient.Delete") defer func() { @@ -149,8 +149,7 @@ func (client OrchestratorInstanceServiceClient) Delete(ctx context.Context, reso 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -160,7 +159,7 @@ func (client OrchestratorInstanceServiceClient) Delete(ctx context.Context, reso return result, validation.NewError("delegatednetwork.OrchestratorInstanceServiceClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, forceDelete) if err != nil { err = autorest.NewErrorWithError(err, "delegatednetwork.OrchestratorInstanceServiceClient", "Delete", nil, "Failure preparing request") return @@ -176,7 +175,7 @@ func (client OrchestratorInstanceServiceClient) Delete(ctx context.Context, reso } // DeletePreparer prepares the Delete request. -func (client OrchestratorInstanceServiceClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { +func (client OrchestratorInstanceServiceClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, forceDelete *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceName": autorest.Encode("path", resourceName), @@ -187,6 +186,9 @@ func (client OrchestratorInstanceServiceClient) DeletePreparer(ctx context.Conte queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if forceDelete != nil { + queryParameters["forceDelete"] = autorest.Encode("query", *forceDelete) + } preparer := autorest.CreatePreparer( autorest.AsDelete(), @@ -241,8 +243,7 @@ func (client OrchestratorInstanceServiceClient) GetDetails(ctx context.Context, 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, @@ -330,8 +331,7 @@ func (client OrchestratorInstanceServiceClient) ListByResourceGroup(ctx context. 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("delegatednetwork.OrchestratorInstanceServiceClient", "ListByResourceGroup", err.Error()) @@ -577,8 +577,7 @@ func (client OrchestratorInstanceServiceClient) Patch(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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, diff --git a/services/migrate/mgmt/2018-02-02/migrate/CHANGELOG.md b/services/migrate/mgmt/2018-02-02/migrate/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/migrate/mgmt/2018-02-02/migrate/CHANGELOG.md +++ b/services/migrate/mgmt/2018-02-02/migrate/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/migrate/mgmt/2018-02-02/migrate/_meta.json b/services/migrate/mgmt/2018-02-02/migrate/_meta.json index 0cee8aba3a72..1badbbd89ecf 100644 --- a/services/migrate/mgmt/2018-02-02/migrate/_meta.json +++ b/services/migrate/mgmt/2018-02-02/migrate/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/migrate/resource-manager/readme.md", "tag": "package-2018-02", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/migrate/mgmt/2020-01-01/migrate/CHANGELOG.md b/services/migrate/mgmt/2020-01-01/migrate/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/migrate/mgmt/2020-01-01/migrate/CHANGELOG.md +++ b/services/migrate/mgmt/2020-01-01/migrate/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/migrate/mgmt/2020-01-01/migrate/_meta.json b/services/migrate/mgmt/2020-01-01/migrate/_meta.json index fb374b4bbfda..1db633c8bb0c 100644 --- a/services/migrate/mgmt/2020-01-01/migrate/_meta.json +++ b/services/migrate/mgmt/2020-01-01/migrate/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/migrate/resource-manager/readme.md", "tag": "package-2020-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/migrate/mgmt/2020-05-01/migrate/CHANGELOG.md b/services/migrate/mgmt/2020-05-01/migrate/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/migrate/mgmt/2020-05-01/migrate/_meta.json b/services/migrate/mgmt/2020-05-01/migrate/_meta.json new file mode 100644 index 000000000000..43295d176ab1 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", + "readme": "/_/azure-rest-api-specs/specification/migrate/resource-manager/readme.md", + "tag": "package-2020-05", + "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-05 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/migrate/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/migrate/mgmt/2020-05-01/migrate/client.go b/services/migrate/mgmt/2020-05-01/migrate/client.go new file mode 100644 index 000000000000..57ad66482df0 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/client.go @@ -0,0 +1,41 @@ +// Package migrate implements the Azure ARM Migrate service API version 2020-05-01. +// +// +package migrate + +// 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 ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Migrate + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Migrate. +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, + } +} diff --git a/services/migrate/mgmt/2020-05-01/migrate/enums.go b/services/migrate/mgmt/2020-05-01/migrate/enums.go new file mode 100644 index 000000000000..afd97588bc40 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/enums.go @@ -0,0 +1,176 @@ +package migrate + +// 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. + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // Application ... + Application CreatedByType = "Application" + // Key ... + Key CreatedByType = "Key" + // ManagedIdentity ... + ManagedIdentity CreatedByType = "ManagedIdentity" + // User ... + User CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{Application, Key, ManagedIdentity, User} +} + +// Items enumerates the values for items. +type Items string + +const ( + // AppServiceMigrationAssistant ... + AppServiceMigrationAssistant Items = "AppServiceMigrationAssistant" + // Carbonite ... + Carbonite Items = "Carbonite" + // Cloudamize ... + Cloudamize Items = "Cloudamize" + // CloudSphere ... + CloudSphere Items = "CloudSphere" + // CorentTech ... + CorentTech Items = "CorentTech" + // DatabaseMigrationService ... + DatabaseMigrationService Items = "DatabaseMigrationService" + // DataMigrationAssistant ... + DataMigrationAssistant Items = "DataMigrationAssistant" + // Device42 ... + Device42 Items = "Device42" + // Flexera ... + Flexera Items = "Flexera" + // JetStream ... + JetStream Items = "JetStream" + // Lakeside ... + Lakeside Items = "Lakeside" + // Movere ... + Movere Items = "Movere" + // RackWare ... + RackWare Items = "RackWare" + // ServerAssessment ... + ServerAssessment Items = "ServerAssessment" + // ServerAssessmentV1 ... + ServerAssessmentV1 Items = "ServerAssessmentV1" + // ServerDiscovery ... + ServerDiscovery Items = "ServerDiscovery" + // ServerDiscoveryImport ... + ServerDiscoveryImport Items = "ServerDiscovery_Import" + // ServerMigration ... + ServerMigration Items = "ServerMigration" + // ServerMigrationReplication ... + ServerMigrationReplication Items = "ServerMigration_Replication" + // Turbonomic ... + Turbonomic Items = "Turbonomic" + // UnifyCloud ... + UnifyCloud Items = "UnifyCloud" + // Unknown ... + Unknown Items = "Unknown" + // Zerto ... + Zerto Items = "Zerto" +) + +// PossibleItemsValues returns an array of possible values for the Items const type. +func PossibleItemsValues() []Items { + return []Items{AppServiceMigrationAssistant, Carbonite, Cloudamize, CloudSphere, CorentTech, DatabaseMigrationService, DataMigrationAssistant, Device42, Flexera, JetStream, Lakeside, Movere, RackWare, ServerAssessment, ServerAssessmentV1, ServerDiscovery, ServerDiscoveryImport, ServerMigration, ServerMigrationReplication, Turbonomic, UnifyCloud, Unknown, Zerto} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Accepted ... + Accepted ProvisioningState = "Accepted" + // Failed ... + Failed ProvisioningState = "Failed" + // InProgress ... + InProgress ProvisioningState = "InProgress" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Accepted, Failed, InProgress, Succeeded} +} + +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // Disabled ... + Disabled PublicNetworkAccess = "Disabled" + // Enabled ... + Enabled PublicNetworkAccess = "Enabled" + // NotSpecified ... + NotSpecified PublicNetworkAccess = "NotSpecified" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{Disabled, Enabled, NotSpecified} +} + +// RefreshSummaryState enumerates the values for refresh summary state. +type RefreshSummaryState string + +const ( + // RefreshSummaryStateCompleted ... + RefreshSummaryStateCompleted RefreshSummaryState = "Completed" + // RefreshSummaryStateFailed ... + RefreshSummaryStateFailed RefreshSummaryState = "Failed" + // RefreshSummaryStateInProgress ... + RefreshSummaryStateInProgress RefreshSummaryState = "InProgress" + // RefreshSummaryStateStarted ... + RefreshSummaryStateStarted RefreshSummaryState = "Started" +) + +// PossibleRefreshSummaryStateValues returns an array of possible values for the RefreshSummaryState const type. +func PossibleRefreshSummaryStateValues() []RefreshSummaryState { + return []RefreshSummaryState{RefreshSummaryStateCompleted, RefreshSummaryStateFailed, RefreshSummaryStateInProgress, RefreshSummaryStateStarted} +} + +// RefreshSummaryState1 enumerates the values for refresh summary state 1. +type RefreshSummaryState1 string + +const ( + // RefreshSummaryState1Completed ... + RefreshSummaryState1Completed RefreshSummaryState1 = "Completed" + // RefreshSummaryState1Failed ... + RefreshSummaryState1Failed RefreshSummaryState1 = "Failed" + // RefreshSummaryState1InProgress ... + RefreshSummaryState1InProgress RefreshSummaryState1 = "InProgress" + // RefreshSummaryState1Started ... + RefreshSummaryState1Started RefreshSummaryState1 = "Started" +) + +// PossibleRefreshSummaryState1Values returns an array of possible values for the RefreshSummaryState1 const type. +func PossibleRefreshSummaryState1Values() []RefreshSummaryState1 { + return []RefreshSummaryState1{RefreshSummaryState1Completed, RefreshSummaryState1Failed, RefreshSummaryState1InProgress, RefreshSummaryState1Started} +} + +// Status enumerates the values for status. +type Status string + +const ( + // Approved ... + Approved Status = "Approved" + // Disconnected ... + Disconnected Status = "Disconnected" + // Pending ... + Pending Status = "Pending" + // Rejected ... + Rejected Status = "Rejected" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{Approved, Disconnected, Pending, Rejected} +} diff --git a/services/migrate/mgmt/2020-05-01/migrate/migrateapi/interfaces.go b/services/migrate/mgmt/2020-05-01/migrate/migrateapi/interfaces.go new file mode 100644 index 000000000000..b7db6d80c134 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/migrateapi/interfaces.go @@ -0,0 +1,64 @@ +package migrateapi + +// 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/migrate/mgmt/2020-05-01/migrate" + "github.com/Azure/go-autorest/autorest" +) + +// ProjectsControllerClientAPI contains the set of methods on the ProjectsControllerClient type. +type ProjectsControllerClientAPI interface { + DeleteMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (result autorest.Response, err error) + GetMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (result migrate.Project, err error) + PatchMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string, body migrate.Project, APIVersion string) (result migrate.Project, err error) + PutMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string, body migrate.Project, APIVersion string) (result migrate.Project, err error) +} + +var _ ProjectsControllerClientAPI = (*migrate.ProjectsControllerClient)(nil) + +// PrivateEndpointConnectionsControllerClientAPI contains the set of methods on the PrivateEndpointConnectionsControllerClient type. +type PrivateEndpointConnectionsControllerClientAPI interface { + GetPrivateEndpointConnections(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (result migrate.PrivateEndpointConnectionCollection, err error) +} + +var _ PrivateEndpointConnectionsControllerClientAPI = (*migrate.PrivateEndpointConnectionsControllerClient)(nil) + +// PrivateEndpointConnectionControllerClientAPI contains the set of methods on the PrivateEndpointConnectionControllerClient type. +type PrivateEndpointConnectionControllerClientAPI interface { + DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, migrateProjectName string, peConnectionName string, APIVersion string) (result autorest.Response, err error) + GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, migrateProjectName string, peConnectionName string, APIVersion string) (result migrate.PrivateEndpointConnection, err error) + PutPrivateEndpointConnection(ctx context.Context, resourceGroupName string, migrateProjectName string, peConnectionName string, APIVersion string, body migrate.ModifyConnectionStateBody) (result migrate.PrivateEndpointConnection, err error) +} + +var _ PrivateEndpointConnectionControllerClientAPI = (*migrate.PrivateEndpointConnectionControllerClient)(nil) + +// PrivateLinkResourceControllerClientAPI contains the set of methods on the PrivateLinkResourceControllerClient type. +type PrivateLinkResourceControllerClientAPI interface { + GetPrivateLinkResource(ctx context.Context, resourceGroupName string, migrateProjectName string, privateLinkResourceName string, APIVersion string) (result migrate.PrivateLinkResource, err error) + GetPrivateLinkResources(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (result migrate.PrivateLinkResourceCollection, err error) +} + +var _ PrivateLinkResourceControllerClientAPI = (*migrate.PrivateLinkResourceControllerClient)(nil) + +// ProjectsClientAPI contains the set of methods on the ProjectsClient type. +type ProjectsClientAPI interface { + List(ctx context.Context, resourceGroupName string, APIVersion string) (result migrate.ProjectResultListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, APIVersion string) (result migrate.ProjectResultListIterator, err error) + ListBySubscription(ctx context.Context, APIVersion string) (result migrate.ProjectResultListPage, err error) + ListBySubscriptionComplete(ctx context.Context, APIVersion string) (result migrate.ProjectResultListIterator, err error) +} + +var _ ProjectsClientAPI = (*migrate.ProjectsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result migrate.AvailableOperations, err error) +} + +var _ OperationsClientAPI = (*migrate.OperationsClient)(nil) diff --git a/services/migrate/mgmt/2020-05-01/migrate/models.go b/services/migrate/mgmt/2020-05-01/migrate/models.go new file mode 100644 index 000000000000..b250f8c57825 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/models.go @@ -0,0 +1,475 @@ +package migrate + +// 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/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/migrate/mgmt/2020-05-01/migrate" + +// AvailableOperations available operations of the service +type AvailableOperations struct { + autorest.Response `json:"-"` + // Value - Collection of available operation details + Value *[]OperationDetail `json:"value,omitempty"` + // NextLink - URL client should use to fetch the next page (per server side paging). + // It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` +} + +// CloudError an error response from the Azure Migrate service. +type CloudError struct { + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Azure Migrate service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// ConnectionStateRequestBodyProperties properties of Connection state request. +type ConnectionStateRequestBodyProperties struct { + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// ModifyConnectionStateBody modify connection state body. +type ModifyConnectionStateBody struct { + // ETag - Gets the tag for optimistic concurrency control. + ETag *string `json:"eTag,omitempty"` + Properties *ConnectionStateRequestBodyProperties `json:"properties,omitempty"` +} + +// OperationDetail operation detail payload +type OperationDetail struct { + // Name - Name of the operation + Name *string `json:"name,omitempty"` + // IsDataAction - Indicates whether the operation is a data action + IsDataAction *bool `json:"isDataAction,omitempty"` + // Display - Display of the operation + Display *OperationDisplay `json:"display,omitempty"` + // Origin - Origin of the operation + Origin *string `json:"origin,omitempty"` +} + +// OperationDisplay operation display payload +type OperationDisplay struct { + // Provider - Resource provider of the operation + Provider *string `json:"provider,omitempty"` + // Resource - Resource of the operation + Resource *string `json:"resource,omitempty"` + // Operation - Localized friendly name for the operation + Operation *string `json:"operation,omitempty"` + // Description - Localized friendly description for the operation + Description *string `json:"description,omitempty"` +} + +// PrivateEndpointConnection REST model used to encapsulate the user visible state of a PrivateEndpoint. +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Relative URL to get this Sites. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the resource type. + Type *string `json:"type,omitempty"` + // ETag - READ-ONLY; Gets the tag for optimistic concurrency control. + ETag *string `json:"eTag,omitempty"` + // Properties - READ-ONLY; Gets the properties of the object. + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateEndpointConnectionCollection collection of PrivateLink resources. +type PrivateEndpointConnectionCollection struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Gets the list of machines. + Value *[]PrivateEndpointConnection `json:"value,omitempty"` + // NextLink - READ-ONLY; Gets the value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionCollection. +func (pecc PrivateEndpointConnectionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateEndpointConnectionProperties properties of a private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state. Possible values include: 'Accepted', 'InProgress', 'Succeeded', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // PrivateEndpoint - READ-ONLY + PrivateEndpoint *ResourceID `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Gets the properties of the object. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. +func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecp.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState + } + return json.Marshal(objectMap) +} + +// PrivateLinkResource private link resource. +type PrivateLinkResource struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Relative URL to get this Sites. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Gets the resource type. + Type *string `json:"type,omitempty"` + // Properties - READ-ONLY + Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateLinkResourceCollection collection of private link resources. +type PrivateLinkResourceCollection struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of private links. + Value *[]PrivateLinkResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceCollection. +func (plrc PrivateLinkResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateLinkResourceProperties properties of private link resource. +type PrivateLinkResourceProperties struct { + // RequiredMembers - Required members. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - Required zone names. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` + // GroupID - Group id. + GroupID *string `json:"groupId,omitempty"` +} + +// PrivateLinkServiceConnectionState private endpoint connection state. +type PrivateLinkServiceConnectionState struct { + // Status - Private link connection state. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected' + Status Status `json:"status,omitempty"` + // Description - Description of the object. + Description *string `json:"description,omitempty"` + // ActionsRequired - Action required. + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// Project migrate project. +type Project struct { + autorest.Response `json:"-"` + Properties *ProjectProperties `json:"properties,omitempty"` + // ETag - For optimistic concurrency control. + ETag *string `json:"eTag,omitempty"` + // Location - Azure location in which project is created. + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Path reference to this project /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{projectName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the project. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the object = [Microsoft.Migrate/migrateProjects]. + Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for Project. +func (p Project) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Properties != nil { + objectMap["properties"] = p.Properties + } + if p.ETag != nil { + objectMap["eTag"] = p.ETag + } + if p.Location != nil { + objectMap["location"] = p.Location + } + return json.Marshal(objectMap) +} + +// ProjectProperties properties of a migrate project. +type ProjectProperties struct { + // RegisteredTools - READ-ONLY; Register tools inside project. + RegisteredTools *[]Items `json:"registeredTools,omitempty"` + // ServiceEndpoint - Service endpoint. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + // Summary - READ-ONLY; Project summary. + Summary map[string]*ProjectSummary `json:"summary"` + // LastSummaryRefreshedTime - READ-ONLY; Last summary refresh time. + LastSummaryRefreshedTime *date.Time `json:"lastSummaryRefreshedTime,omitempty"` + // RefreshSummaryState - READ-ONLY; Refresh summary state. Possible values include: 'RefreshSummaryStateStarted', 'RefreshSummaryStateInProgress', 'RefreshSummaryStateCompleted', 'RefreshSummaryStateFailed' + RefreshSummaryState RefreshSummaryState `json:"refreshSummaryState,omitempty"` + // UtilityStorageAccountID - Utility storage account id. + UtilityStorageAccountID *string `json:"utilityStorageAccountId,omitempty"` + // PublicNetworkAccess - Gets or sets the state of public network access. Possible values include: 'NotSpecified', 'Enabled', 'Disabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // PrivateEndpointConnections - READ-ONLY; Gets the private endpoint connections. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProjectProperties. +func (pp ProjectProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pp.ServiceEndpoint != nil { + objectMap["serviceEndpoint"] = pp.ServiceEndpoint + } + if pp.UtilityStorageAccountID != nil { + objectMap["utilityStorageAccountId"] = pp.UtilityStorageAccountID + } + if pp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = pp.PublicNetworkAccess + } + return json.Marshal(objectMap) +} + +// ProjectResultList list of projects. +type ProjectResultList struct { + autorest.Response `json:"-"` + // Value - List of projects. + Value *[]Project `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// ProjectResultListIterator provides access to a complete listing of Project values. +type ProjectResultListIterator struct { + i int + page ProjectResultListPage +} + +// 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 *ProjectResultListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProjectResultListIterator.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 *ProjectResultListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProjectResultListIterator) 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 ProjectResultListIterator) Response() ProjectResultList { + 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 ProjectResultListIterator) Value() Project { + if !iter.page.NotDone() { + return Project{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProjectResultListIterator type. +func NewProjectResultListIterator(page ProjectResultListPage) ProjectResultListIterator { + return ProjectResultListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (prl ProjectResultList) IsEmpty() bool { + return prl.Value == nil || len(*prl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (prl ProjectResultList) hasNextLink() bool { + return prl.NextLink != nil && len(*prl.NextLink) != 0 +} + +// projectResultListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (prl ProjectResultList) projectResultListPreparer(ctx context.Context) (*http.Request, error) { + if !prl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(prl.NextLink))) +} + +// ProjectResultListPage contains a page of Project values. +type ProjectResultListPage struct { + fn func(context.Context, ProjectResultList) (ProjectResultList, error) + prl ProjectResultList +} + +// 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 *ProjectResultListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProjectResultListPage.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.prl) + if err != nil { + return err + } + page.prl = 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 *ProjectResultListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProjectResultListPage) NotDone() bool { + return !page.prl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProjectResultListPage) Response() ProjectResultList { + return page.prl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProjectResultListPage) Values() []Project { + if page.prl.IsEmpty() { + return nil + } + return *page.prl.Value +} + +// Creates a new instance of the ProjectResultListPage type. +func NewProjectResultListPage(cur ProjectResultList, getNextPage func(context.Context, ProjectResultList) (ProjectResultList, error)) ProjectResultListPage { + return ProjectResultListPage{ + fn: getNextPage, + prl: cur, + } +} + +// ProjectSummary project summary. +type ProjectSummary struct { + // InstanceType - READ-ONLY; Instance type. + InstanceType *string `json:"instanceType,omitempty"` + // RefreshSummaryState - Refresh summary state. Possible values include: 'RefreshSummaryState1Started', 'RefreshSummaryState1InProgress', 'RefreshSummaryState1Completed', 'RefreshSummaryState1Failed' + RefreshSummaryState RefreshSummaryState1 `json:"refreshSummaryState,omitempty"` + // LastSummaryRefreshedTime - Last summary refresh time. + LastSummaryRefreshedTime *date.Time `json:"lastSummaryRefreshedTime,omitempty"` + // ExtendedSummary - Extended summary. + ExtendedSummary map[string]*string `json:"extendedSummary"` +} + +// MarshalJSON is the custom marshaler for ProjectSummary. +func (ps ProjectSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.RefreshSummaryState != "" { + objectMap["refreshSummaryState"] = ps.RefreshSummaryState + } + if ps.LastSummaryRefreshedTime != nil { + objectMap["lastSummaryRefreshedTime"] = ps.LastSummaryRefreshedTime + } + if ps.ExtendedSummary != nil { + objectMap["extendedSummary"] = ps.ExtendedSummary + } + return json.Marshal(objectMap) +} + +// ResourceID ... +type ResourceID struct { + // ID - READ-ONLY + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceID. +func (ri ResourceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The type of identity that last modified the resource. + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} diff --git a/services/migrate/mgmt/2020-05-01/migrate/operations.go b/services/migrate/mgmt/2020-05-01/migrate/operations.go new file mode 100644 index 000000000000..db3a6dca02a7 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/operations.go @@ -0,0 +1,92 @@ +package migrate + +// 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 client for the Operations methods of the Migrate service. +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 get a list of REST API supported by Microsoft.Migrate provider. +func (client OperationsClient) List(ctx context.Context) (result AvailableOperations, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.OperationsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Migrate/operations")) + 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 AvailableOperations, 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/migrate/mgmt/2020-05-01/migrate/privateendpointconnectioncontroller.go b/services/migrate/mgmt/2020-05-01/migrate/privateendpointconnectioncontroller.go new file mode 100644 index 000000000000..407457497ffb --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/privateendpointconnectioncontroller.go @@ -0,0 +1,272 @@ +package migrate + +// 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" +) + +// PrivateEndpointConnectionControllerClient is the client for the PrivateEndpointConnectionController methods of the +// Migrate service. +type PrivateEndpointConnectionControllerClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionControllerClient creates an instance of the PrivateEndpointConnectionControllerClient +// client. +func NewPrivateEndpointConnectionControllerClient(subscriptionID string) PrivateEndpointConnectionControllerClient { + return NewPrivateEndpointConnectionControllerClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionControllerClientWithBaseURI creates an instance of the +// PrivateEndpointConnectionControllerClient 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 NewPrivateEndpointConnectionControllerClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionControllerClient { + return PrivateEndpointConnectionControllerClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// DeletePrivateEndpointConnection delete the private endpoint. Deleting non-existent private endpoint is a +// no-operation. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// migrateProjectName - migrate project name. +// peConnectionName - private endpoint connection name. +// APIVersion - the API version to use for this operation. +func (client PrivateEndpointConnectionControllerClient) DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, migrateProjectName string, peConnectionName string, APIVersion string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionControllerClient.DeletePrivateEndpointConnection") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePrivateEndpointConnectionPreparer(ctx, resourceGroupName, migrateProjectName, peConnectionName, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionControllerClient", "DeletePrivateEndpointConnection", nil, "Failure preparing request") + return + } + + resp, err := client.DeletePrivateEndpointConnectionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionControllerClient", "DeletePrivateEndpointConnection", resp, "Failure sending request") + return + } + + result, err = client.DeletePrivateEndpointConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionControllerClient", "DeletePrivateEndpointConnection", resp, "Failure responding to request") + return + } + + return +} + +// DeletePrivateEndpointConnectionPreparer prepares the DeletePrivateEndpointConnection request. +func (client PrivateEndpointConnectionControllerClient) DeletePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, peConnectionName string, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "migrateProjectName": autorest.Encode("path", migrateProjectName), + "peConnectionName": autorest.Encode("path", peConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/privateEndpointConnections/{peConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePrivateEndpointConnectionSender sends the DeletePrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionControllerClient) DeletePrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeletePrivateEndpointConnectionResponder handles the response to the DeletePrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionControllerClient) DeletePrivateEndpointConnectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetPrivateEndpointConnection get the private endpoint with the specified name. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// migrateProjectName - migrate project name. +// peConnectionName - private endpoint connection name. +// APIVersion - the API version to use for this operation. +func (client PrivateEndpointConnectionControllerClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, migrateProjectName string, peConnectionName string, APIVersion string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionControllerClient.GetPrivateEndpointConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPrivateEndpointConnectionPreparer(ctx, resourceGroupName, migrateProjectName, peConnectionName, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionControllerClient", "GetPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionControllerClient", "GetPrivateEndpointConnection", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateEndpointConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionControllerClient", "GetPrivateEndpointConnection", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateEndpointConnectionPreparer prepares the GetPrivateEndpointConnection request. +func (client PrivateEndpointConnectionControllerClient) GetPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, peConnectionName string, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "migrateProjectName": autorest.Encode("path", migrateProjectName), + "peConnectionName": autorest.Encode("path", peConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/privateEndpointConnections/{peConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionSender sends the GetPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionControllerClient) GetPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionResponder handles the response to the GetPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionControllerClient) GetPrivateEndpointConnectionResponder(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 +} + +// PutPrivateEndpointConnection create a private endpoint with specified name. If a private endpoint already exists, +// update it. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// migrateProjectName - migrate project name. +// peConnectionName - private endpoint connection name. +// APIVersion - the API version to use for this operation. +// body - modify connection state body. +func (client PrivateEndpointConnectionControllerClient) PutPrivateEndpointConnection(ctx context.Context, resourceGroupName string, migrateProjectName string, peConnectionName string, APIVersion string, body ModifyConnectionStateBody) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionControllerClient.PutPrivateEndpointConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PutPrivateEndpointConnectionPreparer(ctx, resourceGroupName, migrateProjectName, peConnectionName, APIVersion, body) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionControllerClient", "PutPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + resp, err := client.PutPrivateEndpointConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionControllerClient", "PutPrivateEndpointConnection", resp, "Failure sending request") + return + } + + result, err = client.PutPrivateEndpointConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionControllerClient", "PutPrivateEndpointConnection", resp, "Failure responding to request") + return + } + + return +} + +// PutPrivateEndpointConnectionPreparer prepares the PutPrivateEndpointConnection request. +func (client PrivateEndpointConnectionControllerClient) PutPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, peConnectionName string, APIVersion string, body ModifyConnectionStateBody) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "migrateProjectName": autorest.Encode("path", migrateProjectName), + "peConnectionName": autorest.Encode("path", peConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + 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.Migrate/migrateProjects/{migrateProjectName}/privateEndpointConnections/{peConnectionName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutPrivateEndpointConnectionSender sends the PutPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionControllerClient) PutPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PutPrivateEndpointConnectionResponder handles the response to the PutPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionControllerClient) PutPrivateEndpointConnectionResponder(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 +} diff --git a/services/migrate/mgmt/2020-05-01/migrate/privateendpointconnectionscontroller.go b/services/migrate/mgmt/2020-05-01/migrate/privateendpointconnectionscontroller.go new file mode 100644 index 000000000000..d45c0d7f14a2 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/privateendpointconnectionscontroller.go @@ -0,0 +1,110 @@ +package migrate + +// 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" +) + +// PrivateEndpointConnectionsControllerClient is the client for the PrivateEndpointConnectionsController methods of the +// Migrate service. +type PrivateEndpointConnectionsControllerClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsControllerClient creates an instance of the PrivateEndpointConnectionsControllerClient +// client. +func NewPrivateEndpointConnectionsControllerClient(subscriptionID string) PrivateEndpointConnectionsControllerClient { + return NewPrivateEndpointConnectionsControllerClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsControllerClientWithBaseURI creates an instance of the +// PrivateEndpointConnectionsControllerClient 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 NewPrivateEndpointConnectionsControllerClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsControllerClient { + return PrivateEndpointConnectionsControllerClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetPrivateEndpointConnections get all the private endpoint connections under a migrate project. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// migrateProjectName - migrate project name. +// APIVersion - the API version to use for this operation. +func (client PrivateEndpointConnectionsControllerClient) GetPrivateEndpointConnections(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (result PrivateEndpointConnectionCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsControllerClient.GetPrivateEndpointConnections") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPrivateEndpointConnectionsPreparer(ctx, resourceGroupName, migrateProjectName, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionsControllerClient", "GetPrivateEndpointConnections", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionsControllerClient", "GetPrivateEndpointConnections", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateEndpointConnectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateEndpointConnectionsControllerClient", "GetPrivateEndpointConnections", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateEndpointConnectionsPreparer prepares the GetPrivateEndpointConnections request. +func (client PrivateEndpointConnectionsControllerClient) GetPrivateEndpointConnectionsPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "migrateProjectName": autorest.Encode("path", migrateProjectName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionsSender sends the GetPrivateEndpointConnections request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsControllerClient) GetPrivateEndpointConnectionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionsResponder handles the response to the GetPrivateEndpointConnections request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsControllerClient) GetPrivateEndpointConnectionsResponder(resp *http.Response) (result PrivateEndpointConnectionCollection, 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/migrate/mgmt/2020-05-01/migrate/privatelinkresourcecontroller.go b/services/migrate/mgmt/2020-05-01/migrate/privatelinkresourcecontroller.go new file mode 100644 index 000000000000..6920a108f4cd --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/privatelinkresourcecontroller.go @@ -0,0 +1,187 @@ +package migrate + +// 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" +) + +// PrivateLinkResourceControllerClient is the client for the PrivateLinkResourceController methods of the Migrate +// service. +type PrivateLinkResourceControllerClient struct { + BaseClient +} + +// NewPrivateLinkResourceControllerClient creates an instance of the PrivateLinkResourceControllerClient client. +func NewPrivateLinkResourceControllerClient(subscriptionID string) PrivateLinkResourceControllerClient { + return NewPrivateLinkResourceControllerClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourceControllerClientWithBaseURI creates an instance of the PrivateLinkResourceControllerClient +// 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 NewPrivateLinkResourceControllerClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourceControllerClient { + return PrivateLinkResourceControllerClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetPrivateLinkResource get the private link resource with the specified name. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// migrateProjectName - migrate project name. +// privateLinkResourceName - private Link resource name. +// APIVersion - the API version to use for this operation. +func (client PrivateLinkResourceControllerClient) GetPrivateLinkResource(ctx context.Context, resourceGroupName string, migrateProjectName string, privateLinkResourceName string, APIVersion string) (result PrivateLinkResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceControllerClient.GetPrivateLinkResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPrivateLinkResourcePreparer(ctx, resourceGroupName, migrateProjectName, privateLinkResourceName, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateLinkResourceControllerClient", "GetPrivateLinkResource", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateLinkResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.PrivateLinkResourceControllerClient", "GetPrivateLinkResource", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateLinkResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateLinkResourceControllerClient", "GetPrivateLinkResource", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateLinkResourcePreparer prepares the GetPrivateLinkResource request. +func (client PrivateLinkResourceControllerClient) GetPrivateLinkResourcePreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, privateLinkResourceName string, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "migrateProjectName": autorest.Encode("path", migrateProjectName), + "privateLinkResourceName": autorest.Encode("path", privateLinkResourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/privateLinkResources/{privateLinkResourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateLinkResourceSender sends the GetPrivateLinkResource request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourceControllerClient) GetPrivateLinkResourceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateLinkResourceResponder handles the response to the GetPrivateLinkResource request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourceControllerClient) GetPrivateLinkResourceResponder(resp *http.Response) (result PrivateLinkResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateLinkResources get the list of private link resources. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// migrateProjectName - migrate project name. +// APIVersion - the API version to use for this operation. +func (client PrivateLinkResourceControllerClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (result PrivateLinkResourceCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceControllerClient.GetPrivateLinkResources") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPrivateLinkResourcesPreparer(ctx, resourceGroupName, migrateProjectName, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateLinkResourceControllerClient", "GetPrivateLinkResources", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateLinkResourcesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.PrivateLinkResourceControllerClient", "GetPrivateLinkResources", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateLinkResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.PrivateLinkResourceControllerClient", "GetPrivateLinkResources", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateLinkResourcesPreparer prepares the GetPrivateLinkResources request. +func (client PrivateLinkResourceControllerClient) GetPrivateLinkResourcesPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "migrateProjectName": autorest.Encode("path", migrateProjectName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateLinkResourcesSender sends the GetPrivateLinkResources request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourceControllerClient) GetPrivateLinkResourcesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateLinkResourcesResponder handles the response to the GetPrivateLinkResources request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourceControllerClient) GetPrivateLinkResourcesResponder(resp *http.Response) (result PrivateLinkResourceCollection, 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/migrate/mgmt/2020-05-01/migrate/projects.go b/services/migrate/mgmt/2020-05-01/migrate/projects.go new file mode 100644 index 000000000000..223a3a47a110 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/projects.go @@ -0,0 +1,261 @@ +package migrate + +// 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" +) + +// ProjectsClient is the client for the Projects methods of the Migrate service. +type ProjectsClient struct { + BaseClient +} + +// NewProjectsClient creates an instance of the ProjectsClient client. +func NewProjectsClient(subscriptionID string) ProjectsClient { + return NewProjectsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProjectsClientWithBaseURI creates an instance of the ProjectsClient 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 NewProjectsClientWithBaseURI(baseURI string, subscriptionID string) ProjectsClient { + return ProjectsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List get all the migrate projects in the resource group. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// APIVersion - the API version to use for this operation. +func (client ProjectsClient) List(ctx context.Context, resourceGroupName string, APIVersion string) (result ProjectResultListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsClient.List") + defer func() { + sc := -1 + if result.prl.Response.Response != nil { + sc = result.prl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.prl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "List", resp, "Failure sending request") + return + } + + result.prl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "List", resp, "Failure responding to request") + return + } + if result.prl.hasNextLink() && result.prl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ProjectsClient) ListPreparer(ctx context.Context, resourceGroupName string, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ProjectsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ProjectsClient) ListResponder(resp *http.Response) (result ProjectResultList, 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 ProjectsClient) listNextResults(ctx context.Context, lastResults ProjectResultList) (result ProjectResultList, err error) { + req, err := lastResults.projectResultListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "migrate.ProjectsClient", "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, "migrate.ProjectsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProjectsClient) ListComplete(ctx context.Context, resourceGroupName string, APIVersion string) (result ProjectResultListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, APIVersion) + return +} + +// ListBySubscription get all the migrate projects in the subscription. +// Parameters: +// APIVersion - the API version to use for this operation. +func (client ProjectsClient) ListBySubscription(ctx context.Context, APIVersion string) (result ProjectResultListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsClient.ListBySubscription") + defer func() { + sc := -1 + if result.prl.Response.Response != nil { + sc = result.prl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.prl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.prl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.prl.hasNextLink() && result.prl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ProjectsClient) ListBySubscriptionPreparer(ctx context.Context, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/migrateProjects", 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 ProjectsClient) 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 ProjectsClient) ListBySubscriptionResponder(resp *http.Response) (result ProjectResultList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client ProjectsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ProjectResultList) (result ProjectResultList, err error) { + req, err := lastResults.projectResultListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "migrate.ProjectsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "migrate.ProjectsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProjectsClient) ListBySubscriptionComplete(ctx context.Context, APIVersion string) (result ProjectResultListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsClient.ListBySubscription") + 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.ListBySubscription(ctx, APIVersion) + return +} diff --git a/services/migrate/mgmt/2020-05-01/migrate/projectscontroller.go b/services/migrate/mgmt/2020-05-01/migrate/projectscontroller.go new file mode 100644 index 000000000000..1c75458a8573 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/projectscontroller.go @@ -0,0 +1,354 @@ +package migrate + +// 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" +) + +// ProjectsControllerClient is the client for the ProjectsController methods of the Migrate service. +type ProjectsControllerClient struct { + BaseClient +} + +// NewProjectsControllerClient creates an instance of the ProjectsControllerClient client. +func NewProjectsControllerClient(subscriptionID string) ProjectsControllerClient { + return NewProjectsControllerClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProjectsControllerClientWithBaseURI creates an instance of the ProjectsControllerClient 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 NewProjectsControllerClientWithBaseURI(baseURI string, subscriptionID string) ProjectsControllerClient { + return ProjectsControllerClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// DeleteMigrateProject delete the migrate project. It deletes summary of the project. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// migrateProjectName - migrate project name. +// APIVersion - the API version to use for this operation. +func (client ProjectsControllerClient) DeleteMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsControllerClient.DeleteMigrateProject") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteMigrateProjectPreparer(ctx, resourceGroupName, migrateProjectName, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "DeleteMigrateProject", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteMigrateProjectSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "DeleteMigrateProject", resp, "Failure sending request") + return + } + + result, err = client.DeleteMigrateProjectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "DeleteMigrateProject", resp, "Failure responding to request") + return + } + + return +} + +// DeleteMigrateProjectPreparer prepares the DeleteMigrateProject request. +func (client ProjectsControllerClient) DeleteMigrateProjectPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "migrateProjectName": autorest.Encode("path", migrateProjectName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteMigrateProjectSender sends the DeleteMigrateProject request. The method will close the +// http.Response Body if it receives an error. +func (client ProjectsControllerClient) DeleteMigrateProjectSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteMigrateProjectResponder handles the response to the DeleteMigrateProject request. The method always +// closes the http.Response Body. +func (client ProjectsControllerClient) DeleteMigrateProjectResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetMigrateProject get information related to a specific migrate project. Returns a json object of type +// 'migrateProject' as specified in the models section. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// migrateProjectName - migrate project name. +// APIVersion - the API version to use for this operation. +func (client ProjectsControllerClient) GetMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (result Project, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsControllerClient.GetMigrateProject") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetMigrateProjectPreparer(ctx, resourceGroupName, migrateProjectName, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "GetMigrateProject", nil, "Failure preparing request") + return + } + + resp, err := client.GetMigrateProjectSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "GetMigrateProject", resp, "Failure sending request") + return + } + + result, err = client.GetMigrateProjectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "GetMigrateProject", resp, "Failure responding to request") + return + } + + return +} + +// GetMigrateProjectPreparer prepares the GetMigrateProject request. +func (client ProjectsControllerClient) GetMigrateProjectPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "migrateProjectName": autorest.Encode("path", migrateProjectName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMigrateProjectSender sends the GetMigrateProject request. The method will close the +// http.Response Body if it receives an error. +func (client ProjectsControllerClient) GetMigrateProjectSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMigrateProjectResponder handles the response to the GetMigrateProject request. The method always +// closes the http.Response Body. +func (client ProjectsControllerClient) GetMigrateProjectResponder(resp *http.Response) (result Project, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PatchMigrateProject update a project with specified name. Supports partial updates, for example only tags can be +// provided. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// migrateProjectName - migrate project name. +// body - migrate project body. +// APIVersion - the API version to use for this operation. +func (client ProjectsControllerClient) PatchMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string, body Project, APIVersion string) (result Project, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsControllerClient.PatchMigrateProject") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PatchMigrateProjectPreparer(ctx, resourceGroupName, migrateProjectName, body, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "PatchMigrateProject", nil, "Failure preparing request") + return + } + + resp, err := client.PatchMigrateProjectSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "PatchMigrateProject", resp, "Failure sending request") + return + } + + result, err = client.PatchMigrateProjectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "PatchMigrateProject", resp, "Failure responding to request") + return + } + + return +} + +// PatchMigrateProjectPreparer prepares the PatchMigrateProject request. +func (client ProjectsControllerClient) PatchMigrateProjectPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, body Project, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "migrateProjectName": autorest.Encode("path", migrateProjectName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PatchMigrateProjectSender sends the PatchMigrateProject request. The method will close the +// http.Response Body if it receives an error. +func (client ProjectsControllerClient) PatchMigrateProjectSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PatchMigrateProjectResponder handles the response to the PatchMigrateProject request. The method always +// closes the http.Response Body. +func (client ProjectsControllerClient) PatchMigrateProjectResponder(resp *http.Response) (result Project, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PutMigrateProject create a new project by sending a json object of type 'migrateproject' as given in Models section +// as part of the Request Body. The project name is unique. +// +// This operation is Idempotent. +// Parameters: +// resourceGroupName - name of the Azure Resource Group that project is part of. +// migrateProjectName - migrate project name. +// body - migrate project body. +// APIVersion - the API version to use for this operation. +func (client ProjectsControllerClient) PutMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string, body Project, APIVersion string) (result Project, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsControllerClient.PutMigrateProject") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PutMigrateProjectPreparer(ctx, resourceGroupName, migrateProjectName, body, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "PutMigrateProject", nil, "Failure preparing request") + return + } + + resp, err := client.PutMigrateProjectSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "PutMigrateProject", resp, "Failure sending request") + return + } + + result, err = client.PutMigrateProjectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.ProjectsControllerClient", "PutMigrateProject", resp, "Failure responding to request") + return + } + + return +} + +// PutMigrateProjectPreparer prepares the PutMigrateProject request. +func (client ProjectsControllerClient) PutMigrateProjectPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, body Project, APIVersion string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "migrateProjectName": autorest.Encode("path", migrateProjectName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutMigrateProjectSender sends the PutMigrateProject request. The method will close the +// http.Response Body if it receives an error. +func (client ProjectsControllerClient) PutMigrateProjectSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PutMigrateProjectResponder handles the response to the PutMigrateProject request. The method always +// closes the http.Response Body. +func (client ProjectsControllerClient) PutMigrateProjectResponder(resp *http.Response) (result Project, 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/migrate/mgmt/2020-05-01/migrate/version.go b/services/migrate/mgmt/2020-05-01/migrate/version.go new file mode 100644 index 000000000000..92b090cf0767 --- /dev/null +++ b/services/migrate/mgmt/2020-05-01/migrate/version.go @@ -0,0 +1,19 @@ +package migrate + +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() + " migrate/2020-05-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/commerce/mgmt/2015-06-01-preview/commerce/CHANGELOG.md b/services/preview/commerce/mgmt/2015-06-01-preview/commerce/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/commerce/mgmt/2015-06-01-preview/commerce/CHANGELOG.md +++ b/services/preview/commerce/mgmt/2015-06-01-preview/commerce/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/commerce/mgmt/2015-06-01-preview/commerce/_meta.json b/services/preview/commerce/mgmt/2015-06-01-preview/commerce/_meta.json index a4b9e11a3c5a..bef8b3818081 100644 --- a/services/preview/commerce/mgmt/2015-06-01-preview/commerce/_meta.json +++ b/services/preview/commerce/mgmt/2015-06-01-preview/commerce/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/commerce/resource-manager/readme.md", "tag": "package-2015-06-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration/CHANGELOG.md b/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration/CHANGELOG.md +++ b/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration/_meta.json b/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration/_meta.json index 975457678a9f..7430bb9701cc 100644 --- a/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration/_meta.json +++ b/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/datamigration/resource-manager/readme.md", "tag": "package-2017-11-15-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/CHANGELOG.md b/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/CHANGELOG.md +++ b/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/_meta.json b/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/_meta.json index d35b721237e8..303f7027e478 100644 --- a/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/_meta.json +++ b/services/preview/datamigration/mgmt/2018-03-31-preview/datamigration/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/datamigration/resource-manager/readme.md", "tag": "package-2018-03-31-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/CHANGELOG.md b/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/CHANGELOG.md +++ b/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/_meta.json b/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/_meta.json index f19f7cd05d04..94a0e8992967 100644 --- a/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/_meta.json +++ b/services/preview/datamigration/mgmt/2018-07-15-preview/datamigration/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/datamigration/resource-manager/readme.md", "tag": "package-2018-07-15-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/datamigration/mgmt/2021-10-30-preview/datamigration/CHANGELOG.md b/services/preview/datamigration/mgmt/2021-10-30-preview/datamigration/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/datamigration/mgmt/2021-10-30-preview/datamigration/CHANGELOG.md +++ b/services/preview/datamigration/mgmt/2021-10-30-preview/datamigration/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/datamigration/mgmt/2021-10-30-preview/datamigration/_meta.json b/services/preview/datamigration/mgmt/2021-10-30-preview/datamigration/_meta.json index 023d55fd8960..970aa05df107 100644 --- a/services/preview/datamigration/mgmt/2021-10-30-preview/datamigration/_meta.json +++ b/services/preview/datamigration/mgmt/2021-10-30-preview/datamigration/_meta.json @@ -1,5 +1,5 @@ { - "commit": "25a8355d4094595edf9b58b13e8c95b0b0c9c50c", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/datamigration/resource-manager/readme.md", "tag": "package-preview-2021-10", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/CHANGELOG.md b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/CHANGELOG.md index 52911e4cc5e4..0adae76acc97 100644 --- a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/CHANGELOG.md +++ b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/CHANGELOG.md @@ -1,2 +1,64 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Funcs + +1. ErrorDefinition.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### Removed Structs + +1. ControllerDetailsModel +1. ErrorDefinition + +#### Removed Struct Fields + +1. Operation.Properties + +### Signature Changes + +#### Funcs + +1. DelegatedSubnetServiceClient.DeleteDetails + - Params + - From: context.Context, string, string + - To: context.Context, string, string, *bool +1. DelegatedSubnetServiceClient.DeleteDetailsPreparer + - Params + - From: context.Context, string, string + - To: context.Context, string, string, *bool + +#### Struct Fields + +1. DelegatedSubnetProperties.ControllerDetails changed type from *ControllerDetailsModel to *ControllerDetails +1. ErrorResponse.Error changed type from *ErrorDefinition to *ErrorDetail +1. Operation.Origin changed type from *string to Origin + +## Additive Changes + +### New Constants + +1. ActionType.Internal +1. Origin.System +1. Origin.User +1. Origin.Usersystem + +### New Funcs + +1. ErrorAdditionalInfo.MarshalJSON() ([]byte, error) +1. ErrorDetail.MarshalJSON() ([]byte, error) +1. PossibleActionTypeValues() []ActionType +1. PossibleOriginValues() []Origin + +### Struct Changes + +#### New Structs + +1. ErrorAdditionalInfo +1. ErrorDetail + +#### New Struct Fields + +1. Operation.ActionType diff --git a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/_meta.json b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/_meta.json index b8bb912f4cbe..386bbd7986fe 100644 --- a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/_meta.json +++ b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/dnc/resource-manager/readme.md", "tag": "package-2020-08-08-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/controller.go b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/controller.go index d3faa11bc4e5..a46061d40445 100644 --- a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/controller.go +++ b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/controller.go @@ -33,8 +33,7 @@ func NewControllerClientWithBaseURI(baseURI string, subscriptionID string) Contr // Create create a dnc controller // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. // parameters - controller type parameters func (client ControllerClient) Create(ctx context.Context, resourceGroupName string, resourceName string, parameters DelegatedController) (result ControllerCreateFuture, err error) { @@ -51,12 +50,13 @@ func (client ControllerClient) Create(ctx context.Context, resourceGroupName str 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.ControllerClient", "Create", err.Error()) } @@ -129,8 +129,7 @@ func (client ControllerClient) CreateResponder(resp *http.Response) (result Dele // Delete deletes the DNC controller // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. func (client ControllerClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result ControllerDeleteFuture, err error) { if tracing.IsEnabled() { @@ -146,12 +145,13 @@ func (client ControllerClient) Delete(ctx context.Context, resourceGroupName str 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.ControllerClient", "Delete", err.Error()) } @@ -220,8 +220,7 @@ func (client ControllerClient) DeleteResponder(resp *http.Response) (result auto // GetDetails gets details about the specified dnc controller. // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. func (client ControllerClient) GetDetails(ctx context.Context, resourceGroupName string, resourceName string) (result DelegatedController, err error) { if tracing.IsEnabled() { @@ -237,12 +236,13 @@ func (client ControllerClient) GetDetails(ctx context.Context, resourceGroupName 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.ControllerClient", "GetDetails", err.Error()) } @@ -309,8 +309,7 @@ func (client ControllerClient) GetDetailsResponder(resp *http.Response) (result // Patch update dnc controller // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. // parameters - controller type parameters func (client ControllerClient) Patch(ctx context.Context, resourceGroupName string, resourceName string, parameters ControllerResourceUpdateParameters) (result DelegatedController, err error) { @@ -327,12 +326,13 @@ func (client ControllerClient) Patch(ctx context.Context, resourceGroupName stri 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.ControllerClient", "Patch", err.Error()) } diff --git a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatednetwork.go b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatednetwork.go index bb4ed4baa5f0..6636c6ae2d10 100644 --- a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatednetwork.go +++ b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatednetwork.go @@ -33,8 +33,7 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // ListByResourceGroup get all the delegatedController resources in a resource group. // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DelegatedControllersPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup") @@ -49,8 +48,9 @@ func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.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("delegatednetwork.Client", "ListByResourceGroup", err.Error()) } @@ -168,6 +168,12 @@ func (client Client) ListBySubscription(ctx context.Context) (result DelegatedCo 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("delegatednetwork.Client", "ListBySubscription", err.Error()) + } + result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx) if err != nil { diff --git a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatednetworkapi/interfaces.go b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatednetworkapi/interfaces.go index 6ffc9874c68a..2d86fbf7269f 100644 --- a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatednetworkapi/interfaces.go +++ b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatednetworkapi/interfaces.go @@ -47,7 +47,7 @@ var _ OrchestratorInstanceServiceClientAPI = (*delegatednetwork.OrchestratorInst // DelegatedSubnetServiceClientAPI contains the set of methods on the DelegatedSubnetServiceClient type. type DelegatedSubnetServiceClientAPI interface { - DeleteDetails(ctx context.Context, resourceGroupName string, resourceName string) (result delegatednetwork.DelegatedSubnetServiceDeleteDetailsFuture, err error) + DeleteDetails(ctx context.Context, resourceGroupName string, resourceName string, forceDelete *bool) (result delegatednetwork.DelegatedSubnetServiceDeleteDetailsFuture, err error) GetDetails(ctx context.Context, resourceGroupName string, resourceName string) (result delegatednetwork.DelegatedSubnet, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result delegatednetwork.DelegatedSubnetsPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result delegatednetwork.DelegatedSubnetsIterator, err error) diff --git a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatedsubnetservice.go b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatedsubnetservice.go index c90060746440..93f83f6b9ce7 100644 --- a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatedsubnetservice.go +++ b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/delegatedsubnetservice.go @@ -34,10 +34,10 @@ func NewDelegatedSubnetServiceClientWithBaseURI(baseURI string, subscriptionID s // DeleteDetails delete dnc DelegatedSubnet. // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. -func (client DelegatedSubnetServiceClient) DeleteDetails(ctx context.Context, resourceGroupName string, resourceName string) (result DelegatedSubnetServiceDeleteDetailsFuture, err error) { +// forceDelete - force delete resource +func (client DelegatedSubnetServiceClient) DeleteDetails(ctx context.Context, resourceGroupName string, resourceName string, forceDelete *bool) (result DelegatedSubnetServiceDeleteDetailsFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DelegatedSubnetServiceClient.DeleteDetails") defer func() { @@ -51,16 +51,17 @@ func (client DelegatedSubnetServiceClient) DeleteDetails(ctx context.Context, re 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.DelegatedSubnetServiceClient", "DeleteDetails", err.Error()) } - req, err := client.DeleteDetailsPreparer(ctx, resourceGroupName, resourceName) + req, err := client.DeleteDetailsPreparer(ctx, resourceGroupName, resourceName, forceDelete) if err != nil { err = autorest.NewErrorWithError(err, "delegatednetwork.DelegatedSubnetServiceClient", "DeleteDetails", nil, "Failure preparing request") return @@ -76,7 +77,7 @@ func (client DelegatedSubnetServiceClient) DeleteDetails(ctx context.Context, re } // DeleteDetailsPreparer prepares the DeleteDetails request. -func (client DelegatedSubnetServiceClient) DeleteDetailsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { +func (client DelegatedSubnetServiceClient) DeleteDetailsPreparer(ctx context.Context, resourceGroupName string, resourceName string, forceDelete *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceName": autorest.Encode("path", resourceName), @@ -87,6 +88,9 @@ func (client DelegatedSubnetServiceClient) DeleteDetailsPreparer(ctx context.Con queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if forceDelete != nil { + queryParameters["forceDelete"] = autorest.Encode("query", *forceDelete) + } preparer := autorest.CreatePreparer( autorest.AsDelete(), @@ -125,8 +129,7 @@ func (client DelegatedSubnetServiceClient) DeleteDetailsResponder(resp *http.Res // GetDetails gets details about the specified dnc DelegatedSubnet Link. // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. func (client DelegatedSubnetServiceClient) GetDetails(ctx context.Context, resourceGroupName string, resourceName string) (result DelegatedSubnet, err error) { if tracing.IsEnabled() { @@ -142,12 +145,13 @@ func (client DelegatedSubnetServiceClient) GetDetails(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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.DelegatedSubnetServiceClient", "GetDetails", err.Error()) } @@ -214,8 +218,7 @@ func (client DelegatedSubnetServiceClient) GetDetailsResponder(resp *http.Respon // ListByResourceGroup get all the DelegatedSubnets resources in a resource group. // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. func (client DelegatedSubnetServiceClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DelegatedSubnetsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DelegatedSubnetServiceClient.ListByResourceGroup") @@ -230,8 +233,9 @@ func (client DelegatedSubnetServiceClient) ListByResourceGroup(ctx context.Conte if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.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("delegatednetwork.DelegatedSubnetServiceClient", "ListByResourceGroup", err.Error()) } @@ -349,6 +353,12 @@ func (client DelegatedSubnetServiceClient) ListBySubscription(ctx context.Contex 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("delegatednetwork.DelegatedSubnetServiceClient", "ListBySubscription", err.Error()) + } + result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx) if err != nil { @@ -452,8 +462,7 @@ func (client DelegatedSubnetServiceClient) ListBySubscriptionComplete(ctx contex // PatchDetails patch delegated subnet resource // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. // parameters - delegated subnet details. func (client DelegatedSubnetServiceClient) PatchDetails(ctx context.Context, resourceGroupName string, resourceName string, parameters ResourceUpdateParameters) (result DelegatedSubnetServicePatchDetailsFuture, err error) { @@ -470,12 +479,13 @@ func (client DelegatedSubnetServiceClient) PatchDetails(ctx context.Context, res 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.DelegatedSubnetServiceClient", "PatchDetails", err.Error()) } @@ -547,8 +557,7 @@ func (client DelegatedSubnetServiceClient) PatchDetailsResponder(resp *http.Resp // PutDetails put delegated subnet resource // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. // parameters - delegated subnet details. func (client DelegatedSubnetServiceClient) PutDetails(ctx context.Context, resourceGroupName string, resourceName string, parameters DelegatedSubnet) (result DelegatedSubnetServicePutDetailsFuture, err error) { @@ -565,12 +574,13 @@ func (client DelegatedSubnetServiceClient) PutDetails(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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.DelegatedSubnetServiceClient", "PutDetails", err.Error()) } diff --git a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/enums.go b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/enums.go index 688badcc4302..9c6e35a4c96f 100644 --- a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/enums.go +++ b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/enums.go @@ -6,6 +6,19 @@ package delegatednetwork // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // Internal ... + Internal ActionType = "Internal" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{Internal} +} + // ControllerState enumerates the values for controller state. type ControllerState string @@ -63,6 +76,23 @@ func PossibleOrchestratorInstanceStateValues() []OrchestratorInstanceState { return []OrchestratorInstanceState{OrchestratorInstanceStateDeleting, OrchestratorInstanceStateFailed, OrchestratorInstanceStateProvisioning, OrchestratorInstanceStateSucceeded} } +// Origin enumerates the values for origin. +type Origin string + +const ( + // System ... + System Origin = "system" + // User ... + User Origin = "user" + // Usersystem ... + Usersystem Origin = "user,system" +) + +// PossibleOriginValues returns an array of possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{System, User, Usersystem} +} + // ResourceIdentityType enumerates the values for resource identity type. type ResourceIdentityType string diff --git a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/models.go b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/models.go index 9f8beab8b5d8..13a60a14439e 100644 --- a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/models.go +++ b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/models.go @@ -105,12 +105,6 @@ type ControllerDetails struct { ID *string `json:"id,omitempty"` } -// ControllerDetailsModel controller details -type ControllerDetailsModel struct { - // ID - controller arm resource id - ID *string `json:"id,omitempty"` -} - // ControllerResource represents an instance of a resource. type ControllerResource struct { // ID - READ-ONLY; An identifier that represents the resource. @@ -542,10 +536,10 @@ type DelegatedSubnetProperties struct { ResourceGUID *string `json:"resourceGuid,omitempty"` // ProvisioningState - READ-ONLY; The current state of dnc delegated subnet resource. Possible values include: 'DelegatedSubnetStateDeleting', 'DelegatedSubnetStateSucceeded', 'DelegatedSubnetStateFailed', 'DelegatedSubnetStateProvisioning' ProvisioningState DelegatedSubnetState `json:"provisioningState,omitempty"` - // SubnetDetails - orchestrator details + // SubnetDetails - subnet details SubnetDetails *SubnetDetails `json:"subnetDetails,omitempty"` - // ControllerDetails - controller details - ControllerDetails *ControllerDetailsModel `json:"controllerDetails,omitempty"` + // ControllerDetails - Properties of the controller. + ControllerDetails *ControllerDetails `json:"controllerDetails,omitempty"` } // MarshalJSON is the custom marshaler for DelegatedSubnetProperties. @@ -877,94 +871,101 @@ func NewDelegatedSubnetsPage(cur DelegatedSubnets, getNextPage func(context.Cont } } -// ErrorDefinition error definition. -type ErrorDefinition struct { - // Code - READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code. +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorDetail the error detail. +type ErrorDetail struct { + // Code - READ-ONLY; The error code. Code *string `json:"code,omitempty"` - // Message - READ-ONLY; Description of the error. + // Message - READ-ONLY; The error message. Message *string `json:"message,omitempty"` - // Details - READ-ONLY; Internal error details. - Details *[]ErrorDefinition `json:"details,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorDetail `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` } -// MarshalJSON is the custom marshaler for ErrorDefinition. -func (ed ErrorDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// ErrorResponse error response. +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.). type ErrorResponse struct { - // Error - Error description - Error *ErrorDefinition `json:"error,omitempty"` + // Error - The error object. + Error *ErrorDetail `json:"error,omitempty"` } -// Operation microsoft.DelegatedNetwork REST API operation definition +// Operation details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { - // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}. + // Name - READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" Name *string `json:"name,omitempty"` - // Origin - Origin of the operation - Origin *string `json:"origin,omitempty"` - // IsDataAction - Gets or sets a value indicating whether the operation is a data action or not. + // IsDataAction - READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. IsDataAction *bool `json:"isDataAction,omitempty"` - // Display - Operation properties display + // Display - Localized display information for this particular operation. Display *OperationDisplay `json:"display,omitempty"` - // Properties - Properties of the operation - Properties interface{} `json:"properties,omitempty"` + // Origin - READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". Possible values include: 'User', 'System', 'Usersystem' + Origin Origin `json:"origin,omitempty"` + // ActionType - READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. Possible values include: 'Internal' + ActionType ActionType `json:"actionType,omitempty"` } // MarshalJSON is the custom marshaler for Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if o.Origin != nil { - objectMap["origin"] = o.Origin - } - if o.IsDataAction != nil { - objectMap["isDataAction"] = o.IsDataAction - } if o.Display != nil { objectMap["display"] = o.Display } - if o.Properties != nil { - objectMap["properties"] = o.Properties - } return json.Marshal(objectMap) } -// OperationDisplay the object that represents the operation. +// OperationDisplay localized display information for this particular operation. type OperationDisplay struct { - // Provider - READ-ONLY; Service provider: Microsoft.DelegatedNetwork. + // Provider - READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". Provider *string `json:"provider,omitempty"` - // Resource - READ-ONLY; Resource on which the operation is performed: controller, etc. + // Resource - READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". Resource *string `json:"resource,omitempty"` - // Operation - READ-ONLY; Operation type: create, get, delete, etc. + // Operation - READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". Operation *string `json:"operation,omitempty"` - // Description - READ-ONLY; Friendly description for the operation, + // Description - READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. Description *string `json:"description,omitempty"` } // MarshalJSON is the custom marshaler for OperationDisplay. -func (od OperationDisplay) MarshalJSON() ([]byte, error) { +func (o OperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) return json.Marshal(objectMap) } -// OperationListResult result of request to list controller operations.It contains a list of operations and -// a URL link to get the next set of results +// OperationListResult a list of REST API operations supported by an Azure Resource Provider. It contains +// an URL link to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List of operations supported by the Microsoft.DelegatedNetwork resource provider. + // Value - READ-ONLY; List of operations supported by the resource provider Value *[]Operation `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. + // NextLink - READ-ONLY; URL to get the next set of operation list results (if there are any). NextLink *string `json:"nextLink,omitempty"` } // MarshalJSON is the custom marshaler for OperationListResult. func (olr OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if olr.NextLink != nil { - objectMap["nextLink"] = olr.NextLink - } return json.Marshal(objectMap) } @@ -1396,7 +1397,7 @@ type OrchestratorResourceProperties struct { ClusterRootCA *string `json:"clusterRootCA,omitempty"` // APIServerEndpoint - K8s APIServer url APIServerEndpoint *string `json:"apiServerEndpoint,omitempty"` - // ControllerDetails - controller details + // ControllerDetails - Properties of the controller. ControllerDetails *ControllerDetails `json:"controllerDetails,omitempty"` } diff --git a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/orchestratorinstanceservice.go b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/orchestratorinstanceservice.go index 307cd62428b7..721d4132c94e 100644 --- a/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/orchestratorinstanceservice.go +++ b/services/preview/delegatednetwork/mgmt/2020-08-08-preview/delegatednetwork/orchestratorinstanceservice.go @@ -34,8 +34,7 @@ func NewOrchestratorInstanceServiceClientWithBaseURI(baseURI string, subscriptio // Create create a orchestrator instance // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. // parameters - orchestratorInstance type parameters func (client OrchestratorInstanceServiceClient) Create(ctx context.Context, resourceGroupName string, resourceName string, parameters Orchestrator) (result OrchestratorInstanceServiceCreateFuture, err error) { @@ -52,12 +51,13 @@ func (client OrchestratorInstanceServiceClient) Create(ctx context.Context, reso 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.OrchestratorResourceProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.OrchestratorResourceProperties.ControllerDetails", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { @@ -132,8 +132,7 @@ func (client OrchestratorInstanceServiceClient) CreateResponder(resp *http.Respo // Delete deletes the Orchestrator Instance // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. func (client OrchestratorInstanceServiceClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result OrchestratorInstanceServiceDeleteFuture, err error) { if tracing.IsEnabled() { @@ -149,12 +148,13 @@ func (client OrchestratorInstanceServiceClient) Delete(ctx context.Context, reso 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.OrchestratorInstanceServiceClient", "Delete", err.Error()) } @@ -223,8 +223,7 @@ func (client OrchestratorInstanceServiceClient) DeleteResponder(resp *http.Respo // GetDetails gets details about the orchestrator instance. // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. func (client OrchestratorInstanceServiceClient) GetDetails(ctx context.Context, resourceGroupName string, resourceName string) (result Orchestrator, err error) { if tracing.IsEnabled() { @@ -240,12 +239,13 @@ func (client OrchestratorInstanceServiceClient) GetDetails(ctx context.Context, 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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.OrchestratorInstanceServiceClient", "GetDetails", err.Error()) } @@ -312,8 +312,7 @@ func (client OrchestratorInstanceServiceClient) GetDetailsResponder(resp *http.R // ListByResourceGroup get all the OrchestratorInstances resources in a resource group. // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. func (client OrchestratorInstanceServiceClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result OrchestratorsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OrchestratorInstanceServiceClient.ListByResourceGroup") @@ -328,8 +327,9 @@ func (client OrchestratorInstanceServiceClient) ListByResourceGroup(ctx context. if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.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("delegatednetwork.OrchestratorInstanceServiceClient", "ListByResourceGroup", err.Error()) } @@ -447,6 +447,12 @@ func (client OrchestratorInstanceServiceClient) ListBySubscription(ctx context.C 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("delegatednetwork.OrchestratorInstanceServiceClient", "ListBySubscription", err.Error()) + } + result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx) if err != nil { @@ -550,8 +556,7 @@ func (client OrchestratorInstanceServiceClient) ListBySubscriptionComplete(ctx c // Patch update Orchestrator Instance // Parameters: -// resourceGroupName - the name of the Azure Resource group of which a given DelegatedNetwork resource is part. -// This name must be at least 1 character in length, and no more than 90. +// resourceGroupName - the name of the resource group. The name is case insensitive. // resourceName - the name of the resource. It must be a minimum of 3 characters, and a maximum of 63. // parameters - orchestratorInstance update parameters func (client OrchestratorInstanceServiceClient) Patch(ctx context.Context, resourceGroupName string, resourceName string, parameters OrchestratorResourceUpdateParameters) (result Orchestrator, err error) { @@ -568,12 +573,13 @@ func (client OrchestratorInstanceServiceClient) Patch(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: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("delegatednetwork.OrchestratorInstanceServiceClient", "Patch", err.Error()) } diff --git a/services/preview/engagementfabric/mgmt/2018-09-01/engagementfabric/CHANGELOG.md b/services/preview/engagementfabric/mgmt/2018-09-01/engagementfabric/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/engagementfabric/mgmt/2018-09-01/engagementfabric/CHANGELOG.md +++ b/services/preview/engagementfabric/mgmt/2018-09-01/engagementfabric/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/engagementfabric/mgmt/2018-09-01/engagementfabric/_meta.json b/services/preview/engagementfabric/mgmt/2018-09-01/engagementfabric/_meta.json index 837a393833a3..402a918851b8 100644 --- a/services/preview/engagementfabric/mgmt/2018-09-01/engagementfabric/_meta.json +++ b/services/preview/engagementfabric/mgmt/2018-09-01/engagementfabric/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/engagementfabric/resource-manager/readme.md", "tag": "package-2018-09-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/CHANGELOG.md b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/CHANGELOG.md index 52911e4cc5e4..c85932c9b6fa 100644 --- a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/CHANGELOG.md +++ b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/CHANGELOG.md @@ -1,2 +1,127 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. NameUnavailabilityReason.AlreadyExists +1. NameUnavailabilityReason.Invalid +1. ProvisioningState.Canceled +1. ProvisioningState.Deleting +1. ProvisioningState.Failed +1. ProvisioningState.Provisioning +1. ProvisioningState.Succeeded +1. Sku.F1 +1. Sku.S1 +1. Sku.S2 +1. Sku.S3 + +### Removed Funcs + +1. *CreateOrUpdateFuture.UnmarshalJSON([]byte) error +1. *DeleteFuture.UnmarshalJSON([]byte) error +1. *DescriptionListResultIterator.Next() error +1. *DescriptionListResultIterator.NextWithContext(context.Context) error +1. *DescriptionListResultPage.Next() error +1. *DescriptionListResultPage.NextWithContext(context.Context) error +1. *OperationListResultIterator.Next() error +1. *OperationListResultIterator.NextWithContext(context.Context) error +1. *OperationListResultPage.Next() error +1. *OperationListResultPage.NextWithContext(context.Context) error +1. *UpdateFuture.UnmarshalJSON([]byte) error +1. Client.CheckNameAvailability(context.Context, OperationInputs) (NameAvailabilityInfo, error) +1. Client.CheckNameAvailabilityPreparer(context.Context, OperationInputs) (*http.Request, error) +1. Client.CheckNameAvailabilityResponder(*http.Response) (NameAvailabilityInfo, error) +1. Client.CheckNameAvailabilitySender(*http.Request) (*http.Response, error) +1. Client.CreateOrUpdate(context.Context, string, string, Description) (CreateOrUpdateFuture, error) +1. Client.CreateOrUpdatePreparer(context.Context, string, string, Description) (*http.Request, error) +1. Client.CreateOrUpdateResponder(*http.Response) (Description, error) +1. Client.CreateOrUpdateSender(*http.Request) (CreateOrUpdateFuture, error) +1. Client.Delete(context.Context, string, string) (DeleteFuture, error) +1. Client.DeletePreparer(context.Context, string, string) (*http.Request, error) +1. Client.DeleteResponder(*http.Response) (Description, error) +1. Client.DeleteSender(*http.Request) (DeleteFuture, error) +1. Client.Get(context.Context, string, string) (Description, error) +1. Client.GetPreparer(context.Context, string, string) (*http.Request, error) +1. Client.GetResponder(*http.Response) (Description, error) +1. Client.GetSender(*http.Request) (*http.Response, error) +1. Client.List(context.Context) (DescriptionListResultPage, error) +1. Client.ListByResourceGroup(context.Context, string) (DescriptionListResultPage, error) +1. Client.ListByResourceGroupComplete(context.Context, string) (DescriptionListResultIterator, error) +1. Client.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. Client.ListByResourceGroupResponder(*http.Response) (DescriptionListResult, error) +1. Client.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. Client.ListComplete(context.Context) (DescriptionListResultIterator, error) +1. Client.ListPreparer(context.Context) (*http.Request, error) +1. Client.ListResponder(*http.Response) (DescriptionListResult, error) +1. Client.ListSender(*http.Request) (*http.Response, error) +1. Client.Update(context.Context, string, string, PatchDescription) (UpdateFuture, error) +1. Client.UpdatePreparer(context.Context, string, string, PatchDescription) (*http.Request, error) +1. Client.UpdateResponder(*http.Response) (Description, error) +1. Client.UpdateSender(*http.Request) (UpdateFuture, error) +1. Description.MarshalJSON() ([]byte, error) +1. DescriptionListResult.IsEmpty() bool +1. DescriptionListResultIterator.NotDone() bool +1. DescriptionListResultIterator.Response() DescriptionListResult +1. DescriptionListResultIterator.Value() Description +1. DescriptionListResultPage.NotDone() bool +1. DescriptionListResultPage.Response() DescriptionListResult +1. DescriptionListResultPage.Values() []Description +1. ErrorDetails.MarshalJSON() ([]byte, error) +1. NameAvailabilityInfo.MarshalJSON() ([]byte, error) +1. NewClient(uuid.UUID) Client +1. NewClientWithBaseURI(string, uuid.UUID) Client +1. NewDescriptionListResultIterator(DescriptionListResultPage) DescriptionListResultIterator +1. NewDescriptionListResultPage(DescriptionListResult, func(context.Context, DescriptionListResult) (DescriptionListResult, error)) DescriptionListResultPage +1. NewOperationListResultIterator(OperationListResultPage) OperationListResultIterator +1. NewOperationListResultPage(OperationListResult, func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage +1. NewOperationsClient(uuid.UUID) OperationsClient +1. NewOperationsClientWithBaseURI(string, uuid.UUID) OperationsClient +1. Operation.MarshalJSON() ([]byte, error) +1. OperationDisplay.MarshalJSON() ([]byte, error) +1. OperationListResult.IsEmpty() bool +1. OperationListResult.MarshalJSON() ([]byte, error) +1. OperationListResultIterator.NotDone() bool +1. OperationListResultIterator.Response() OperationListResult +1. OperationListResultIterator.Value() Operation +1. OperationListResultPage.NotDone() bool +1. OperationListResultPage.Response() OperationListResult +1. OperationListResultPage.Values() []Operation +1. OperationsClient.List(context.Context) (OperationListResultPage, error) +1. OperationsClient.ListComplete(context.Context) (OperationListResultIterator, error) +1. OperationsClient.ListPreparer(context.Context) (*http.Request, error) +1. OperationsClient.ListResponder(*http.Response) (OperationListResult, error) +1. OperationsClient.ListSender(*http.Request) (*http.Response, error) +1. PatchDescription.MarshalJSON() ([]byte, error) +1. PossibleNameUnavailabilityReasonValues() []NameUnavailabilityReason +1. PossibleProvisioningStateValues() []ProvisioningState +1. PossibleSkuValues() []Sku +1. Properties.MarshalJSON() ([]byte, error) +1. Resource.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### Removed Structs + +1. Client +1. CreateOrUpdateFuture +1. DeleteFuture +1. Description +1. DescriptionListResult +1. DescriptionListResultIterator +1. DescriptionListResultPage +1. ErrorDetails +1. NameAvailabilityInfo +1. Operation +1. OperationDisplay +1. OperationInputs +1. OperationListResult +1. OperationListResultIterator +1. OperationListResultPage +1. OperationsClient +1. PatchDescription +1. Properties +1. Resource +1. SkuInfo +1. StorageContainerProperties +1. UpdateFuture diff --git a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/_meta.json b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/_meta.json index a4805fbda283..b28dbf0b605a 100644 --- a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/_meta.json +++ b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/iotspaces/resource-manager/readme.md", "tag": "package-2017-10-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/enums.go b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/enums.go deleted file mode 100644 index 35dc194c26e2..000000000000 --- a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/enums.go +++ /dev/null @@ -1,62 +0,0 @@ -package iotspaces - -// 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. - -// NameUnavailabilityReason enumerates the values for name unavailability reason. -type NameUnavailabilityReason string - -const ( - // AlreadyExists ... - AlreadyExists NameUnavailabilityReason = "AlreadyExists" - // Invalid ... - Invalid NameUnavailabilityReason = "Invalid" -) - -// PossibleNameUnavailabilityReasonValues returns an array of possible values for the NameUnavailabilityReason const type. -func PossibleNameUnavailabilityReasonValues() []NameUnavailabilityReason { - return []NameUnavailabilityReason{AlreadyExists, Invalid} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Canceled ... - Canceled ProvisioningState = "Canceled" - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Provisioning ... - Provisioning ProvisioningState = "Provisioning" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Canceled, Deleting, Failed, Provisioning, Succeeded} -} - -// Sku enumerates the values for sku. -type Sku string - -const ( - // F1 ... - F1 Sku = "F1" - // S1 ... - S1 Sku = "S1" - // S2 ... - S2 Sku = "S2" - // S3 ... - S3 Sku = "S3" -) - -// PossibleSkuValues returns an array of possible values for the Sku const type. -func PossibleSkuValues() []Sku { - return []Sku{F1, S1, S2, S3} -} diff --git a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/iotspaces.go b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/iotspaces.go deleted file mode 100644 index 7409baaba9ae..000000000000 --- a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/iotspaces.go +++ /dev/null @@ -1,714 +0,0 @@ -package iotspaces - -// 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" - "github.com/gofrs/uuid" - "net/http" -) - -// Client is the use this API to manage the IoTSpaces service instances in your Azure subscription. -type Client struct { - BaseClient -} - -// NewClient creates an instance of the Client client. -func NewClient(subscriptionID uuid.UUID) Client { - return NewClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewClientWithBaseURI creates an instance of the Client 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 NewClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) Client { - return Client{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckNameAvailability check if an IoTSpaces instance name is available. -// Parameters: -// operationInputs - set the name parameter in the OperationInputs structure to the name of the IoTSpaces -// instance to check. -func (client Client) CheckNameAvailability(ctx context.Context, operationInputs OperationInputs) (result NameAvailabilityInfo, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.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: operationInputs, - Constraints: []validation.Constraint{{Target: "operationInputs.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("iotspaces.Client", "CheckNameAvailability", err.Error()) - } - - req, err := client.CheckNameAvailabilityPreparer(ctx, operationInputs) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "CheckNameAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckNameAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "iotspaces.Client", "CheckNameAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckNameAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "CheckNameAvailability", resp, "Failure responding to request") - return - } - - return -} - -// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. -func (client Client) CheckNameAvailabilityPreparer(ctx context.Context, operationInputs OperationInputs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - 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.IoTSpaces/checkNameAvailability", pathParameters), - autorest.WithJSON(operationInputs), - 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 Client) 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 Client) CheckNameAvailabilityResponder(resp *http.Response) (result NameAvailabilityInfo, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdate create or update the metadata of an IoTSpaces instance. The usual pattern to modify a property is to -// retrieve the IoTSpaces instance metadata and security metadata, and then combine them with the modified values in a -// new body to update the IoTSpaces instance. -// Parameters: -// resourceGroupName - the name of the resource group that contains the IoTSpaces instance. -// resourceName - the name of the IoTSpaces instance. -// iotSpaceDescription - the IoTSpaces instance metadata and security metadata. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, iotSpaceDescription Description) (result CreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") - 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: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: iotSpaceDescription, - Constraints: []validation.Constraint{{Target: "iotSpaceDescription.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("iotspaces.Client", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, iotSpaceDescription) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, iotSpaceDescription Description) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - 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.IoTSpaces/Graph/{resourceName}", pathParameters), - autorest.WithJSON(iotSpaceDescription), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpdateFuture, 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 -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Description, 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 an IoTSpaces instance. -// Parameters: -// resourceGroupName - the name of the resource group that contains the IoTSpaces instance. -// resourceName - the name of the IoTSpaces instance. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result DeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.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: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("iotspaces.Client", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTSpaces/Graph/{resourceName}", 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 Client) DeleteSender(req *http.Request) (future DeleteFuture, 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 Client) DeleteResponder(resp *http.Response) (result Description, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get get the metadata of a IoTSpaces instance. -// Parameters: -// resourceGroupName - the name of the resource group that contains the IoTSpaces instance. -// resourceName - the name of the IoTSpaces instance. -func (client Client) Get(ctx context.Context, resourceGroupName string, resourceName string) (result Description, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("iotspaces.Client", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "iotspaces.Client", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTSpaces/Graph/{resourceName}", 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 Client) 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 Client) GetResponder(resp *http.Response) (result Description, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get all the IoTSpaces instances in a subscription. -func (client Client) List(ctx context.Context) (result DescriptionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.List") - defer func() { - sc := -1 - if result.dlr.Response.Response != nil { - sc = result.dlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "iotspaces.Client", "List", resp, "Failure sending request") - return - } - - result.dlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "List", resp, "Failure responding to request") - return - } - if result.dlr.hasNextLink() && result.dlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client Client) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.IoTSpaces/Graph", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client Client) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client Client) ListResponder(resp *http.Response) (result DescriptionListResult, 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 Client) listNextResults(ctx context.Context, lastResults DescriptionListResult) (result DescriptionListResult, err error) { - req, err := lastResults.descriptionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "iotspaces.Client", "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, "iotspaces.Client", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client Client) ListComplete(ctx context.Context) (result DescriptionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup get all the IoTSpaces instances in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group that contains the IoTSpaces instance. -func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DescriptionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup") - defer func() { - sc := -1 - if result.dlr.Response.Response != nil { - sc = result.dlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("iotspaces.Client", "ListByResourceGroup", err.Error()) - } - - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "iotspaces.Client", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dlr.hasNextLink() && result.dlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client Client) 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 = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTSpaces/Graph", 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 Client) 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 Client) ListByResourceGroupResponder(resp *http.Response) (result DescriptionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client Client) listByResourceGroupNextResults(ctx context.Context, lastResults DescriptionListResult) (result DescriptionListResult, err error) { - req, err := lastResults.descriptionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "iotspaces.Client", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "iotspaces.Client", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DescriptionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup") - 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.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update update the metadata of a IoTSpaces instance. -// Parameters: -// resourceGroupName - the name of the resource group that contains the IoTSpaces instance. -// resourceName - the name of the IoTSpaces instance. -// iotSpacePatchDescription - the IoTSpaces instance metadata and security metadata. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceName string, iotSpacePatchDescription PatchDescription) (result UpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Client.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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("iotspaces.Client", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, iotSpacePatchDescription) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.Client", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, iotSpacePatchDescription PatchDescription) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTSpaces/Graph/{resourceName}", pathParameters), - autorest.WithJSON(iotSpacePatchDescription), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, 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 Client) UpdateResponder(resp *http.Response) (result Description, 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/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/iotspacesapi/interfaces.go b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/iotspacesapi/interfaces.go index 3eeb0e8c1908..4d594e8fa8ff 100644 --- a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/iotspacesapi/interfaces.go +++ b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/iotspacesapi/interfaces.go @@ -10,26 +10,3 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces" ) - -// ClientAPI contains the set of methods on the Client type. -type ClientAPI interface { - CheckNameAvailability(ctx context.Context, operationInputs iotspaces.OperationInputs) (result iotspaces.NameAvailabilityInfo, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, iotSpaceDescription iotspaces.Description) (result iotspaces.CreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, resourceName string) (result iotspaces.DeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, resourceName string) (result iotspaces.Description, err error) - List(ctx context.Context) (result iotspaces.DescriptionListResultPage, err error) - ListComplete(ctx context.Context) (result iotspaces.DescriptionListResultIterator, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result iotspaces.DescriptionListResultPage, err error) - ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result iotspaces.DescriptionListResultIterator, err error) - Update(ctx context.Context, resourceGroupName string, resourceName string, iotSpacePatchDescription iotspaces.PatchDescription) (result iotspaces.UpdateFuture, err error) -} - -var _ ClientAPI = (*iotspaces.Client)(nil) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result iotspaces.OperationListResultPage, err error) - ListComplete(ctx context.Context) (result iotspaces.OperationListResultIterator, err error) -} - -var _ OperationsClientAPI = (*iotspaces.OperationsClient)(nil) diff --git a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/models.go b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/models.go index a7516dacc2f0..5b2e31664c45 100644 --- a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/models.go +++ b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/models.go @@ -6,668 +6,5 @@ package iotspaces // 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/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/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces" - -// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(Client) (Description, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CreateOrUpdateFuture) 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 CreateOrUpdateFuture.Result. -func (future *CreateOrUpdateFuture) result(client Client) (d Description, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("iotspaces.CreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.CreateOrUpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.CreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type DeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(Client) (Description, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DeleteFuture) 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 DeleteFuture.Result. -func (future *DeleteFuture) result(client Client) (d Description, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.DeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("iotspaces.DeleteFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.DeleteResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.DeleteFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// Description the description of the IoTSpaces service. -type Description struct { - autorest.Response `json:"-"` - // Properties - The common properties of a IoTSpaces service. - Properties *Properties `json:"properties,omitempty"` - // Sku - A valid instance SKU. - Sku *SkuInfo `json:"sku,omitempty"` - // ID - READ-ONLY; The resource identifier. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // Location - The resource location. - Location *string `json:"location,omitempty"` - // Tags - The resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Description. -func (d Description) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.Properties != nil { - objectMap["properties"] = d.Properties - } - if d.Sku != nil { - objectMap["sku"] = d.Sku - } - if d.Location != nil { - objectMap["location"] = d.Location - } - if d.Tags != nil { - objectMap["tags"] = d.Tags - } - return json.Marshal(objectMap) -} - -// DescriptionListResult a list of IoTSpaces description objects with a next link. -type DescriptionListResult struct { - autorest.Response `json:"-"` - // NextLink - The link used to get the next page of IoTSpaces description objects. - NextLink *string `json:"nextLink,omitempty"` - // Value - A list of IoTSpaces description objects. - Value *[]Description `json:"value,omitempty"` -} - -// DescriptionListResultIterator provides access to a complete listing of Description values. -type DescriptionListResultIterator struct { - i int - page DescriptionListResultPage -} - -// 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 *DescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DescriptionListResultIterator.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 *DescriptionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DescriptionListResultIterator) 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 DescriptionListResultIterator) Response() DescriptionListResult { - 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 DescriptionListResultIterator) Value() Description { - if !iter.page.NotDone() { - return Description{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DescriptionListResultIterator type. -func NewDescriptionListResultIterator(page DescriptionListResultPage) DescriptionListResultIterator { - return DescriptionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dlr DescriptionListResult) IsEmpty() bool { - return dlr.Value == nil || len(*dlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dlr DescriptionListResult) hasNextLink() bool { - return dlr.NextLink != nil && len(*dlr.NextLink) != 0 -} - -// descriptionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dlr DescriptionListResult) descriptionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dlr.NextLink))) -} - -// DescriptionListResultPage contains a page of Description values. -type DescriptionListResultPage struct { - fn func(context.Context, DescriptionListResult) (DescriptionListResult, error) - dlr DescriptionListResult -} - -// 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 *DescriptionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DescriptionListResultPage.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.dlr) - if err != nil { - return err - } - page.dlr = 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 *DescriptionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DescriptionListResultPage) NotDone() bool { - return !page.dlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DescriptionListResultPage) Response() DescriptionListResult { - return page.dlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DescriptionListResultPage) Values() []Description { - if page.dlr.IsEmpty() { - return nil - } - return *page.dlr.Value -} - -// Creates a new instance of the DescriptionListResultPage type. -func NewDescriptionListResultPage(cur DescriptionListResult, getNextPage func(context.Context, DescriptionListResult) (DescriptionListResult, error)) DescriptionListResultPage { - return DescriptionListResultPage{ - fn: getNextPage, - dlr: cur, - } -} - -// ErrorDetails error details. -type ErrorDetails struct { - // Code - READ-ONLY; The error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; The error message. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; The target of the particular error. - Target *string `json:"target,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorDetails. -func (ed ErrorDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// NameAvailabilityInfo the properties indicating whether a given IoTSpaces service name is available. -type NameAvailabilityInfo struct { - autorest.Response `json:"-"` - // NameAvailable - READ-ONLY; The value which indicates whether the provided name is available. - NameAvailable *bool `json:"nameAvailable,omitempty"` - // Reason - READ-ONLY; The reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists' - Reason NameUnavailabilityReason `json:"reason,omitempty"` - // Message - The detailed reason message. - Message *string `json:"message,omitempty"` -} - -// MarshalJSON is the custom marshaler for NameAvailabilityInfo. -func (nai NameAvailabilityInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if nai.Message != nil { - objectMap["message"] = nai.Message - } - return json.Marshal(objectMap) -} - -// Operation ioTSpaces service REST API operation -type Operation struct { - // Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete} - Name *string `json:"name,omitempty"` - Display *OperationDisplay `json:"display,omitempty"` -} - -// MarshalJSON is the custom marshaler for Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if o.Display != nil { - objectMap["display"] = o.Display - } - return json.Marshal(objectMap) -} - -// OperationDisplay the object that represents the operation. -type OperationDisplay struct { - // Provider - READ-ONLY; Service provider: Microsoft IoTSpaces - Provider *string `json:"provider,omitempty"` - // Resource - READ-ONLY; Resource Type: IoTSpaces - Resource *string `json:"resource,omitempty"` - // Operation - READ-ONLY; Name of the operation - Operation *string `json:"operation,omitempty"` - // Description - READ-ONLY; Friendly description for the operation, - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationDisplay. -func (od OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationInputs input values. -type OperationInputs struct { - // Name - The name of the IoTSpaces service instance to check. - Name *string `json:"name,omitempty"` -} - -// OperationListResult a list of IoTSpaces service operations. It contains a list of operations and a URL -// link to get the next set of results. -type OperationListResult struct { - autorest.Response `json:"-"` - // NextLink - The link used to get the next page of IoTSpaces description objects. - NextLink *string `json:"nextLink,omitempty"` - // Value - READ-ONLY; A list of IoT spaces operations supported by the Microsoft.IoTSpaces resource provider. - Value *[]Operation `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationListResult. -func (olr OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if olr.NextLink != nil { - objectMap["nextLink"] = olr.NextLink - } - return json.Marshal(objectMap) -} - -// OperationListResultIterator provides access to a complete listing of Operation values. -type OperationListResultIterator struct { - i int - page OperationListResultPage -} - -// 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 *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.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 *OperationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OperationListResultIterator) 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 OperationListResultIterator) Response() OperationListResult { - 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 OperationListResultIterator) Value() Operation { - if !iter.page.NotDone() { - return Operation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OperationListResultIterator type. -func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { - return OperationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (olr OperationListResult) IsEmpty() bool { - return olr.Value == nil || len(*olr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (olr OperationListResult) hasNextLink() bool { - return olr.NextLink != nil && len(*olr.NextLink) != 0 -} - -// operationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !olr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(olr.NextLink))) -} - -// OperationListResultPage contains a page of Operation values. -type OperationListResultPage struct { - fn func(context.Context, OperationListResult) (OperationListResult, error) - olr OperationListResult -} - -// 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 *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.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.olr) - if err != nil { - return err - } - page.olr = 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 *OperationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationListResultPage) NotDone() bool { - return !page.olr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OperationListResultPage) Response() OperationListResult { - return page.olr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OperationListResultPage) Values() []Operation { - if page.olr.IsEmpty() { - return nil - } - return *page.olr.Value -} - -// Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{ - fn: getNextPage, - olr: cur, - } -} - -// PatchDescription the description of the IoTSpaces service. -type PatchDescription struct { - // Tags - Instance tags - Tags map[string]*string `json:"tags"` - // Properties - The common properties of an IoTSpaces service. - Properties *Properties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for PatchDescription. -func (pd PatchDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pd.Tags != nil { - objectMap["tags"] = pd.Tags - } - if pd.Properties != nil { - objectMap["properties"] = pd.Properties - } - return json.Marshal(objectMap) -} - -// Properties the properties of an IoTSpaces instance. -type Properties struct { - // ProvisioningState - READ-ONLY; The provisioning state. Possible values include: 'Provisioning', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ManagementAPIURL - READ-ONLY; The management Api endpoint. - ManagementAPIURL *string `json:"managementApiUrl,omitempty"` - // WebPortalURL - READ-ONLY; The management UI endpoint. - WebPortalURL *string `json:"webPortalUrl,omitempty"` - // StorageContainer - The properties of the designated storage container. - StorageContainer *StorageContainerProperties `json:"storageContainer,omitempty"` -} - -// MarshalJSON is the custom marshaler for Properties. -func (p Properties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if p.StorageContainer != nil { - objectMap["storageContainer"] = p.StorageContainer - } - return json.Marshal(objectMap) -} - -// Resource the common properties of an IoTSpaces service. -type Resource struct { - // ID - READ-ONLY; The resource identifier. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // Location - The resource location. - Location *string `json:"location,omitempty"` - // Tags - The resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - -// SkuInfo information about the SKU of the IoTSpaces instance. -type SkuInfo struct { - // Name - The name of the SKU. Possible values include: 'F1', 'S1', 'S2', 'S3' - Name Sku `json:"name,omitempty"` -} - -// StorageContainerProperties the properties of the Azure Storage Container for file archive. -type StorageContainerProperties struct { - // ConnectionString - The connection string of the storage account. - ConnectionString *string `json:"connectionString,omitempty"` - // SubscriptionID - The subscription identifier of the storage account. - SubscriptionID *string `json:"subscriptionId,omitempty"` - // ResourceGroup - The name of the resource group of the storage account. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // ContainerName - The name of storage container in the storage account. - ContainerName *string `json:"containerName,omitempty"` -} - -// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type UpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(Client) (Description, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *UpdateFuture) 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 UpdateFuture.Result. -func (future *UpdateFuture) result(client Client) (d Description, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.UpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("iotspaces.UpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.UpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.UpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} diff --git a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/operations.go b/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/operations.go deleted file mode 100644 index b4fbb19749d5..000000000000 --- a/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces/operations.go +++ /dev/null @@ -1,141 +0,0 @@ -package iotspaces - -// 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" - "github.com/gofrs/uuid" - "net/http" -) - -// OperationsClient is the use this API to manage the IoTSpaces service instances in your Azure subscription. -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID uuid.UUID) 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 uuid.UUID) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all of the available IoTSpaces service REST API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.olr.Response.Response != nil { - sc = result.olr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.olr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "iotspaces.OperationsClient", "List", resp, "Failure sending request") - return - } - - result.olr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.OperationsClient", "List", resp, "Failure responding to request") - return - } - if result.olr.hasNextLink() && result.olr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2017-10-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.IoTSpaces/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 OperationListResult, 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 OperationListResult) (result OperationListResult, err error) { - req, err := lastResults.operationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "iotspaces.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, "iotspaces.OperationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "iotspaces.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 OperationListResultIterator, 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/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/CHANGELOG.md b/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/CHANGELOG.md +++ b/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/_meta.json b/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/_meta.json index 5ec038970941..51ca5b4159b2 100644 --- a/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/_meta.json +++ b/services/preview/managednetwork/mgmt/2019-06-01-preview/managednetwork/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/managednetwork/resource-manager/readme.md", "tag": "package-2019-06-01-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/CHANGELOG.md b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/CHANGELOG.md index 52911e4cc5e4..99dec7296237 100644 --- a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/CHANGELOG.md +++ b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/CHANGELOG.md @@ -1,2 +1,234 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Funcs + +1. *Operation.UnmarshalJSON([]byte) error +1. *Subnet.UnmarshalJSON([]byte) error +1. NewSubnetsClient(string) SubnetsClient +1. NewSubnetsClientWithBaseURI(string, string) SubnetsClient +1. PossibleStatusValues() []Status +1. Subnet.MarshalJSON() ([]byte, error) +1. SubnetsClient.CreateOrUpdate(context.Context, string, string, string) (Subnet, error) +1. SubnetsClient.CreateOrUpdatePreparer(context.Context, string, string, string) (*http.Request, error) +1. SubnetsClient.CreateOrUpdateResponder(*http.Response) (Subnet, error) +1. SubnetsClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. SubnetsClient.Get(context.Context, string, string, string) (Subnet, error) +1. SubnetsClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. SubnetsClient.GetResponder(*http.Response) (Subnet, error) +1. SubnetsClient.GetSender(*http.Request) (*http.Response, error) +1. SubnetsClient.ListByEnterprisePolicy(context.Context, string, string) (SubnetListResult, error) +1. SubnetsClient.ListByEnterprisePolicyPreparer(context.Context, string, string) (*http.Request, error) +1. SubnetsClient.ListByEnterprisePolicyResponder(*http.Response) (SubnetListResult, error) +1. SubnetsClient.ListByEnterprisePolicySender(*http.Request) (*http.Response, error) + +### Struct Changes + +#### Removed Structs + +1. ErrorResponseBody +1. OperationList +1. OperationProperties +1. Subnet +1. SubnetEndpointProperty +1. SubnetListResult +1. SubnetsClient + +#### Removed Struct Fields + +1. KeyVaultProperties.Status +1. Operation.*OperationProperties +1. PrivateEndpointConnection.Location +1. PrivateLinkResource.Location +1. PrivateLinkResourceProperties.SystemData +1. Properties.SystemData +1. PropertiesEncryption.KeyVaultProperties +1. PropertiesLockbox.Status +1. ProxyResource.Location +1. Resource.Location +1. SubnetProperties.Status +1. SubnetProperties.Subnet +1. SubnetProperties.SystemData + +### Signature Changes + +#### Const Types + +1. Disabled changed type from Status to State +1. Enabled changed type from Status to State +1. NotConfigured changed type from Status to State + +#### Funcs + +1. EnterprisePoliciesClient.ListByResourceGroup + - Returns + - From: EnterprisePolicyList, error + - To: EnterprisePolicyListPage, error +1. EnterprisePoliciesClient.ListBySubscription + - Returns + - From: EnterprisePolicyList, error + - To: EnterprisePolicyListPage, error +1. EnterprisePoliciesClient.Update + - Params + - From: context.Context, string, string, EnterprisePolicy + - To: context.Context, string, string, PatchEnterprisePolicy +1. EnterprisePoliciesClient.UpdatePreparer + - Params + - From: context.Context, string, string, EnterprisePolicy + - To: context.Context, string, string, PatchEnterprisePolicy +1. OperationsClient.List + - Returns + - From: OperationList, error + - To: OperationListResultPage, error +1. OperationsClient.ListResponder + - Returns + - From: OperationList, error + - To: OperationListResult, error + +#### Struct Fields + +1. ErrorResponse.Error changed type from *ErrorResponseBody to *ErrorDetail +1. Operation.IsDataAction changed type from *string to *bool + +## Additive Changes + +### New Constants + +1. ActionType.Internal +1. EnterprisePolicyKind.EnterprisePolicyKindEncryption +1. EnterprisePolicyKind.EnterprisePolicyKindLockbox +1. EnterprisePolicyKind.EnterprisePolicyKindNetworkInjection +1. EnterprisePolicyKind.EnterprisePolicyKindPrivateEndpoint +1. Origin.OriginSystem +1. Origin.OriginUser +1. Origin.OriginUsersystem + +### New Funcs + +1. *Account.UnmarshalJSON([]byte) error +1. *AccountListIterator.Next() error +1. *AccountListIterator.NextWithContext(context.Context) error +1. *AccountListPage.Next() error +1. *AccountListPage.NextWithContext(context.Context) error +1. *EnterprisePolicyListIterator.Next() error +1. *EnterprisePolicyListIterator.NextWithContext(context.Context) error +1. *EnterprisePolicyListPage.Next() error +1. *EnterprisePolicyListPage.NextWithContext(context.Context) error +1. *OperationListResultIterator.Next() error +1. *OperationListResultIterator.NextWithContext(context.Context) error +1. *OperationListResultPage.Next() error +1. *OperationListResultPage.NextWithContext(context.Context) error +1. *PatchAccount.UnmarshalJSON([]byte) error +1. *PatchEnterprisePolicy.UnmarshalJSON([]byte) error +1. Account.MarshalJSON() ([]byte, error) +1. AccountList.IsEmpty() bool +1. AccountListIterator.NotDone() bool +1. AccountListIterator.Response() AccountList +1. AccountListIterator.Value() Account +1. AccountListPage.NotDone() bool +1. AccountListPage.Response() AccountList +1. AccountListPage.Values() []Account +1. AccountsClient.CreateOrUpdate(context.Context, string, string, Account) (Account, error) +1. AccountsClient.CreateOrUpdatePreparer(context.Context, string, string, Account) (*http.Request, error) +1. AccountsClient.CreateOrUpdateResponder(*http.Response) (Account, error) +1. AccountsClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. AccountsClient.Delete(context.Context, string, string) (autorest.Response, error) +1. AccountsClient.DeletePreparer(context.Context, string, string) (*http.Request, error) +1. AccountsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. AccountsClient.DeleteSender(*http.Request) (*http.Response, error) +1. AccountsClient.Get(context.Context, string, string) (Account, error) +1. AccountsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. AccountsClient.GetResponder(*http.Response) (Account, error) +1. AccountsClient.GetSender(*http.Request) (*http.Response, error) +1. AccountsClient.ListByResourceGroup(context.Context, string) (AccountListPage, error) +1. AccountsClient.ListByResourceGroupComplete(context.Context, string) (AccountListIterator, error) +1. AccountsClient.ListByResourceGroupPreparer(context.Context, string) (*http.Request, error) +1. AccountsClient.ListByResourceGroupResponder(*http.Response) (AccountList, error) +1. AccountsClient.ListByResourceGroupSender(*http.Request) (*http.Response, error) +1. AccountsClient.ListBySubscription(context.Context) (AccountListPage, error) +1. AccountsClient.ListBySubscriptionComplete(context.Context) (AccountListIterator, error) +1. AccountsClient.ListBySubscriptionPreparer(context.Context) (*http.Request, error) +1. AccountsClient.ListBySubscriptionResponder(*http.Response) (AccountList, error) +1. AccountsClient.ListBySubscriptionSender(*http.Request) (*http.Response, error) +1. AccountsClient.Update(context.Context, string, string, PatchAccount) (Account, error) +1. AccountsClient.UpdatePreparer(context.Context, string, string, PatchAccount) (*http.Request, error) +1. AccountsClient.UpdateResponder(*http.Response) (Account, error) +1. AccountsClient.UpdateSender(*http.Request) (*http.Response, error) +1. AzureEntityResource.MarshalJSON() ([]byte, error) +1. EnterprisePoliciesClient.ListByResourceGroupComplete(context.Context, string) (EnterprisePolicyListIterator, error) +1. EnterprisePoliciesClient.ListBySubscriptionComplete(context.Context) (EnterprisePolicyListIterator, error) +1. EnterprisePolicyList.IsEmpty() bool +1. EnterprisePolicyListIterator.NotDone() bool +1. EnterprisePolicyListIterator.Response() EnterprisePolicyList +1. EnterprisePolicyListIterator.Value() EnterprisePolicy +1. EnterprisePolicyListPage.NotDone() bool +1. EnterprisePolicyListPage.Response() EnterprisePolicyList +1. EnterprisePolicyListPage.Values() []EnterprisePolicy +1. ErrorAdditionalInfo.MarshalJSON() ([]byte, error) +1. ErrorDetail.MarshalJSON() ([]byte, error) +1. NewAccountListIterator(AccountListPage) AccountListIterator +1. NewAccountListPage(AccountList, func(context.Context, AccountList) (AccountList, error)) AccountListPage +1. NewAccountsClient(string) AccountsClient +1. NewAccountsClientWithBaseURI(string, string) AccountsClient +1. NewEnterprisePolicyListIterator(EnterprisePolicyListPage) EnterprisePolicyListIterator +1. NewEnterprisePolicyListPage(EnterprisePolicyList, func(context.Context, EnterprisePolicyList) (EnterprisePolicyList, error)) EnterprisePolicyListPage +1. NewOperationListResultIterator(OperationListResultPage) OperationListResultIterator +1. NewOperationListResultPage(OperationListResult, func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage +1. OperationDisplay.MarshalJSON() ([]byte, error) +1. OperationListResult.IsEmpty() bool +1. OperationListResult.MarshalJSON() ([]byte, error) +1. OperationListResultIterator.NotDone() bool +1. OperationListResultIterator.Response() OperationListResult +1. OperationListResultIterator.Value() Operation +1. OperationListResultPage.NotDone() bool +1. OperationListResultPage.Response() OperationListResult +1. OperationListResultPage.Values() []Operation +1. OperationsClient.ListComplete(context.Context) (OperationListResultIterator, error) +1. PatchAccount.MarshalJSON() ([]byte, error) +1. PatchEnterprisePolicy.MarshalJSON() ([]byte, error) +1. PatchTrackedResource.MarshalJSON() ([]byte, error) +1. PossibleActionTypeValues() []ActionType +1. PossibleEnterprisePolicyKindValues() []EnterprisePolicyKind +1. PossibleOriginValues() []Origin +1. PossibleStateValues() []State + +### Struct Changes + +#### New Structs + +1. Account +1. AccountList +1. AccountListIterator +1. AccountListPage +1. AccountProperties +1. AccountsClient +1. AzureEntityResource +1. EnterprisePolicyListIterator +1. EnterprisePolicyListPage +1. ErrorAdditionalInfo +1. ErrorDetail +1. OperationListResult +1. OperationListResultIterator +1. OperationListResultPage +1. PatchAccount +1. PatchEnterprisePolicy +1. PatchTrackedResource +1. PropertiesNetworkInjection +1. VirtualNetworkProperties +1. VirtualNetworkPropertiesList + +#### New Struct Fields + +1. EnterprisePolicy.Kind +1. EnterprisePolicy.SystemData +1. EnterprisePolicyList.NextLink +1. Operation.ActionType +1. Operation.Origin +1. PrivateEndpointConnection.SystemData +1. PrivateLinkResourceProperties.RequiredZoneNames +1. Properties.NetworkInjection +1. PropertiesEncryption.KeyVault +1. PropertiesEncryption.State +1. PropertiesLockbox.State +1. SubnetProperties.Name diff --git a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/_meta.json b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/_meta.json index bd79a7c468f1..f67c207cc7a5 100644 --- a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/_meta.json +++ b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/powerplatform/resource-manager/readme.md", "tag": "package-2020-10-30-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/accounts.go b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/accounts.go new file mode 100644 index 000000000000..1a9641c51879 --- /dev/null +++ b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/accounts.go @@ -0,0 +1,621 @@ +package powerplatform + +// 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" +) + +// AccountsClient is the client for the Accounts methods of the Powerplatform service. +type AccountsClient struct { + BaseClient +} + +// NewAccountsClient creates an instance of the AccountsClient client. +func NewAccountsClient(subscriptionID string) AccountsClient { + return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAccountsClientWithBaseURI creates an instance of the AccountsClient 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 NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { + return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates an account. +// Parameters: +// accountName - name of the account. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// parameters - parameters supplied to create or update an account. +func (client AccountsClient) CreateOrUpdate(ctx context.Context, accountName string, resourceGroupName string, parameters Account) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: 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("powerplatform.AccountsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, accountName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, accountName string, resourceGroupName string, parameters Account) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-10-30-preview" + 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.PowerPlatform/accounts/{accountName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AccountsClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an account. +// Parameters: +// accountName - name of the account. +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client AccountsClient) Delete(ctx context.Context, accountName string, resourceGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.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("powerplatform.AccountsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, accountName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AccountsClient) DeletePreparer(ctx context.Context, accountName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-10-30-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform/accounts/{accountName}", 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 AccountsClient) 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 AccountsClient) 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 information about an account. +// Parameters: +// accountName - name of the account. +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client AccountsClient) Get(ctx context.Context, accountName string, resourceGroupName string) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.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("powerplatform.AccountsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, accountName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AccountsClient) GetPreparer(ctx context.Context, accountName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-10-30-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform/accounts/{accountName}", 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 AccountsClient) 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 AccountsClient) GetResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup retrieve a list of accounts within a given resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.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("powerplatform.AccountsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.al, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.al.hasNextLink() && result.al.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AccountsClient) 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-10-30-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform/accounts", 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 AccountsClient) 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 AccountsClient) ListByResourceGroupResponder(resp *http.Response) (result AccountList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) { + req, err := lastResults.accountListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AccountListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription retrieve a list of accounts within a subscription. +func (client AccountsClient) ListBySubscription(ctx context.Context) (result AccountListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.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("powerplatform.AccountsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.al, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.al.hasNextLink() && result.al.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AccountsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-10-30-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PowerPlatform/accounts", 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 AccountsClient) 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 AccountsClient) ListBySubscriptionResponder(resp *http.Response) (result AccountList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client AccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) { + req, err := lastResults.accountListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListBySubscriptionComplete(ctx context.Context) (result AccountListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") + 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.ListBySubscription(ctx) + return +} + +// Update updates an account. +// Parameters: +// accountName - name of the account. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// parameters - parameters supplied to update an account. +func (client AccountsClient) Update(ctx context.Context, accountName string, resourceGroupName string, parameters PatchAccount) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update") + 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("powerplatform.AccountsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, accountName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.AccountsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AccountsClient) UpdatePreparer(ctx context.Context, accountName string, resourceGroupName string, parameters PatchAccount) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-10-30-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform/accounts/{accountName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, 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/preview/powerplatform/mgmt/2020-10-30/powerplatform/enterprisepolicies.go b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/enterprisepolicies.go index f106287cf62a..95c01f954dc1 100644 --- a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/enterprisepolicies.go +++ b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/enterprisepolicies.go @@ -53,8 +53,7 @@ func (client EnterprisePoliciesClient) CreateOrUpdate(ctx context.Context, enter Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: 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("powerplatform.EnterprisePoliciesClient", "CreateOrUpdate", err.Error()) } @@ -139,8 +138,7 @@ func (client EnterprisePoliciesClient) Delete(ctx context.Context, resourceGroup 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("powerplatform.EnterprisePoliciesClient", "Delete", err.Error()) @@ -226,8 +224,7 @@ func (client EnterprisePoliciesClient) Get(ctx context.Context, enterprisePolicy Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: 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("powerplatform.EnterprisePoliciesClient", "Get", err.Error()) } @@ -295,13 +292,13 @@ func (client EnterprisePoliciesClient) GetResponder(resp *http.Response) (result // ListByResourceGroup retrieve a list of EnterprisePolicies within a given resource group // Parameters: // resourceGroupName - the name of the resource group. The name is case insensitive. -func (client EnterprisePoliciesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result EnterprisePolicyList, err error) { +func (client EnterprisePoliciesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result EnterprisePolicyListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EnterprisePoliciesClient.ListByResourceGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.epl.Response.Response != nil { + sc = result.epl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -311,11 +308,11 @@ func (client EnterprisePoliciesClient) ListByResourceGroup(ctx context.Context, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: 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("powerplatform.EnterprisePoliciesClient", "ListByResourceGroup", err.Error()) } + result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "ListByResourceGroup", nil, "Failure preparing request") @@ -324,16 +321,20 @@ func (client EnterprisePoliciesClient) ListByResourceGroup(ctx context.Context, resp, err := client.ListByResourceGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.epl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "ListByResourceGroup", resp, "Failure sending request") return } - result, err = client.ListByResourceGroupResponder(resp) + result.epl, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "ListByResourceGroup", resp, "Failure responding to request") return } + if result.epl.hasNextLink() && result.epl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } return } @@ -376,14 +377,51 @@ func (client EnterprisePoliciesClient) ListByResourceGroupResponder(resp *http.R return } +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client EnterprisePoliciesClient) listByResourceGroupNextResults(ctx context.Context, lastResults EnterprisePolicyList) (result EnterprisePolicyList, err error) { + req, err := lastResults.enterprisePolicyListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client EnterprisePoliciesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result EnterprisePolicyListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EnterprisePoliciesClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName) + return +} + // ListBySubscription retrieve a list of EnterprisePolicies within a subscription -func (client EnterprisePoliciesClient) ListBySubscription(ctx context.Context) (result EnterprisePolicyList, err error) { +func (client EnterprisePoliciesClient) ListBySubscription(ctx context.Context) (result EnterprisePolicyListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EnterprisePoliciesClient.ListBySubscription") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.epl.Response.Response != nil { + sc = result.epl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -394,6 +432,7 @@ func (client EnterprisePoliciesClient) ListBySubscription(ctx context.Context) ( return result, validation.NewError("powerplatform.EnterprisePoliciesClient", "ListBySubscription", err.Error()) } + result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "ListBySubscription", nil, "Failure preparing request") @@ -402,16 +441,20 @@ func (client EnterprisePoliciesClient) ListBySubscription(ctx context.Context) ( resp, err := client.ListBySubscriptionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.epl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "ListBySubscription", resp, "Failure sending request") return } - result, err = client.ListBySubscriptionResponder(resp) + result.epl, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "ListBySubscription", resp, "Failure responding to request") return } + if result.epl.hasNextLink() && result.epl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } return } @@ -453,12 +496,49 @@ func (client EnterprisePoliciesClient) ListBySubscriptionResponder(resp *http.Re return } +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client EnterprisePoliciesClient) listBySubscriptionNextResults(ctx context.Context, lastResults EnterprisePolicyList) (result EnterprisePolicyList, err error) { + req, err := lastResults.enterprisePolicyListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.EnterprisePoliciesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client EnterprisePoliciesClient) ListBySubscriptionComplete(ctx context.Context) (result EnterprisePolicyListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EnterprisePoliciesClient.ListBySubscription") + 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.ListBySubscription(ctx) + return +} + // Update updates an EnterprisePolicy // Parameters: // enterprisePolicyName - name of the EnterprisePolicy. // resourceGroupName - the name of the resource group. The name is case insensitive. // parameters - parameters supplied to update EnterprisePolicy. -func (client EnterprisePoliciesClient) Update(ctx context.Context, enterprisePolicyName string, resourceGroupName string, parameters EnterprisePolicy) (result EnterprisePolicy, err error) { +func (client EnterprisePoliciesClient) Update(ctx context.Context, enterprisePolicyName string, resourceGroupName string, parameters PatchEnterprisePolicy) (result EnterprisePolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EnterprisePoliciesClient.Update") defer func() { @@ -474,8 +554,7 @@ func (client EnterprisePoliciesClient) Update(ctx context.Context, enterprisePol Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: 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("powerplatform.EnterprisePoliciesClient", "Update", err.Error()) } @@ -502,7 +581,7 @@ func (client EnterprisePoliciesClient) Update(ctx context.Context, enterprisePol } // UpdatePreparer prepares the Update request. -func (client EnterprisePoliciesClient) UpdatePreparer(ctx context.Context, enterprisePolicyName string, resourceGroupName string, parameters EnterprisePolicy) (*http.Request, error) { +func (client EnterprisePoliciesClient) UpdatePreparer(ctx context.Context, enterprisePolicyName string, resourceGroupName string, parameters PatchEnterprisePolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ "enterprisePolicyName": autorest.Encode("path", enterprisePolicyName), "resourceGroupName": autorest.Encode("path", resourceGroupName), diff --git a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/enums.go b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/enums.go index bcdd116de75e..3a8e2120b7a5 100644 --- a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/enums.go +++ b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/enums.go @@ -6,6 +6,19 @@ package powerplatform // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // Internal ... + Internal ActionType = "Internal" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{Internal} +} + // CreatedByType enumerates the values for created by type. type CreatedByType string @@ -25,6 +38,42 @@ func PossibleCreatedByTypeValues() []CreatedByType { return []CreatedByType{Application, Key, ManagedIdentity, User} } +// EnterprisePolicyKind enumerates the values for enterprise policy kind. +type EnterprisePolicyKind string + +const ( + // EnterprisePolicyKindEncryption ... + EnterprisePolicyKindEncryption EnterprisePolicyKind = "Encryption" + // EnterprisePolicyKindLockbox ... + EnterprisePolicyKindLockbox EnterprisePolicyKind = "Lockbox" + // EnterprisePolicyKindNetworkInjection ... + EnterprisePolicyKindNetworkInjection EnterprisePolicyKind = "NetworkInjection" + // EnterprisePolicyKindPrivateEndpoint ... + EnterprisePolicyKindPrivateEndpoint EnterprisePolicyKind = "PrivateEndpoint" +) + +// PossibleEnterprisePolicyKindValues returns an array of possible values for the EnterprisePolicyKind const type. +func PossibleEnterprisePolicyKindValues() []EnterprisePolicyKind { + return []EnterprisePolicyKind{EnterprisePolicyKindEncryption, EnterprisePolicyKindLockbox, EnterprisePolicyKindNetworkInjection, EnterprisePolicyKindPrivateEndpoint} +} + +// Origin enumerates the values for origin. +type Origin string + +const ( + // OriginSystem ... + OriginSystem Origin = "system" + // OriginUser ... + OriginUser Origin = "user" + // OriginUsersystem ... + OriginUsersystem Origin = "user,system" +) + +// PossibleOriginValues returns an array of possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{OriginSystem, OriginUser, OriginUsersystem} +} + // PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection // provisioning state. type PrivateEndpointConnectionProvisioningState string @@ -77,19 +126,19 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return []ResourceIdentityType{None, SystemAssigned} } -// Status enumerates the values for status. -type Status string +// State enumerates the values for state. +type State string const ( // Disabled ... - Disabled Status = "Disabled" + Disabled State = "Disabled" // Enabled ... - Enabled Status = "Enabled" + Enabled State = "Enabled" // NotConfigured ... - NotConfigured Status = "NotConfigured" + NotConfigured State = "NotConfigured" ) -// PossibleStatusValues returns an array of possible values for the Status const type. -func PossibleStatusValues() []Status { - return []Status{Disabled, Enabled, NotConfigured} +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{Disabled, Enabled, NotConfigured} } diff --git a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/models.go b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/models.go index 93a96810a5ea..bad52f9b751a 100644 --- a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/models.go +++ b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/models.go @@ -12,28 +12,332 @@ import ( "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/preview/powerplatform/mgmt/2020-10-30/powerplatform" +// Account definition of the account. +type Account struct { + autorest.Response `json:"-"` + // AccountProperties - The properties that define configuration for the account. + *AccountProperties `json:"properties,omitempty"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,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 Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties + } + if a.SystemData != nil { + objectMap["systemData"] = a.SystemData + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Account struct. +func (a *Account) 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 accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + a.SystemData = &systemData + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// AccountList the response of the list accounts operation. +type AccountList struct { + autorest.Response `json:"-"` + // Value - Result of the list accounts operation. + Value *[]Account `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// AccountListIterator provides access to a complete listing of Account values. +type AccountListIterator struct { + i int + page AccountListPage +} + +// 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 *AccountListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListIterator.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 *AccountListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AccountListIterator) 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 AccountListIterator) Response() AccountList { + 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 AccountListIterator) Value() Account { + if !iter.page.NotDone() { + return Account{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AccountListIterator type. +func NewAccountListIterator(page AccountListPage) AccountListIterator { + return AccountListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al AccountList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (al AccountList) hasNextLink() bool { + return al.NextLink != nil && len(*al.NextLink) != 0 +} + +// accountListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al AccountList) accountListPreparer(ctx context.Context) (*http.Request, error) { + if !al.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// AccountListPage contains a page of Account values. +type AccountListPage struct { + fn func(context.Context, AccountList) (AccountList, error) + al AccountList +} + +// 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 *AccountListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListPage.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.al) + if err != nil { + return err + } + page.al = 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 *AccountListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AccountListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AccountListPage) Response() AccountList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AccountListPage) Values() []Account { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the AccountListPage type. +func NewAccountListPage(cur AccountList, getNextPage func(context.Context, AccountList) (AccountList, error)) AccountListPage { + return AccountListPage{ + fn: getNextPage, + al: cur, + } +} + +// AccountProperties the properties that define configuration for the account. +type AccountProperties struct { + // Description - The description of the account. + Description *string `json:"description,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) +} + // EnterprisePolicy definition of the EnterprisePolicy. type EnterprisePolicy struct { autorest.Response `json:"-"` // Identity - The identity of the EnterprisePolicy. Identity *EnterprisePolicyIdentity `json:"identity,omitempty"` + // Kind - The kind (type) of Enterprise Policy. Possible values include: 'EnterprisePolicyKindLockbox', 'EnterprisePolicyKindPrivateEndpoint', 'EnterprisePolicyKindEncryption', 'EnterprisePolicyKindNetworkInjection' + Kind EnterprisePolicyKind `json:"kind,omitempty"` // Properties - The properties that define configuration for the enterprise policy *Properties `json:"properties,omitempty"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // ID - READ-ONLY; ARM resource id of the EnterprisePolicy. + // 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; Name of the EnterprisePolicy. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Region where the EnterprisePolicy is located. - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; The type of the resource. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -43,12 +347,21 @@ func (ep EnterprisePolicy) MarshalJSON() ([]byte, error) { if ep.Identity != nil { objectMap["identity"] = ep.Identity } + if ep.Kind != "" { + objectMap["kind"] = ep.Kind + } if ep.Properties != nil { objectMap["properties"] = ep.Properties } + if ep.SystemData != nil { + objectMap["systemData"] = ep.SystemData + } if ep.Tags != nil { objectMap["tags"] = ep.Tags } + if ep.Location != nil { + objectMap["location"] = ep.Location + } return json.Marshal(objectMap) } @@ -68,43 +381,741 @@ func (ep *EnterprisePolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - ep.Identity = &identity + ep.Identity = &identity + } + case "kind": + if v != nil { + var kind EnterprisePolicyKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ep.Kind = kind + } + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + ep.Properties = &properties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + ep.SystemData = &systemData + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ep.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ep.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ep.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ep.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ep.Type = &typeVar + } + } + } + + return nil +} + +// EnterprisePolicyIdentity the identity of the EnterprisePolicy. +type EnterprisePolicyIdentity struct { + // SystemAssignedIdentityPrincipalID - READ-ONLY; The principal id of EnterprisePolicy identity. + SystemAssignedIdentityPrincipalID *string `json:"systemAssignedIdentityPrincipalId,omitempty"` + // TenantID - READ-ONLY; The tenant id associated with the EnterprisePolicy. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the EnterprisePolicy. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Possible values include: 'SystemAssigned', 'None' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EnterprisePolicyIdentity. +func (epi EnterprisePolicyIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if epi.Type != "" { + objectMap["type"] = epi.Type + } + return json.Marshal(objectMap) +} + +// EnterprisePolicyList the response of the list EnterprisePolicy operation. +type EnterprisePolicyList struct { + autorest.Response `json:"-"` + // Value - Result of the list EnterprisePolicy operation. + Value *[]EnterprisePolicy `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// EnterprisePolicyListIterator provides access to a complete listing of EnterprisePolicy values. +type EnterprisePolicyListIterator struct { + i int + page EnterprisePolicyListPage +} + +// 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 *EnterprisePolicyListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EnterprisePolicyListIterator.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 *EnterprisePolicyListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EnterprisePolicyListIterator) 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 EnterprisePolicyListIterator) Response() EnterprisePolicyList { + 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 EnterprisePolicyListIterator) Value() EnterprisePolicy { + if !iter.page.NotDone() { + return EnterprisePolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EnterprisePolicyListIterator type. +func NewEnterprisePolicyListIterator(page EnterprisePolicyListPage) EnterprisePolicyListIterator { + return EnterprisePolicyListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (epl EnterprisePolicyList) IsEmpty() bool { + return epl.Value == nil || len(*epl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (epl EnterprisePolicyList) hasNextLink() bool { + return epl.NextLink != nil && len(*epl.NextLink) != 0 +} + +// enterprisePolicyListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (epl EnterprisePolicyList) enterprisePolicyListPreparer(ctx context.Context) (*http.Request, error) { + if !epl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(epl.NextLink))) +} + +// EnterprisePolicyListPage contains a page of EnterprisePolicy values. +type EnterprisePolicyListPage struct { + fn func(context.Context, EnterprisePolicyList) (EnterprisePolicyList, error) + epl EnterprisePolicyList +} + +// 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 *EnterprisePolicyListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EnterprisePolicyListPage.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.epl) + if err != nil { + return err + } + page.epl = 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 *EnterprisePolicyListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EnterprisePolicyListPage) NotDone() bool { + return !page.epl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EnterprisePolicyListPage) Response() EnterprisePolicyList { + return page.epl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EnterprisePolicyListPage) Values() []EnterprisePolicy { + if page.epl.IsEmpty() { + return nil + } + return *page.epl.Value +} + +// Creates a new instance of the EnterprisePolicyListPage type. +func NewEnterprisePolicyListPage(cur EnterprisePolicyList, getNextPage func(context.Context, EnterprisePolicyList) (EnterprisePolicyList, error)) EnterprisePolicyListPage { + return EnterprisePolicyListPage{ + fn: getNextPage, + epl: cur, + } +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorDetail the error detail. +type ErrorDetail struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorDetail `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.). +type ErrorResponse struct { + // Error - The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + +// KeyProperties url and version of the KeyVault Secret +type KeyProperties struct { + // Name - The identifier of the key vault key used to encrypt data. + Name *string `json:"name,omitempty"` + // Version - The version of the identity which will be used to access key vault. + Version *string `json:"version,omitempty"` +} + +// KeyVaultProperties settings concerning key vault encryption for a configuration store. +type KeyVaultProperties struct { + // ID - Uri of KeyVault + ID *string `json:"id,omitempty"` + // Key - Identity of the secret that includes name and version. + Key *KeyProperties `json:"key,omitempty"` +} + +// Operation details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Name - READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + Name *string `json:"name,omitempty"` + // IsDataAction - READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + IsDataAction *bool `json:"isDataAction,omitempty"` + // Display - Localized display information for this particular operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". Possible values include: 'OriginUser', 'OriginSystem', 'OriginUsersystem' + Origin Origin `json:"origin,omitempty"` + // ActionType - READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. Possible values include: 'Internal' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Display != nil { + objectMap["display"] = o.Display + } + return json.Marshal(objectMap) +} + +// OperationDisplay localized display information for this particular operation. +type OperationDisplay struct { + // Provider - READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationListResult a list of REST API operations supported by an Azure Resource Provider. It contains +// an URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of operations supported by the resource provider + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationListResult. +func (olr OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// 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 *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.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 *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) 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 OperationListResultIterator) Response() OperationListResult { + 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 OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !olr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// 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 *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.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.olr) + if err != nil { + return err + } + page.olr = 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 *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } +} + +// PatchAccount definition of the account. +type PatchAccount struct { + // AccountProperties - The properties that define configuration for the account. + *AccountProperties `json:"properties,omitempty"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,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 PatchAccount. +func (pa PatchAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pa.AccountProperties != nil { + objectMap["properties"] = pa.AccountProperties + } + if pa.SystemData != nil { + objectMap["systemData"] = pa.SystemData + } + if pa.Tags != nil { + objectMap["tags"] = pa.Tags + } + if pa.Location != nil { + objectMap["location"] = pa.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PatchAccount struct. +func (pa *PatchAccount) 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 accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + pa.AccountProperties = &accountProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + pa.SystemData = &systemData + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pa.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pa.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pa.Type = &typeVar + } + } + } + + return nil +} + +// PatchEnterprisePolicy definition of the EnterprisePolicy. +type PatchEnterprisePolicy struct { + // Identity - The identity of the EnterprisePolicy. + Identity *EnterprisePolicyIdentity `json:"identity,omitempty"` + // Kind - The kind (type) of Enterprise Policy. Possible values include: 'EnterprisePolicyKindLockbox', 'EnterprisePolicyKindPrivateEndpoint', 'EnterprisePolicyKindEncryption', 'EnterprisePolicyKindNetworkInjection' + Kind EnterprisePolicyKind `json:"kind,omitempty"` + // Properties - The properties that define configuration for the enterprise policy + *Properties `json:"properties,omitempty"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,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 PatchEnterprisePolicy. +func (pep PatchEnterprisePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pep.Identity != nil { + objectMap["identity"] = pep.Identity + } + if pep.Kind != "" { + objectMap["kind"] = pep.Kind + } + if pep.Properties != nil { + objectMap["properties"] = pep.Properties + } + if pep.SystemData != nil { + objectMap["systemData"] = pep.SystemData + } + if pep.Tags != nil { + objectMap["tags"] = pep.Tags + } + if pep.Location != nil { + objectMap["location"] = pep.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PatchEnterprisePolicy struct. +func (pep *PatchEnterprisePolicy) 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 "identity": + if v != nil { + var identity EnterprisePolicyIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + pep.Identity = &identity } - case "properties": + case "kind": if v != nil { - var properties Properties - err = json.Unmarshal(*v, &properties) + var kind EnterprisePolicyKind + err = json.Unmarshal(*v, &kind) if err != nil { return err } - ep.Properties = &properties + pep.Kind = kind } - case "tags": + case "properties": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var properties Properties + err = json.Unmarshal(*v, &properties) if err != nil { return err } - ep.Tags = tags + pep.Properties = &properties } - case "id": + case "systemData": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var systemData SystemData + err = json.Unmarshal(*v, &systemData) if err != nil { return err } - ep.ID = &ID + pep.SystemData = &systemData } - case "name": + case "tags": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var tags map[string]*string + err = json.Unmarshal(*v, &tags) if err != nil { return err } - ep.Name = &name + pep.Tags = tags } case "location": if v != nil { @@ -113,122 +1124,17 @@ func (ep *EnterprisePolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - ep.Location = &location + pep.Location = &location } - case "type": + case "id": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - ep.Type = &typeVar + pep.ID = &ID } - } - } - - return nil -} - -// EnterprisePolicyIdentity the identity of the EnterprisePolicy. -type EnterprisePolicyIdentity struct { - // SystemAssignedIdentityPrincipalID - READ-ONLY; The principal id of EnterprisePolicy identity. - SystemAssignedIdentityPrincipalID *string `json:"systemAssignedIdentityPrincipalId,omitempty"` - // TenantID - READ-ONLY; The tenant id associated with the EnterprisePolicy. - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the EnterprisePolicy. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Possible values include: 'SystemAssigned', 'None' - Type ResourceIdentityType `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for EnterprisePolicyIdentity. -func (epi EnterprisePolicyIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if epi.Type != "" { - objectMap["type"] = epi.Type - } - return json.Marshal(objectMap) -} - -// EnterprisePolicyList the response of the list EnterprisePolicy operation. -type EnterprisePolicyList struct { - autorest.Response `json:"-"` - // Value - Result of the list EnterprisePolicy operation. - Value *[]EnterprisePolicy `json:"value,omitempty"` -} - -// ErrorResponse ARM error response body. -type ErrorResponse struct { - // Error - Details about the error. - Error *ErrorResponseBody `json:"error,omitempty"` -} - -// ErrorResponseBody an error response from the PowerPlatform service. -type ErrorResponseBody struct { - // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Target - The target of the particular error. For example, the name of the property in error. - Target *string `json:"target,omitempty"` -} - -// KeyProperties url and version of the KeyVault Secret -type KeyProperties struct { - // Name - The identifier of the key vault key used to encrypt data. - Name *string `json:"name,omitempty"` - // Version - The version of the identity which will be used to access key vault. - Version *string `json:"version,omitempty"` -} - -// KeyVaultProperties settings concerning key vault encryption for a configuration store. -type KeyVaultProperties struct { - // ID - Uri of KeyVault - ID *string `json:"id,omitempty"` - // Key - Identity of the secret that includes name and version. - Key *KeyProperties `json:"key,omitempty"` - // Status - The state of onboarding, which only appears in the response. Possible values include: 'Enabled', 'Disabled', 'NotConfigured' - Status Status `json:"status,omitempty"` -} - -// Operation powerPlatform REST API operation -type Operation struct { - // Name - Operation name: For ex. providers/Microsoft.PowerPlatform/enterprisePolicies/write or read - Name *string `json:"name,omitempty"` - // IsDataAction - Indicates whether the operation is a data action - IsDataAction *string `json:"isDataAction,omitempty"` - // Display - Provider, Resource, Operation and description values. - Display *OperationDisplay `json:"display,omitempty"` - // OperationProperties - Provider, Resource, Operation and description values. - *OperationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if o.Name != nil { - objectMap["name"] = o.Name - } - if o.IsDataAction != nil { - objectMap["isDataAction"] = o.IsDataAction - } - if o.Display != nil { - objectMap["display"] = o.Display - } - if o.OperationProperties != nil { - objectMap["properties"] = o.OperationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Operation struct. -func (o *Operation) 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 "name": if v != nil { var name string @@ -236,34 +1142,16 @@ func (o *Operation) UnmarshalJSON(body []byte) error { if err != nil { return err } - o.Name = &name - } - case "isDataAction": - if v != nil { - var isDataAction string - err = json.Unmarshal(*v, &isDataAction) - if err != nil { - return err - } - o.IsDataAction = &isDataAction - } - case "display": - if v != nil { - var display OperationDisplay - err = json.Unmarshal(*v, &display) - if err != nil { - return err - } - o.Display = &display + pep.Name = &name } - case "properties": + case "type": if v != nil { - var operationProperties OperationProperties - err = json.Unmarshal(*v, &operationProperties) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - o.OperationProperties = &operationProperties + pep.Type = &typeVar } } } @@ -271,29 +1159,31 @@ func (o *Operation) UnmarshalJSON(body []byte) error { return nil } -// OperationDisplay provider, Resource, Operation and description values. -type OperationDisplay struct { - // Provider - Service provider: Microsoft.PowerPlatform - Provider *string `json:"provider,omitempty"` - // Resource - Resource on which the operation is performed. - Resource *string `json:"resource,omitempty"` - // Operation - Operation type: Read, write, delete, etc. - Operation *string `json:"operation,omitempty"` - // Description - Description about operation. - Description *string `json:"description,omitempty"` -} - -// OperationList the response model for the list of PowerPlatform operations -type OperationList struct { - autorest.Response `json:"-"` - // Value - List of PowerPlatform operations supported by the PowerPlatform resource provider. - Value *[]Operation `json:"value,omitempty"` +// PatchTrackedResource the resource model definition for an Azure Resource Manager tracked top level +// resource which has 'tags' and a 'location' +type PatchTrackedResource 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"` } -// OperationProperties provider, Resource, Operation and description values. -type OperationProperties struct { - // StatusCode - Service provider: Microsoft.PowerPlatform - StatusCode *string `json:"statusCode,omitempty"` +// MarshalJSON is the custom marshaler for PatchTrackedResource. +func (ptr PatchTrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ptr.Tags != nil { + objectMap["tags"] = ptr.Tags + } + if ptr.Location != nil { + objectMap["location"] = ptr.Location + } + return json.Marshal(objectMap) } // PrivateEndpoint the Private Endpoint resource. @@ -313,13 +1203,13 @@ type PrivateEndpointConnection struct { autorest.Response `json:"-"` // PrivateEndpointConnectionProperties - Resource properties. *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; ARM resource id of the EnterprisePolicy. + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,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; Name of the EnterprisePolicy. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Region where the EnterprisePolicy is located. - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; The type of the resource. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -329,6 +1219,9 @@ func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { if pec.PrivateEndpointConnectionProperties != nil { objectMap["properties"] = pec.PrivateEndpointConnectionProperties } + if pec.SystemData != nil { + objectMap["systemData"] = pec.SystemData + } return json.Marshal(objectMap) } @@ -350,6 +1243,15 @@ func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { } pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + pec.SystemData = &systemData + } case "id": if v != nil { var ID string @@ -368,15 +1270,6 @@ func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { } pec.Name = &name } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pec.Location = &location - } case "type": if v != nil { var typeVar string @@ -494,13 +1387,11 @@ type PrivateLinkResource struct { autorest.Response `json:"-"` // PrivateLinkResourceProperties - Resource properties. *PrivateLinkResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; ARM resource id of the EnterprisePolicy. + // 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; Name of the EnterprisePolicy. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Region where the EnterprisePolicy is located. - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; The type of the resource. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -549,15 +1440,6 @@ func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { } plr.Name = &name } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - plr.Location = &location - } case "type": if v != nil { var typeVar string @@ -586,15 +1468,15 @@ type PrivateLinkResourceProperties struct { GroupID *string `json:"groupId,omitempty"` // RequiredMembers - READ-ONLY; The private link resource required member names. RequiredMembers *[]string `json:"requiredMembers,omitempty"` - // SystemData - Metadata for the private link resource. - SystemData *SystemData `json:"systemData,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.SystemData != nil { - objectMap["systemData"] = plrp.SystemData + if plrp.RequiredZoneNames != nil { + objectMap["requiredZoneNames"] = plrp.RequiredZoneNames } return json.Marshal(objectMap) } @@ -616,31 +1498,38 @@ type Properties struct { Lockbox *PropertiesLockbox `json:"lockbox,omitempty"` // Encryption - The encryption settings for a configuration store. Encryption *PropertiesEncryption `json:"encryption,omitempty"` - // SystemData - Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty"` + // NetworkInjection - Settings concerning network injection. + NetworkInjection *PropertiesNetworkInjection `json:"networkInjection,omitempty"` } // PropertiesEncryption the encryption settings for a configuration store. type PropertiesEncryption struct { - // KeyVaultProperties - Key vault properties. - KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + // KeyVault - Key vault properties. + KeyVault *KeyVaultProperties `json:"keyVault,omitempty"` + // State - The state of onboarding, which only appears in the response. Possible values include: 'Enabled', 'Disabled', 'NotConfigured' + State State `json:"state,omitempty"` } // PropertiesLockbox settings concerning lockbox. type PropertiesLockbox struct { - // Status - lockbox configuration. Possible values include: 'Enabled', 'Disabled', 'NotConfigured' - Status Status `json:"status,omitempty"` + // State - lockbox configuration. Possible values include: 'Enabled', 'Disabled', 'NotConfigured' + State State `json:"state,omitempty"` +} + +// PropertiesNetworkInjection settings concerning network injection. +type PropertiesNetworkInjection struct { + // VirtualNetworks - Network injection configuration + VirtualNetworks *VirtualNetworkPropertiesList `json:"virtualNetworks,omitempty"` } -// ProxyResource ARM proxy resource. +// 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; ARM resource id of the EnterprisePolicy. + // 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; Name of the EnterprisePolicy. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Region where the EnterprisePolicy is located. - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; The type of the resource. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -650,15 +1539,13 @@ func (pr ProxyResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Resource the core properties of ARM resources +// Resource common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { - // ID - READ-ONLY; ARM resource id of the EnterprisePolicy. + // 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; Name of the EnterprisePolicy. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Region where the EnterprisePolicy is located. - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; The type of the resource. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -668,111 +1555,10 @@ func (r Resource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// Subnet a subnet -type Subnet struct { - autorest.Response `json:"-"` - // SubnetProperties - Resource properties. - *SubnetProperties `json:"properties,omitempty"` - // ID - READ-ONLY; ARM resource id of the EnterprisePolicy. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Name of the EnterprisePolicy. - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Region where the EnterprisePolicy is located. - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Subnet. -func (s Subnet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.SubnetProperties != nil { - objectMap["properties"] = s.SubnetProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Subnet struct. -func (s *Subnet) 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 subnetProperties SubnetProperties - err = json.Unmarshal(*v, &subnetProperties) - if err != nil { - return err - } - s.SubnetProperties = &subnetProperties - } - 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 "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - s.Location = &location - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - s.Type = &typeVar - } - } - } - - return nil -} - -// SubnetEndpointProperty endpoint of the subnet. -type SubnetEndpointProperty struct { - // ID - Resource id of the subnet. - ID *string `json:"id,omitempty"` -} - -// SubnetListResult a list of subnets -type SubnetListResult struct { - autorest.Response `json:"-"` - // Value - Array of subnets - Value *[]Subnet `json:"value,omitempty"` -} - // SubnetProperties properties of a subnet. type SubnetProperties struct { - // Subnet - Endpoint of the subnet. - Subnet *SubnetEndpointProperty `json:"subnet,omitempty"` - // Status - Connection State of the subnet. Possible values include: 'Enabled', 'Disabled', 'NotConfigured' - Status Status `json:"status,omitempty"` - // SystemData - Metadata for the subnet. - SystemData *SystemData `json:"systemData,omitempty"` + // Name - Subnet name. + Name *string `json:"name,omitempty"` } // SystemData metadata pertaining to creation and last modification of the resource. @@ -787,21 +1573,22 @@ type SystemData struct { LastModifiedBy *string `json:"lastModifiedBy,omitempty"` // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` - // LastModifiedAt - The type of identity that last modified the resource. + // LastModifiedAt - The timestamp of resource last modification (UTC) LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` } -// TrackedResource the resource model definition for a ARM tracked top level resource +// 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"` - // ID - READ-ONLY; ARM resource id of the EnterprisePolicy. + // 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; Name of the EnterprisePolicy. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Region where the EnterprisePolicy is located. - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; The type of the resource. + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty"` } @@ -811,5 +1598,24 @@ func (tr TrackedResource) MarshalJSON() ([]byte, error) { if tr.Tags != nil { objectMap["tags"] = tr.Tags } + if tr.Location != nil { + objectMap["location"] = tr.Location + } return json.Marshal(objectMap) } + +// VirtualNetworkProperties settings concerning the virtual network. +type VirtualNetworkProperties struct { + // ID - Uri of the virtual network. + ID *string `json:"id,omitempty"` + // Subnet - Properties of a subnet. + Subnet *SubnetProperties `json:"subnet,omitempty"` +} + +// VirtualNetworkPropertiesList a list of private link resources +type VirtualNetworkPropertiesList struct { + // Value - Array of virtual networks. + Value *[]VirtualNetworkProperties `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} diff --git a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/operations.go b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/operations.go index b90866bb9da6..f6836555a0be 100644 --- a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/operations.go +++ b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/operations.go @@ -31,17 +31,18 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera } // List lists all of the available PowerPlatform REST API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationList, err error) { +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } + result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "powerplatform.OperationsClient", "List", nil, "Failure preparing request") @@ -50,16 +51,20 @@ func (client OperationsClient) List(ctx context.Context) (result OperationList, resp, err := client.ListSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.olr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "powerplatform.OperationsClient", "List", resp, "Failure sending request") return } - result, err = client.ListResponder(resp) + result.olr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "powerplatform.OperationsClient", "List", resp, "Failure responding to request") return } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } return } @@ -87,7 +92,7 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationList, err error) { +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -96,3 +101,40 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Operat result.Response = autorest.Response{Response: resp} return } + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "powerplatform.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, "powerplatform.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerplatform.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 OperationListResultIterator, 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/preview/powerplatform/mgmt/2020-10-30/powerplatform/powerplatformapi/interfaces.go b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/powerplatformapi/interfaces.go index 27a068c4b95d..3ffcbe035b58 100644 --- a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/powerplatformapi/interfaces.go +++ b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/powerplatformapi/interfaces.go @@ -12,21 +12,38 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CreateOrUpdate(ctx context.Context, accountName string, resourceGroupName string, parameters powerplatform.Account) (result powerplatform.Account, err error) + Delete(ctx context.Context, accountName string, resourceGroupName string) (result autorest.Response, err error) + Get(ctx context.Context, accountName string, resourceGroupName string) (result powerplatform.Account, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result powerplatform.AccountListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result powerplatform.AccountListIterator, err error) + ListBySubscription(ctx context.Context) (result powerplatform.AccountListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result powerplatform.AccountListIterator, err error) + Update(ctx context.Context, accountName string, resourceGroupName string, parameters powerplatform.PatchAccount) (result powerplatform.Account, err error) +} + +var _ AccountsClientAPI = (*powerplatform.AccountsClient)(nil) + // EnterprisePoliciesClientAPI contains the set of methods on the EnterprisePoliciesClient type. type EnterprisePoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, enterprisePolicyName string, resourceGroupName string, parameters powerplatform.EnterprisePolicy) (result powerplatform.EnterprisePolicy, err error) Delete(ctx context.Context, resourceGroupName string, enterprisePolicyName string) (result autorest.Response, err error) Get(ctx context.Context, enterprisePolicyName string, resourceGroupName string) (result powerplatform.EnterprisePolicy, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string) (result powerplatform.EnterprisePolicyList, err error) - ListBySubscription(ctx context.Context) (result powerplatform.EnterprisePolicyList, err error) - Update(ctx context.Context, enterprisePolicyName string, resourceGroupName string, parameters powerplatform.EnterprisePolicy) (result powerplatform.EnterprisePolicy, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result powerplatform.EnterprisePolicyListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result powerplatform.EnterprisePolicyListIterator, err error) + ListBySubscription(ctx context.Context) (result powerplatform.EnterprisePolicyListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result powerplatform.EnterprisePolicyListIterator, err error) + Update(ctx context.Context, enterprisePolicyName string, resourceGroupName string, parameters powerplatform.PatchEnterprisePolicy) (result powerplatform.EnterprisePolicy, err error) } var _ EnterprisePoliciesClientAPI = (*powerplatform.EnterprisePoliciesClient)(nil) // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { - List(ctx context.Context) (result powerplatform.OperationList, err error) + List(ctx context.Context) (result powerplatform.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result powerplatform.OperationListResultIterator, err error) } var _ OperationsClientAPI = (*powerplatform.OperationsClient)(nil) @@ -48,12 +65,3 @@ type PrivateLinkResourcesClientAPI interface { } var _ PrivateLinkResourcesClientAPI = (*powerplatform.PrivateLinkResourcesClient)(nil) - -// SubnetsClientAPI contains the set of methods on the SubnetsClient type. -type SubnetsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, enterprisePolicyName string, subnetName string) (result powerplatform.Subnet, err error) - Get(ctx context.Context, resourceGroupName string, enterprisePolicyName string, subnetName string) (result powerplatform.Subnet, err error) - ListByEnterprisePolicy(ctx context.Context, resourceGroupName string, enterprisePolicyName string) (result powerplatform.SubnetListResult, err error) -} - -var _ SubnetsClientAPI = (*powerplatform.SubnetsClient)(nil) diff --git a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/privateendpointconnections.go b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/privateendpointconnections.go index 811ec7b21811..77d5fbf3dbb4 100644 --- a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/privateendpointconnections.go +++ b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/privateendpointconnections.go @@ -55,8 +55,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: 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.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { @@ -151,8 +150,7 @@ func (client PrivateEndpointConnectionsClient) Delete(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("powerplatform.PrivateEndpointConnectionsClient", "Delete", err.Error()) } @@ -241,8 +239,7 @@ func (client PrivateEndpointConnectionsClient) Get(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("powerplatform.PrivateEndpointConnectionsClient", "Get", err.Error()) } @@ -328,8 +325,7 @@ func (client PrivateEndpointConnectionsClient) ListByEnterprisePolicy(ctx contex Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: 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("powerplatform.PrivateEndpointConnectionsClient", "ListByEnterprisePolicy", err.Error()) } diff --git a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/privatelinkresources.go b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/privatelinkresources.go index 74bc5a30d9c5..4da56fb563a6 100644 --- a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/privatelinkresources.go +++ b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/privatelinkresources.go @@ -53,8 +53,7 @@ func (client PrivateLinkResourcesClient) Get(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("powerplatform.PrivateLinkResourcesClient", "Get", err.Error()) } @@ -140,8 +139,7 @@ func (client PrivateLinkResourcesClient) ListByEnterprisePolicy(ctx context.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("powerplatform.PrivateLinkResourcesClient", "ListByEnterprisePolicy", err.Error()) } diff --git a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/subnets.go b/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/subnets.go deleted file mode 100644 index d40a6f938c6b..000000000000 --- a/services/preview/powerplatform/mgmt/2020-10-30/powerplatform/subnets.go +++ /dev/null @@ -1,294 +0,0 @@ -package powerplatform - -// 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" -) - -// SubnetsClient is the client for the Subnets methods of the Powerplatform service. -type SubnetsClient struct { - BaseClient -} - -// NewSubnetsClient creates an instance of the SubnetsClient client. -func NewSubnetsClient(subscriptionID string) SubnetsClient { - return NewSubnetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSubnetsClientWithBaseURI creates an instance of the SubnetsClient 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 NewSubnetsClientWithBaseURI(baseURI string, subscriptionID string) SubnetsClient { - return SubnetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate description of the Subnet that PowerPlatform resources can access. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// enterprisePolicyName - enterprisePolicy for the Microsoft Azure subscription. -// subnetName - the name of the subnet. -func (client SubnetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, enterprisePolicyName string, subnetName string) (result Subnet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: 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}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("powerplatform.SubnetsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, enterprisePolicyName, subnetName) - if err != nil { - err = autorest.NewErrorWithError(err, "powerplatform.SubnetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "powerplatform.SubnetsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "powerplatform.SubnetsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, enterprisePolicyName string, subnetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "enterprisePolicyName": autorest.Encode("path", enterprisePolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-10-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform/enterprisePolicies/{enterprisePolicyName}/subnets/{subnetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result Subnet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get description of Subnets that are authorized for outbound calls from PowerPlatform. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// enterprisePolicyName - enterprisePolicy for the Microsoft Azure subscription. -// subnetName - the name of the subnet. -func (client SubnetsClient) Get(ctx context.Context, resourceGroupName string, enterprisePolicyName string, subnetName string) (result Subnet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.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}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("powerplatform.SubnetsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, enterprisePolicyName, subnetName) - if err != nil { - err = autorest.NewErrorWithError(err, "powerplatform.SubnetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "powerplatform.SubnetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "powerplatform.SubnetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SubnetsClient) GetPreparer(ctx context.Context, resourceGroupName string, enterprisePolicyName string, subnetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "enterprisePolicyName": autorest.Encode("path", enterprisePolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-10-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform/enterprisePolicies/{enterprisePolicyName}/subnets/{subnetName}", 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 SubnetsClient) 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 SubnetsClient) GetResponder(resp *http.Response) (result Subnet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByEnterprisePolicy retrieve a list of subnets within a given enterprisePolicy -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// enterprisePolicyName - enterprisePolicy for the Microsoft Azure subscription. -func (client SubnetsClient) ListByEnterprisePolicy(ctx context.Context, resourceGroupName string, enterprisePolicyName string) (result SubnetListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.ListByEnterprisePolicy") - 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}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("powerplatform.SubnetsClient", "ListByEnterprisePolicy", err.Error()) - } - - req, err := client.ListByEnterprisePolicyPreparer(ctx, resourceGroupName, enterprisePolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "powerplatform.SubnetsClient", "ListByEnterprisePolicy", nil, "Failure preparing request") - return - } - - resp, err := client.ListByEnterprisePolicySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "powerplatform.SubnetsClient", "ListByEnterprisePolicy", resp, "Failure sending request") - return - } - - result, err = client.ListByEnterprisePolicyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "powerplatform.SubnetsClient", "ListByEnterprisePolicy", resp, "Failure responding to request") - return - } - - return -} - -// ListByEnterprisePolicyPreparer prepares the ListByEnterprisePolicy request. -func (client SubnetsClient) ListByEnterprisePolicyPreparer(ctx context.Context, resourceGroupName string, enterprisePolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "enterprisePolicyName": autorest.Encode("path", enterprisePolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-10-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerPlatform/enterprisePolicies/{enterprisePolicyName}/subnets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByEnterprisePolicySender sends the ListByEnterprisePolicy request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) ListByEnterprisePolicySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByEnterprisePolicyResponder handles the response to the ListByEnterprisePolicy request. The method always -// closes the http.Response Body. -func (client SubnetsClient) ListByEnterprisePolicyResponder(resp *http.Response) (result SubnetListResult, 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/preview/resourceconnector/mgmt/2021-10-31-preview/resourceconnector/CHANGELOG.md b/services/preview/resourceconnector/mgmt/2021-10-31-preview/resourceconnector/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/resourceconnector/mgmt/2021-10-31-preview/resourceconnector/CHANGELOG.md +++ b/services/preview/resourceconnector/mgmt/2021-10-31-preview/resourceconnector/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/resourceconnector/mgmt/2021-10-31-preview/resourceconnector/_meta.json b/services/preview/resourceconnector/mgmt/2021-10-31-preview/resourceconnector/_meta.json index 8478e05f14c7..bb7fc60c3c92 100644 --- a/services/preview/resourceconnector/mgmt/2021-10-31-preview/resourceconnector/_meta.json +++ b/services/preview/resourceconnector/mgmt/2021-10-31-preview/resourceconnector/_meta.json @@ -1,5 +1,5 @@ { - "commit": "2b56c8a3da0e04aea6f6d80a9ac04741d1ae5904", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/resourceconnector/resource-manager/readme.md", "tag": "package-2021-10-31-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/CHANGELOG.md b/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/CHANGELOG.md +++ b/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/_meta.json b/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/_meta.json index 788f62365984..b471932cb475 100644 --- a/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/_meta.json +++ b/services/preview/timeseriesinsights/mgmt/2017-02-28-preview/timeseriesinsights/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/timeseriesinsights/resource-manager/readme.md", "tag": "package-2017-02-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/CHANGELOG.md b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/CHANGELOG.md index 52911e4cc5e4..daca45089907 100644 --- a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/CHANGELOG.md +++ b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/CHANGELOG.md @@ -1,2 +1,10 @@ -# Change History +# Unreleased +## Breaking Changes + +### Struct Changes + +#### Removed Struct Fields + +1. StandardEnvironmentResourceProperties.CreationTime +1. StandardEnvironmentResourceProperties.ProvisioningState diff --git a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/_meta.json b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/_meta.json index 60be2f683bd1..389a1320da61 100644 --- a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/_meta.json +++ b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/timeseriesinsights/resource-manager/readme.md", "tag": "package-2018-08-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go index 5d4938e9b14a..208bb0e08b72 100644 --- a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go +++ b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go @@ -2181,6 +2181,12 @@ func (lter *LongTermEnvironmentResource) UnmarshalJSON(body []byte) error { // LongTermEnvironmentResourceProperties properties of the long-term environment. type LongTermEnvironmentResourceProperties struct { + // TimeSeriesIDProperties - The list of event properties which will be used to define the environment's time series id. + TimeSeriesIDProperties *[]TimeSeriesIDProperty `json:"timeSeriesIdProperties,omitempty"` + // StorageConfiguration - The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. + StorageConfiguration *LongTermStorageConfigurationOutput `json:"storageConfiguration,omitempty"` + // WarmStoreConfiguration - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. + WarmStoreConfiguration *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` // DataAccessID - READ-ONLY; An id used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. DataAccessID *uuid.UUID `json:"dataAccessId,omitempty"` // DataAccessFqdn - READ-ONLY; The fully qualified domain name used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. @@ -2191,23 +2197,11 @@ type LongTermEnvironmentResourceProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CreationTime - READ-ONLY; The time the resource was created. CreationTime *date.Time `json:"creationTime,omitempty"` - // TimeSeriesIDProperties - The list of event properties which will be used to define the environment's time series id. - TimeSeriesIDProperties *[]TimeSeriesIDProperty `json:"timeSeriesIdProperties,omitempty"` - // StorageConfiguration - The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. - StorageConfiguration *LongTermStorageConfigurationOutput `json:"storageConfiguration,omitempty"` - // WarmStoreConfiguration - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. - WarmStoreConfiguration *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` } // MarshalJSON is the custom marshaler for LongTermEnvironmentResourceProperties. func (lterp LongTermEnvironmentResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lterp.Status != nil { - objectMap["status"] = lterp.Status - } - if lterp.ProvisioningState != "" { - objectMap["provisioningState"] = lterp.ProvisioningState - } if lterp.TimeSeriesIDProperties != nil { objectMap["timeSeriesIdProperties"] = lterp.TimeSeriesIDProperties } @@ -2217,6 +2211,12 @@ func (lterp LongTermEnvironmentResourceProperties) MarshalJSON() ([]byte, error) if lterp.WarmStoreConfiguration != nil { objectMap["warmStoreConfiguration"] = lterp.WarmStoreConfiguration } + if lterp.Status != nil { + objectMap["status"] = lterp.Status + } + if lterp.ProvisioningState != "" { + objectMap["provisioningState"] = lterp.ProvisioningState + } return json.Marshal(objectMap) } @@ -3073,10 +3073,6 @@ type StandardEnvironmentResourceProperties struct { DataAccessFqdn *string `json:"dataAccessFqdn,omitempty"` // Status - An object that represents the status of the environment, and its internal state in the Time Series Insights service. Status *EnvironmentStatus `json:"status,omitempty"` - // ProvisioningState - Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // CreationTime - READ-ONLY; The time the resource was created. - CreationTime *date.Time `json:"creationTime,omitempty"` } // MarshalJSON is the custom marshaler for StandardEnvironmentResourceProperties. @@ -3094,9 +3090,6 @@ func (serp StandardEnvironmentResourceProperties) MarshalJSON() ([]byte, error) if serp.Status != nil { objectMap["status"] = serp.Status } - if serp.ProvisioningState != "" { - objectMap["provisioningState"] = serp.ProvisioningState - } return json.Marshal(objectMap) } diff --git a/services/storsimple1200series/mgmt/2016-10-01/storsimple/CHANGELOG.md b/services/storsimple1200series/mgmt/2016-10-01/storsimple/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/storsimple1200series/mgmt/2016-10-01/storsimple/CHANGELOG.md +++ b/services/storsimple1200series/mgmt/2016-10-01/storsimple/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/storsimple1200series/mgmt/2016-10-01/storsimple/_meta.json b/services/storsimple1200series/mgmt/2016-10-01/storsimple/_meta.json index cca782f2dbeb..fe151d1f87f3 100644 --- a/services/storsimple1200series/mgmt/2016-10-01/storsimple/_meta.json +++ b/services/storsimple1200series/mgmt/2016-10-01/storsimple/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/storSimple1200Series/resource-manager/readme.md", "tag": "package-2016-10", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/storsimple8000series/mgmt/2017-06-01/storsimple/CHANGELOG.md b/services/storsimple8000series/mgmt/2017-06-01/storsimple/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/storsimple8000series/mgmt/2017-06-01/storsimple/CHANGELOG.md +++ b/services/storsimple8000series/mgmt/2017-06-01/storsimple/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/storsimple8000series/mgmt/2017-06-01/storsimple/_meta.json b/services/storsimple8000series/mgmt/2017-06-01/storsimple/_meta.json index dc4e872b1e5b..20ecc75b80b2 100644 --- a/services/storsimple8000series/mgmt/2017-06-01/storsimple/_meta.json +++ b/services/storsimple8000series/mgmt/2017-06-01/storsimple/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/storsimple8000series/resource-manager/readme.md", "tag": "package-2017-06", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/CHANGELOG.md b/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/CHANGELOG.md +++ b/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/_meta.json b/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/_meta.json index 48b268b502fd..ca3950d54f51 100644 --- a/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/_meta.json +++ b/services/timeseriesinsights/mgmt/2017-11-15/timeseriesinsights/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/timeseriesinsights/resource-manager/readme.md", "tag": "package-2017-11-15", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/CHANGELOG.md b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/CHANGELOG.md index 52911e4cc5e4..5131583c8873 100644 --- a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/CHANGELOG.md +++ b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/CHANGELOG.md @@ -1,2 +1,126 @@ -# Change History +# Unreleased +## Breaking Changes + +### Struct Changes + +#### Removed Struct Fields + +1. EventHubEventSourceMutableProperties.LocalTimestamp +1. EventSourceMutableProperties.LocalTimestamp +1. Gen1EnvironmentResourceProperties.CreationTime +1. Gen1EnvironmentResourceProperties.ProvisioningState +1. IoTHubEventSourceMutableProperties.LocalTimestamp + +### Signature Changes + +#### Funcs + +1. EnvironmentsClient.Update + - Params + - From: context.Context, string, string, EnvironmentUpdateParameters + - To: context.Context, string, string, BasicEnvironmentUpdateParameters +1. EnvironmentsClient.UpdatePreparer + - Params + - From: context.Context, string, string, EnvironmentUpdateParameters + - To: context.Context, string, string, BasicEnvironmentUpdateParameters +1. EventSourcesClient.Update + - Params + - From: context.Context, string, string, string, EventSourceUpdateParameters + - To: context.Context, string, string, string, BasicEventSourceUpdateParameters +1. EventSourcesClient.UpdatePreparer + - Params + - From: context.Context, string, string, string, EventSourceUpdateParameters + - To: context.Context, string, string, string, BasicEventSourceUpdateParameters + +## Additive Changes + +### New Constants + +1. IngressStartAtType.CustomEnqueuedTime +1. IngressStartAtType.EarliestAvailable +1. IngressStartAtType.EventSourceCreationTime +1. KindBasicEnvironmentUpdateParameters.KindBasicEnvironmentUpdateParametersKindEnvironmentUpdateParameters +1. KindBasicEnvironmentUpdateParameters.KindBasicEnvironmentUpdateParametersKindGen1 +1. KindBasicEnvironmentUpdateParameters.KindBasicEnvironmentUpdateParametersKindGen2 +1. KindBasicEventSourceUpdateParameters.KindBasicEventSourceUpdateParametersKindEventSourceUpdateParameters +1. KindBasicEventSourceUpdateParameters.KindBasicEventSourceUpdateParametersKindMicrosoftEventHub +1. KindBasicEventSourceUpdateParameters.KindBasicEventSourceUpdateParametersKindMicrosoftIoTHub + +### New Funcs + +1. *AzureEventSourceProperties.UnmarshalJSON([]byte) error +1. *EventHubEventSourceCommonProperties.UnmarshalJSON([]byte) error +1. *EventHubEventSourceCreationProperties.UnmarshalJSON([]byte) error +1. *EventHubEventSourceResourceProperties.UnmarshalJSON([]byte) error +1. *EventSourceCommonProperties.UnmarshalJSON([]byte) error +1. *IoTHubEventSourceCommonProperties.UnmarshalJSON([]byte) error +1. *IoTHubEventSourceCreationProperties.UnmarshalJSON([]byte) error +1. *IoTHubEventSourceResourceProperties.UnmarshalJSON([]byte) error +1. *Operation.UnmarshalJSON([]byte) error +1. EnvironmentUpdateParameters.AsBasicEnvironmentUpdateParameters() (BasicEnvironmentUpdateParameters, bool) +1. EnvironmentUpdateParameters.AsEnvironmentUpdateParameters() (*EnvironmentUpdateParameters, bool) +1. EnvironmentUpdateParameters.AsGen1EnvironmentUpdateParameters() (*Gen1EnvironmentUpdateParameters, bool) +1. EnvironmentUpdateParameters.AsGen2EnvironmentUpdateParameters() (*Gen2EnvironmentUpdateParameters, bool) +1. EventHubEventSourceUpdateParameters.AsBasicEventSourceUpdateParameters() (BasicEventSourceUpdateParameters, bool) +1. EventHubEventSourceUpdateParameters.AsEventHubEventSourceUpdateParameters() (*EventHubEventSourceUpdateParameters, bool) +1. EventHubEventSourceUpdateParameters.AsEventSourceUpdateParameters() (*EventSourceUpdateParameters, bool) +1. EventHubEventSourceUpdateParameters.AsIoTHubEventSourceUpdateParameters() (*IoTHubEventSourceUpdateParameters, bool) +1. EventSourceUpdateParameters.AsBasicEventSourceUpdateParameters() (BasicEventSourceUpdateParameters, bool) +1. EventSourceUpdateParameters.AsEventHubEventSourceUpdateParameters() (*EventHubEventSourceUpdateParameters, bool) +1. EventSourceUpdateParameters.AsEventSourceUpdateParameters() (*EventSourceUpdateParameters, bool) +1. EventSourceUpdateParameters.AsIoTHubEventSourceUpdateParameters() (*IoTHubEventSourceUpdateParameters, bool) +1. Gen1EnvironmentUpdateParameters.AsBasicEnvironmentUpdateParameters() (BasicEnvironmentUpdateParameters, bool) +1. Gen1EnvironmentUpdateParameters.AsEnvironmentUpdateParameters() (*EnvironmentUpdateParameters, bool) +1. Gen1EnvironmentUpdateParameters.AsGen1EnvironmentUpdateParameters() (*Gen1EnvironmentUpdateParameters, bool) +1. Gen1EnvironmentUpdateParameters.AsGen2EnvironmentUpdateParameters() (*Gen2EnvironmentUpdateParameters, bool) +1. Gen2EnvironmentUpdateParameters.AsBasicEnvironmentUpdateParameters() (BasicEnvironmentUpdateParameters, bool) +1. Gen2EnvironmentUpdateParameters.AsEnvironmentUpdateParameters() (*EnvironmentUpdateParameters, bool) +1. Gen2EnvironmentUpdateParameters.AsGen1EnvironmentUpdateParameters() (*Gen1EnvironmentUpdateParameters, bool) +1. Gen2EnvironmentUpdateParameters.AsGen2EnvironmentUpdateParameters() (*Gen2EnvironmentUpdateParameters, bool) +1. IoTHubEventSourceUpdateParameters.AsBasicEventSourceUpdateParameters() (BasicEventSourceUpdateParameters, bool) +1. IoTHubEventSourceUpdateParameters.AsEventHubEventSourceUpdateParameters() (*EventHubEventSourceUpdateParameters, bool) +1. IoTHubEventSourceUpdateParameters.AsEventSourceUpdateParameters() (*EventSourceUpdateParameters, bool) +1. IoTHubEventSourceUpdateParameters.AsIoTHubEventSourceUpdateParameters() (*IoTHubEventSourceUpdateParameters, bool) +1. PossibleIngressStartAtTypeValues() []IngressStartAtType +1. PossibleKindBasicEnvironmentUpdateParametersValues() []KindBasicEnvironmentUpdateParameters +1. PossibleKindBasicEventSourceUpdateParametersValues() []KindBasicEventSourceUpdateParameters + +### Struct Changes + +#### New Structs + +1. Dimension +1. IngressStartAtProperties +1. LogSpecification +1. MetricAvailability +1. MetricSpecification +1. OperationProperties +1. ServiceSpecification + +#### New Struct Fields + +1. AzureEventSourceProperties.*IngressStartAtProperties +1. AzureEventSourceProperties.LocalTimestamp +1. EnvironmentUpdateParameters.Kind +1. EventHubEventSourceCommonProperties.*IngressStartAtProperties +1. EventHubEventSourceCommonProperties.LocalTimestamp +1. EventHubEventSourceCreationProperties.*IngressStartAtProperties +1. EventHubEventSourceCreationProperties.LocalTimestamp +1. EventHubEventSourceResourceProperties.*IngressStartAtProperties +1. EventHubEventSourceResourceProperties.LocalTimestamp +1. EventHubEventSourceUpdateParameters.Kind +1. EventSourceCommonProperties.*IngressStartAtProperties +1. EventSourceCommonProperties.LocalTimestamp +1. EventSourceUpdateParameters.Kind +1. Gen1EnvironmentUpdateParameters.Kind +1. Gen2EnvironmentUpdateParameters.Kind +1. IoTHubEventSourceCommonProperties.*IngressStartAtProperties +1. IoTHubEventSourceCommonProperties.LocalTimestamp +1. IoTHubEventSourceCreationProperties.*IngressStartAtProperties +1. IoTHubEventSourceCreationProperties.LocalTimestamp +1. IoTHubEventSourceResourceProperties.*IngressStartAtProperties +1. IoTHubEventSourceResourceProperties.LocalTimestamp +1. IoTHubEventSourceUpdateParameters.Kind +1. Operation.*OperationProperties +1. Operation.Origin diff --git a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/_meta.json b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/_meta.json index b5b7570d4fe7..d292d525accc 100644 --- a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/_meta.json +++ b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "163e27c0ca7570bc39e00a46f255740d9b3ba3cb", "readme": "/_/azure-rest-api-specs/specification/timeseriesinsights/resource-manager/readme.md", "tag": "package-2020-05-15", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/enums.go b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/enums.go index e54a68b56d72..4d67242f4509 100644 --- a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/enums.go +++ b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/enums.go @@ -36,6 +36,23 @@ func PossibleDataStringComparisonBehaviorValues() []DataStringComparisonBehavior return []DataStringComparisonBehavior{Ordinal, OrdinalIgnoreCase} } +// IngressStartAtType enumerates the values for ingress start at type. +type IngressStartAtType string + +const ( + // CustomEnqueuedTime ... + CustomEnqueuedTime IngressStartAtType = "CustomEnqueuedTime" + // EarliestAvailable ... + EarliestAvailable IngressStartAtType = "EarliestAvailable" + // EventSourceCreationTime ... + EventSourceCreationTime IngressStartAtType = "EventSourceCreationTime" +) + +// PossibleIngressStartAtTypeValues returns an array of possible values for the IngressStartAtType const type. +func PossibleIngressStartAtTypeValues() []IngressStartAtType { + return []IngressStartAtType{CustomEnqueuedTime, EarliestAvailable, EventSourceCreationTime} +} + // IngressState enumerates the values for ingress state. type IngressState string @@ -91,6 +108,23 @@ func PossibleKindBasicEnvironmentResourceValues() []KindBasicEnvironmentResource return []KindBasicEnvironmentResource{KindBasicEnvironmentResourceKindEnvironmentResource, KindBasicEnvironmentResourceKindGen1, KindBasicEnvironmentResourceKindGen2} } +// KindBasicEnvironmentUpdateParameters enumerates the values for kind basic environment update parameters. +type KindBasicEnvironmentUpdateParameters string + +const ( + // KindBasicEnvironmentUpdateParametersKindEnvironmentUpdateParameters ... + KindBasicEnvironmentUpdateParametersKindEnvironmentUpdateParameters KindBasicEnvironmentUpdateParameters = "EnvironmentUpdateParameters" + // KindBasicEnvironmentUpdateParametersKindGen1 ... + KindBasicEnvironmentUpdateParametersKindGen1 KindBasicEnvironmentUpdateParameters = "Gen1" + // KindBasicEnvironmentUpdateParametersKindGen2 ... + KindBasicEnvironmentUpdateParametersKindGen2 KindBasicEnvironmentUpdateParameters = "Gen2" +) + +// PossibleKindBasicEnvironmentUpdateParametersValues returns an array of possible values for the KindBasicEnvironmentUpdateParameters const type. +func PossibleKindBasicEnvironmentUpdateParametersValues() []KindBasicEnvironmentUpdateParameters { + return []KindBasicEnvironmentUpdateParameters{KindBasicEnvironmentUpdateParametersKindEnvironmentUpdateParameters, KindBasicEnvironmentUpdateParametersKindGen1, KindBasicEnvironmentUpdateParametersKindGen2} +} + // KindBasicEventSourceCreateOrUpdateParameters enumerates the values for kind basic event source create or // update parameters. type KindBasicEventSourceCreateOrUpdateParameters string @@ -126,6 +160,23 @@ func PossibleKindBasicEventSourceResourceValues() []KindBasicEventSourceResource return []KindBasicEventSourceResource{KindBasicEventSourceResourceKindEventSourceResource, KindBasicEventSourceResourceKindMicrosoftEventHub, KindBasicEventSourceResourceKindMicrosoftIoTHub} } +// KindBasicEventSourceUpdateParameters enumerates the values for kind basic event source update parameters. +type KindBasicEventSourceUpdateParameters string + +const ( + // KindBasicEventSourceUpdateParametersKindEventSourceUpdateParameters ... + KindBasicEventSourceUpdateParametersKindEventSourceUpdateParameters KindBasicEventSourceUpdateParameters = "EventSourceUpdateParameters" + // KindBasicEventSourceUpdateParametersKindMicrosoftEventHub ... + KindBasicEventSourceUpdateParametersKindMicrosoftEventHub KindBasicEventSourceUpdateParameters = "Microsoft.EventHub" + // KindBasicEventSourceUpdateParametersKindMicrosoftIoTHub ... + KindBasicEventSourceUpdateParametersKindMicrosoftIoTHub KindBasicEventSourceUpdateParameters = "Microsoft.IoTHub" +) + +// PossibleKindBasicEventSourceUpdateParametersValues returns an array of possible values for the KindBasicEventSourceUpdateParameters const type. +func PossibleKindBasicEventSourceUpdateParametersValues() []KindBasicEventSourceUpdateParameters { + return []KindBasicEventSourceUpdateParameters{KindBasicEventSourceUpdateParametersKindEventSourceUpdateParameters, KindBasicEventSourceUpdateParametersKindMicrosoftEventHub, KindBasicEventSourceUpdateParametersKindMicrosoftIoTHub} +} + // LocalTimestampFormat enumerates the values for local timestamp format. type LocalTimestampFormat string diff --git a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/environments.go b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/environments.go index b6f37a58d78a..5ad38ad20132 100644 --- a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/environments.go +++ b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/environments.go @@ -438,7 +438,7 @@ func (client EnvironmentsClient) ListBySubscriptionResponder(resp *http.Response // environmentName - the name of the Time Series Insights environment associated with the specified resource // group. // environmentUpdateParameters - request object that contains the updated information for the environment. -func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters EnvironmentUpdateParameters) (result EnvironmentsUpdateFuture, err error) { +func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters BasicEnvironmentUpdateParameters) (result EnvironmentsUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EnvironmentsClient.Update") defer func() { @@ -465,7 +465,7 @@ func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName s } // UpdatePreparer prepares the Update request. -func (client EnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters EnvironmentUpdateParameters) (*http.Request, error) { +func (client EnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters BasicEnvironmentUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "environmentName": autorest.Encode("path", environmentName), "resourceGroupName": autorest.Encode("path", resourceGroupName), diff --git a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/eventsources.go b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/eventsources.go index e999c1955996..a1950f7b8160 100644 --- a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/eventsources.go +++ b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/eventsources.go @@ -368,7 +368,7 @@ func (client EventSourcesClient) ListByEnvironmentResponder(resp *http.Response) // eventSourceName - the name of the Time Series Insights event source associated with the specified // environment. // eventSourceUpdateParameters - request object that contains the updated information for the event source. -func (client EventSourcesClient) Update(ctx context.Context, resourceGroupName string, environmentName string, eventSourceName string, eventSourceUpdateParameters EventSourceUpdateParameters) (result EventSourceResourceModel, err error) { +func (client EventSourcesClient) Update(ctx context.Context, resourceGroupName string, environmentName string, eventSourceName string, eventSourceUpdateParameters BasicEventSourceUpdateParameters) (result EventSourceResourceModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EventSourcesClient.Update") defer func() { @@ -402,7 +402,7 @@ func (client EventSourcesClient) Update(ctx context.Context, resourceGroupName s } // UpdatePreparer prepares the Update request. -func (client EventSourcesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, environmentName string, eventSourceName string, eventSourceUpdateParameters EventSourceUpdateParameters) (*http.Request, error) { +func (client EventSourcesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, environmentName string, eventSourceName string, eventSourceUpdateParameters BasicEventSourceUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "environmentName": autorest.Encode("path", environmentName), "eventSourceName": autorest.Encode("path", eventSourceName), diff --git a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/models.go b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/models.go index 2744ff7d51c3..c8ea6841684d 100644 --- a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/models.go +++ b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/models.go @@ -204,6 +204,10 @@ type AzureEventSourceProperties struct { EventSourceResourceID *string `json:"eventSourceResourceId,omitempty"` // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` + // IngressStartAtProperties - An object that contains the details about the starting point in time to ingest events. + *IngressStartAtProperties `json:"ingressStartAt,omitempty"` // ProvisioningState - Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CreationTime - READ-ONLY; The time the resource was created. @@ -219,12 +223,87 @@ func (aesp AzureEventSourceProperties) MarshalJSON() ([]byte, error) { if aesp.TimestampPropertyName != nil { objectMap["timestampPropertyName"] = aesp.TimestampPropertyName } + if aesp.LocalTimestamp != nil { + objectMap["localTimestamp"] = aesp.LocalTimestamp + } + if aesp.IngressStartAtProperties != nil { + objectMap["ingressStartAt"] = aesp.IngressStartAtProperties + } if aesp.ProvisioningState != "" { objectMap["provisioningState"] = aesp.ProvisioningState } return json.Marshal(objectMap) } +// UnmarshalJSON is the custom unmarshaler for AzureEventSourceProperties struct. +func (aesp *AzureEventSourceProperties) 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 "eventSourceResourceId": + if v != nil { + var eventSourceResourceID string + err = json.Unmarshal(*v, &eventSourceResourceID) + if err != nil { + return err + } + aesp.EventSourceResourceID = &eventSourceResourceID + } + case "timestampPropertyName": + if v != nil { + var timestampPropertyName string + err = json.Unmarshal(*v, ×tampPropertyName) + if err != nil { + return err + } + aesp.TimestampPropertyName = ×tampPropertyName + } + case "localTimestamp": + if v != nil { + var localTimestamp LocalTimestamp + err = json.Unmarshal(*v, &localTimestamp) + if err != nil { + return err + } + aesp.LocalTimestamp = &localTimestamp + } + case "ingressStartAt": + if v != nil { + var ingressStartAtProperties IngressStartAtProperties + err = json.Unmarshal(*v, &ingressStartAtProperties) + if err != nil { + return err + } + aesp.IngressStartAtProperties = &ingressStartAtProperties + } + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + aesp.ProvisioningState = provisioningState + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + aesp.CreationTime = &creationTime + } + } + } + + return nil +} + // CloudError contains information about an API error. type CloudError struct { // Error - Describes a particular API error with an error code and a message. @@ -264,6 +343,14 @@ func (coutrp CreateOrUpdateTrackedResourceProperties) MarshalJSON() ([]byte, err return json.Marshal(objectMap) } +// Dimension dimension of blobs, possibly be blob type or access tier. +type Dimension struct { + // Name - Display name of dimension. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of dimension. + DisplayName *string `json:"displayName,omitempty"` +} + // BasicEnvironmentCreateOrUpdateParameters parameters supplied to the CreateOrUpdate Environment operation. type BasicEnvironmentCreateOrUpdateParameters interface { AsGen1EnvironmentCreateOrUpdateParameters() (*Gen1EnvironmentCreateOrUpdateParameters, bool) @@ -647,21 +734,95 @@ func (future *EnvironmentsUpdateFuture) result(client EnvironmentsClient) (erm E return } +// BasicEnvironmentUpdateParameters parameters supplied to the Update Environment operation. +type BasicEnvironmentUpdateParameters interface { + AsGen1EnvironmentUpdateParameters() (*Gen1EnvironmentUpdateParameters, bool) + AsGen2EnvironmentUpdateParameters() (*Gen2EnvironmentUpdateParameters, bool) + AsEnvironmentUpdateParameters() (*EnvironmentUpdateParameters, bool) +} + // EnvironmentUpdateParameters parameters supplied to the Update Environment operation. type EnvironmentUpdateParameters struct { // Tags - Key-value pairs of additional properties for the environment. Tags map[string]*string `json:"tags"` + // Kind - Possible values include: 'KindBasicEnvironmentUpdateParametersKindEnvironmentUpdateParameters', 'KindBasicEnvironmentUpdateParametersKindGen1', 'KindBasicEnvironmentUpdateParametersKindGen2' + Kind KindBasicEnvironmentUpdateParameters `json:"kind,omitempty"` +} + +func unmarshalBasicEnvironmentUpdateParameters(body []byte) (BasicEnvironmentUpdateParameters, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBasicEnvironmentUpdateParametersKindGen1): + var g1eup Gen1EnvironmentUpdateParameters + err := json.Unmarshal(body, &g1eup) + return g1eup, err + case string(KindBasicEnvironmentUpdateParametersKindGen2): + var g2eup Gen2EnvironmentUpdateParameters + err := json.Unmarshal(body, &g2eup) + return g2eup, err + default: + var eup EnvironmentUpdateParameters + err := json.Unmarshal(body, &eup) + return eup, err + } +} +func unmarshalBasicEnvironmentUpdateParametersArray(body []byte) ([]BasicEnvironmentUpdateParameters, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + eupArray := make([]BasicEnvironmentUpdateParameters, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eup, err := unmarshalBasicEnvironmentUpdateParameters(*rawMessage) + if err != nil { + return nil, err + } + eupArray[index] = eup + } + return eupArray, nil } // MarshalJSON is the custom marshaler for EnvironmentUpdateParameters. func (eup EnvironmentUpdateParameters) MarshalJSON() ([]byte, error) { + eup.Kind = KindBasicEnvironmentUpdateParametersKindEnvironmentUpdateParameters objectMap := make(map[string]interface{}) if eup.Tags != nil { objectMap["tags"] = eup.Tags } + if eup.Kind != "" { + objectMap["kind"] = eup.Kind + } return json.Marshal(objectMap) } +// AsGen1EnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for EnvironmentUpdateParameters. +func (eup EnvironmentUpdateParameters) AsGen1EnvironmentUpdateParameters() (*Gen1EnvironmentUpdateParameters, bool) { + return nil, false +} + +// AsGen2EnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for EnvironmentUpdateParameters. +func (eup EnvironmentUpdateParameters) AsGen2EnvironmentUpdateParameters() (*Gen2EnvironmentUpdateParameters, bool) { + return nil, false +} + +// AsEnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for EnvironmentUpdateParameters. +func (eup EnvironmentUpdateParameters) AsEnvironmentUpdateParameters() (*EnvironmentUpdateParameters, bool) { + return &eup, true +} + +// AsBasicEnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for EnvironmentUpdateParameters. +func (eup EnvironmentUpdateParameters) AsBasicEnvironmentUpdateParameters() (BasicEnvironmentUpdateParameters, bool) { + return &eup, true +} + // EventHubEventSourceCommonProperties properties of the EventHub event source. type EventHubEventSourceCommonProperties struct { // ServiceBusNamespace - The name of the service bus that contains the event hub. @@ -676,6 +837,10 @@ type EventHubEventSourceCommonProperties struct { EventSourceResourceID *string `json:"eventSourceResourceId,omitempty"` // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` + // IngressStartAtProperties - An object that contains the details about the starting point in time to ingest events. + *IngressStartAtProperties `json:"ingressStartAt,omitempty"` // ProvisioningState - Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CreationTime - READ-ONLY; The time the resource was created. @@ -703,12 +868,123 @@ func (ehescp EventHubEventSourceCommonProperties) MarshalJSON() ([]byte, error) if ehescp.TimestampPropertyName != nil { objectMap["timestampPropertyName"] = ehescp.TimestampPropertyName } + if ehescp.LocalTimestamp != nil { + objectMap["localTimestamp"] = ehescp.LocalTimestamp + } + if ehescp.IngressStartAtProperties != nil { + objectMap["ingressStartAt"] = ehescp.IngressStartAtProperties + } if ehescp.ProvisioningState != "" { objectMap["provisioningState"] = ehescp.ProvisioningState } return json.Marshal(objectMap) } +// UnmarshalJSON is the custom unmarshaler for EventHubEventSourceCommonProperties struct. +func (ehescp *EventHubEventSourceCommonProperties) 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 "serviceBusNamespace": + if v != nil { + var serviceBusNamespace string + err = json.Unmarshal(*v, &serviceBusNamespace) + if err != nil { + return err + } + ehescp.ServiceBusNamespace = &serviceBusNamespace + } + case "eventHubName": + if v != nil { + var eventHubName string + err = json.Unmarshal(*v, &eventHubName) + if err != nil { + return err + } + ehescp.EventHubName = &eventHubName + } + case "consumerGroupName": + if v != nil { + var consumerGroupName string + err = json.Unmarshal(*v, &consumerGroupName) + if err != nil { + return err + } + ehescp.ConsumerGroupName = &consumerGroupName + } + case "keyName": + if v != nil { + var keyName string + err = json.Unmarshal(*v, &keyName) + if err != nil { + return err + } + ehescp.KeyName = &keyName + } + case "eventSourceResourceId": + if v != nil { + var eventSourceResourceID string + err = json.Unmarshal(*v, &eventSourceResourceID) + if err != nil { + return err + } + ehescp.EventSourceResourceID = &eventSourceResourceID + } + case "timestampPropertyName": + if v != nil { + var timestampPropertyName string + err = json.Unmarshal(*v, ×tampPropertyName) + if err != nil { + return err + } + ehescp.TimestampPropertyName = ×tampPropertyName + } + case "localTimestamp": + if v != nil { + var localTimestamp LocalTimestamp + err = json.Unmarshal(*v, &localTimestamp) + if err != nil { + return err + } + ehescp.LocalTimestamp = &localTimestamp + } + case "ingressStartAt": + if v != nil { + var ingressStartAtProperties IngressStartAtProperties + err = json.Unmarshal(*v, &ingressStartAtProperties) + if err != nil { + return err + } + ehescp.IngressStartAtProperties = &ingressStartAtProperties + } + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + ehescp.ProvisioningState = provisioningState + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + ehescp.CreationTime = &creationTime + } + } + } + + return nil +} + // EventHubEventSourceCreateOrUpdateParameters parameters supplied to the Create or Update Event Source // operation for an EventHub event source. type EventHubEventSourceCreateOrUpdateParameters struct { @@ -842,6 +1118,10 @@ type EventHubEventSourceCreationProperties struct { EventSourceResourceID *string `json:"eventSourceResourceId,omitempty"` // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` + // IngressStartAtProperties - An object that contains the details about the starting point in time to ingest events. + *IngressStartAtProperties `json:"ingressStartAt,omitempty"` // ProvisioningState - Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CreationTime - READ-ONLY; The time the resource was created. @@ -872,12 +1152,132 @@ func (ehescp EventHubEventSourceCreationProperties) MarshalJSON() ([]byte, error if ehescp.TimestampPropertyName != nil { objectMap["timestampPropertyName"] = ehescp.TimestampPropertyName } + if ehescp.LocalTimestamp != nil { + objectMap["localTimestamp"] = ehescp.LocalTimestamp + } + if ehescp.IngressStartAtProperties != nil { + objectMap["ingressStartAt"] = ehescp.IngressStartAtProperties + } if ehescp.ProvisioningState != "" { objectMap["provisioningState"] = ehescp.ProvisioningState } return json.Marshal(objectMap) } +// UnmarshalJSON is the custom unmarshaler for EventHubEventSourceCreationProperties struct. +func (ehescp *EventHubEventSourceCreationProperties) 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 "sharedAccessKey": + if v != nil { + var sharedAccessKey string + err = json.Unmarshal(*v, &sharedAccessKey) + if err != nil { + return err + } + ehescp.SharedAccessKey = &sharedAccessKey + } + case "serviceBusNamespace": + if v != nil { + var serviceBusNamespace string + err = json.Unmarshal(*v, &serviceBusNamespace) + if err != nil { + return err + } + ehescp.ServiceBusNamespace = &serviceBusNamespace + } + case "eventHubName": + if v != nil { + var eventHubName string + err = json.Unmarshal(*v, &eventHubName) + if err != nil { + return err + } + ehescp.EventHubName = &eventHubName + } + case "consumerGroupName": + if v != nil { + var consumerGroupName string + err = json.Unmarshal(*v, &consumerGroupName) + if err != nil { + return err + } + ehescp.ConsumerGroupName = &consumerGroupName + } + case "keyName": + if v != nil { + var keyName string + err = json.Unmarshal(*v, &keyName) + if err != nil { + return err + } + ehescp.KeyName = &keyName + } + case "eventSourceResourceId": + if v != nil { + var eventSourceResourceID string + err = json.Unmarshal(*v, &eventSourceResourceID) + if err != nil { + return err + } + ehescp.EventSourceResourceID = &eventSourceResourceID + } + case "timestampPropertyName": + if v != nil { + var timestampPropertyName string + err = json.Unmarshal(*v, ×tampPropertyName) + if err != nil { + return err + } + ehescp.TimestampPropertyName = ×tampPropertyName + } + case "localTimestamp": + if v != nil { + var localTimestamp LocalTimestamp + err = json.Unmarshal(*v, &localTimestamp) + if err != nil { + return err + } + ehescp.LocalTimestamp = &localTimestamp + } + case "ingressStartAt": + if v != nil { + var ingressStartAtProperties IngressStartAtProperties + err = json.Unmarshal(*v, &ingressStartAtProperties) + if err != nil { + return err + } + ehescp.IngressStartAtProperties = &ingressStartAtProperties + } + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + ehescp.ProvisioningState = provisioningState + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + ehescp.CreationTime = &creationTime + } + } + } + + return nil +} + // EventHubEventSourceMutableProperties an object that represents a set of mutable EventHub event source // resource properties. type EventHubEventSourceMutableProperties struct { @@ -885,8 +1285,6 @@ type EventHubEventSourceMutableProperties struct { SharedAccessKey *string `json:"sharedAccessKey,omitempty"` // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` - // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. - LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` } // EventHubEventSourceResource an event source that receives its data from an Azure EventHub. @@ -1037,6 +1435,10 @@ type EventHubEventSourceResourceProperties struct { EventSourceResourceID *string `json:"eventSourceResourceId,omitempty"` // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` + // IngressStartAtProperties - An object that contains the details about the starting point in time to ingest events. + *IngressStartAtProperties `json:"ingressStartAt,omitempty"` // ProvisioningState - Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CreationTime - READ-ONLY; The time the resource was created. @@ -1064,12 +1466,123 @@ func (ehesrp EventHubEventSourceResourceProperties) MarshalJSON() ([]byte, error if ehesrp.TimestampPropertyName != nil { objectMap["timestampPropertyName"] = ehesrp.TimestampPropertyName } + if ehesrp.LocalTimestamp != nil { + objectMap["localTimestamp"] = ehesrp.LocalTimestamp + } + if ehesrp.IngressStartAtProperties != nil { + objectMap["ingressStartAt"] = ehesrp.IngressStartAtProperties + } if ehesrp.ProvisioningState != "" { objectMap["provisioningState"] = ehesrp.ProvisioningState } return json.Marshal(objectMap) } +// UnmarshalJSON is the custom unmarshaler for EventHubEventSourceResourceProperties struct. +func (ehesrp *EventHubEventSourceResourceProperties) 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 "serviceBusNamespace": + if v != nil { + var serviceBusNamespace string + err = json.Unmarshal(*v, &serviceBusNamespace) + if err != nil { + return err + } + ehesrp.ServiceBusNamespace = &serviceBusNamespace + } + case "eventHubName": + if v != nil { + var eventHubName string + err = json.Unmarshal(*v, &eventHubName) + if err != nil { + return err + } + ehesrp.EventHubName = &eventHubName + } + case "consumerGroupName": + if v != nil { + var consumerGroupName string + err = json.Unmarshal(*v, &consumerGroupName) + if err != nil { + return err + } + ehesrp.ConsumerGroupName = &consumerGroupName + } + case "keyName": + if v != nil { + var keyName string + err = json.Unmarshal(*v, &keyName) + if err != nil { + return err + } + ehesrp.KeyName = &keyName + } + case "eventSourceResourceId": + if v != nil { + var eventSourceResourceID string + err = json.Unmarshal(*v, &eventSourceResourceID) + if err != nil { + return err + } + ehesrp.EventSourceResourceID = &eventSourceResourceID + } + case "timestampPropertyName": + if v != nil { + var timestampPropertyName string + err = json.Unmarshal(*v, ×tampPropertyName) + if err != nil { + return err + } + ehesrp.TimestampPropertyName = ×tampPropertyName + } + case "localTimestamp": + if v != nil { + var localTimestamp LocalTimestamp + err = json.Unmarshal(*v, &localTimestamp) + if err != nil { + return err + } + ehesrp.LocalTimestamp = &localTimestamp + } + case "ingressStartAt": + if v != nil { + var ingressStartAtProperties IngressStartAtProperties + err = json.Unmarshal(*v, &ingressStartAtProperties) + if err != nil { + return err + } + ehesrp.IngressStartAtProperties = &ingressStartAtProperties + } + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + ehesrp.ProvisioningState = provisioningState + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + ehesrp.CreationTime = &creationTime + } + } + } + + return nil +} + // EventHubEventSourceUpdateParameters parameters supplied to the Update Event Source operation to update // an EventHub event source. type EventHubEventSourceUpdateParameters struct { @@ -1077,10 +1590,13 @@ type EventHubEventSourceUpdateParameters struct { *EventHubEventSourceMutableProperties `json:"properties,omitempty"` // Tags - Key-value pairs of additional properties for the event source. Tags map[string]*string `json:"tags"` + // Kind - Possible values include: 'KindBasicEventSourceUpdateParametersKindEventSourceUpdateParameters', 'KindBasicEventSourceUpdateParametersKindMicrosoftEventHub', 'KindBasicEventSourceUpdateParametersKindMicrosoftIoTHub' + Kind KindBasicEventSourceUpdateParameters `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for EventHubEventSourceUpdateParameters. func (ehesup EventHubEventSourceUpdateParameters) MarshalJSON() ([]byte, error) { + ehesup.Kind = KindBasicEventSourceUpdateParametersKindMicrosoftEventHub objectMap := make(map[string]interface{}) if ehesup.EventHubEventSourceMutableProperties != nil { objectMap["properties"] = ehesup.EventHubEventSourceMutableProperties @@ -1088,9 +1604,32 @@ func (ehesup EventHubEventSourceUpdateParameters) MarshalJSON() ([]byte, error) if ehesup.Tags != nil { objectMap["tags"] = ehesup.Tags } + if ehesup.Kind != "" { + objectMap["kind"] = ehesup.Kind + } return json.Marshal(objectMap) } +// AsEventHubEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for EventHubEventSourceUpdateParameters. +func (ehesup EventHubEventSourceUpdateParameters) AsEventHubEventSourceUpdateParameters() (*EventHubEventSourceUpdateParameters, bool) { + return &ehesup, true +} + +// AsIoTHubEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for EventHubEventSourceUpdateParameters. +func (ehesup EventHubEventSourceUpdateParameters) AsIoTHubEventSourceUpdateParameters() (*IoTHubEventSourceUpdateParameters, bool) { + return nil, false +} + +// AsEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for EventHubEventSourceUpdateParameters. +func (ehesup EventHubEventSourceUpdateParameters) AsEventSourceUpdateParameters() (*EventSourceUpdateParameters, bool) { + return nil, false +} + +// AsBasicEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for EventHubEventSourceUpdateParameters. +func (ehesup EventHubEventSourceUpdateParameters) AsBasicEventSourceUpdateParameters() (BasicEventSourceUpdateParameters, bool) { + return &ehesup, true +} + // UnmarshalJSON is the custom unmarshaler for EventHubEventSourceUpdateParameters struct. func (ehesup *EventHubEventSourceUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1118,6 +1657,15 @@ func (ehesup *EventHubEventSourceUpdateParameters) UnmarshalJSON(body []byte) er } ehesup.Tags = tags } + case "kind": + if v != nil { + var kind KindBasicEventSourceUpdateParameters + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ehesup.Kind = kind + } } } @@ -1128,6 +1676,10 @@ func (ehesup *EventHubEventSourceUpdateParameters) UnmarshalJSON(body []byte) er type EventSourceCommonProperties struct { // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` + // IngressStartAtProperties - An object that contains the details about the starting point in time to ingest events. + *IngressStartAtProperties `json:"ingressStartAt,omitempty"` // ProvisioningState - Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CreationTime - READ-ONLY; The time the resource was created. @@ -1140,12 +1692,78 @@ func (escp EventSourceCommonProperties) MarshalJSON() ([]byte, error) { if escp.TimestampPropertyName != nil { objectMap["timestampPropertyName"] = escp.TimestampPropertyName } + if escp.LocalTimestamp != nil { + objectMap["localTimestamp"] = escp.LocalTimestamp + } + if escp.IngressStartAtProperties != nil { + objectMap["ingressStartAt"] = escp.IngressStartAtProperties + } if escp.ProvisioningState != "" { objectMap["provisioningState"] = escp.ProvisioningState } return json.Marshal(objectMap) } +// UnmarshalJSON is the custom unmarshaler for EventSourceCommonProperties struct. +func (escp *EventSourceCommonProperties) 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 "timestampPropertyName": + if v != nil { + var timestampPropertyName string + err = json.Unmarshal(*v, ×tampPropertyName) + if err != nil { + return err + } + escp.TimestampPropertyName = ×tampPropertyName + } + case "localTimestamp": + if v != nil { + var localTimestamp LocalTimestamp + err = json.Unmarshal(*v, &localTimestamp) + if err != nil { + return err + } + escp.LocalTimestamp = &localTimestamp + } + case "ingressStartAt": + if v != nil { + var ingressStartAtProperties IngressStartAtProperties + err = json.Unmarshal(*v, &ingressStartAtProperties) + if err != nil { + return err + } + escp.IngressStartAtProperties = &ingressStartAtProperties + } + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + escp.ProvisioningState = provisioningState + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + escp.CreationTime = &creationTime + } + } + } + + return nil +} + // BasicEventSourceCreateOrUpdateParameters parameters supplied to the Create or Update Event Source operation. type BasicEventSourceCreateOrUpdateParameters interface { AsEventHubEventSourceCreateOrUpdateParameters() (*EventHubEventSourceCreateOrUpdateParameters, bool) @@ -1280,8 +1898,6 @@ func (eslr *EventSourceListResponse) UnmarshalJSON(body []byte) error { type EventSourceMutableProperties struct { // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` - // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. - LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` } // BasicEventSourceResource an environment receives data from one or more event sources. Each event source has @@ -1406,21 +2022,95 @@ func (esrm *EventSourceResourceModel) UnmarshalJSON(body []byte) error { return nil } +// BasicEventSourceUpdateParameters parameters supplied to the Update Event Source operation. +type BasicEventSourceUpdateParameters interface { + AsEventHubEventSourceUpdateParameters() (*EventHubEventSourceUpdateParameters, bool) + AsIoTHubEventSourceUpdateParameters() (*IoTHubEventSourceUpdateParameters, bool) + AsEventSourceUpdateParameters() (*EventSourceUpdateParameters, bool) +} + // EventSourceUpdateParameters parameters supplied to the Update Event Source operation. type EventSourceUpdateParameters struct { // Tags - Key-value pairs of additional properties for the event source. Tags map[string]*string `json:"tags"` + // Kind - Possible values include: 'KindBasicEventSourceUpdateParametersKindEventSourceUpdateParameters', 'KindBasicEventSourceUpdateParametersKindMicrosoftEventHub', 'KindBasicEventSourceUpdateParametersKindMicrosoftIoTHub' + Kind KindBasicEventSourceUpdateParameters `json:"kind,omitempty"` +} + +func unmarshalBasicEventSourceUpdateParameters(body []byte) (BasicEventSourceUpdateParameters, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBasicEventSourceUpdateParametersKindMicrosoftEventHub): + var ehesup EventHubEventSourceUpdateParameters + err := json.Unmarshal(body, &ehesup) + return ehesup, err + case string(KindBasicEventSourceUpdateParametersKindMicrosoftIoTHub): + var ithesup IoTHubEventSourceUpdateParameters + err := json.Unmarshal(body, &ithesup) + return ithesup, err + default: + var esup EventSourceUpdateParameters + err := json.Unmarshal(body, &esup) + return esup, err + } +} +func unmarshalBasicEventSourceUpdateParametersArray(body []byte) ([]BasicEventSourceUpdateParameters, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + esupArray := make([]BasicEventSourceUpdateParameters, len(rawMessages)) + + for index, rawMessage := range rawMessages { + esup, err := unmarshalBasicEventSourceUpdateParameters(*rawMessage) + if err != nil { + return nil, err + } + esupArray[index] = esup + } + return esupArray, nil } // MarshalJSON is the custom marshaler for EventSourceUpdateParameters. func (esup EventSourceUpdateParameters) MarshalJSON() ([]byte, error) { + esup.Kind = KindBasicEventSourceUpdateParametersKindEventSourceUpdateParameters objectMap := make(map[string]interface{}) if esup.Tags != nil { objectMap["tags"] = esup.Tags } + if esup.Kind != "" { + objectMap["kind"] = esup.Kind + } return json.Marshal(objectMap) } +// AsEventHubEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for EventSourceUpdateParameters. +func (esup EventSourceUpdateParameters) AsEventHubEventSourceUpdateParameters() (*EventHubEventSourceUpdateParameters, bool) { + return nil, false +} + +// AsIoTHubEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for EventSourceUpdateParameters. +func (esup EventSourceUpdateParameters) AsIoTHubEventSourceUpdateParameters() (*IoTHubEventSourceUpdateParameters, bool) { + return nil, false +} + +// AsEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for EventSourceUpdateParameters. +func (esup EventSourceUpdateParameters) AsEventSourceUpdateParameters() (*EventSourceUpdateParameters, bool) { + return &esup, true +} + +// AsBasicEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for EventSourceUpdateParameters. +func (esup EventSourceUpdateParameters) AsBasicEventSourceUpdateParameters() (BasicEventSourceUpdateParameters, bool) { + return &esup, true +} + // Gen1EnvironmentCreateOrUpdateParameters parameters supplied to the Create or Update Environment // operation for a Gen1 environment. type Gen1EnvironmentCreateOrUpdateParameters struct { @@ -1719,10 +2409,6 @@ type Gen1EnvironmentResourceProperties struct { DataAccessFqdn *string `json:"dataAccessFqdn,omitempty"` // Status - An object that represents the status of the environment, and its internal state in the Time Series Insights service. Status *EnvironmentStatus `json:"status,omitempty"` - // ProvisioningState - Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // CreationTime - READ-ONLY; The time the resource was created. - CreationTime *date.Time `json:"creationTime,omitempty"` } // MarshalJSON is the custom marshaler for Gen1EnvironmentResourceProperties. @@ -1740,9 +2426,6 @@ func (g1erp Gen1EnvironmentResourceProperties) MarshalJSON() ([]byte, error) { if g1erp.Status != nil { objectMap["status"] = g1erp.Status } - if g1erp.ProvisioningState != "" { - objectMap["provisioningState"] = g1erp.ProvisioningState - } return json.Marshal(objectMap) } @@ -1755,10 +2438,13 @@ type Gen1EnvironmentUpdateParameters struct { *Gen1EnvironmentMutableProperties `json:"properties,omitempty"` // Tags - Key-value pairs of additional properties for the environment. Tags map[string]*string `json:"tags"` + // Kind - Possible values include: 'KindBasicEnvironmentUpdateParametersKindEnvironmentUpdateParameters', 'KindBasicEnvironmentUpdateParametersKindGen1', 'KindBasicEnvironmentUpdateParametersKindGen2' + Kind KindBasicEnvironmentUpdateParameters `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for Gen1EnvironmentUpdateParameters. func (g1eup Gen1EnvironmentUpdateParameters) MarshalJSON() ([]byte, error) { + g1eup.Kind = KindBasicEnvironmentUpdateParametersKindGen1 objectMap := make(map[string]interface{}) if g1eup.Sku != nil { objectMap["sku"] = g1eup.Sku @@ -1769,9 +2455,32 @@ func (g1eup Gen1EnvironmentUpdateParameters) MarshalJSON() ([]byte, error) { if g1eup.Tags != nil { objectMap["tags"] = g1eup.Tags } + if g1eup.Kind != "" { + objectMap["kind"] = g1eup.Kind + } return json.Marshal(objectMap) } +// AsGen1EnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for Gen1EnvironmentUpdateParameters. +func (g1eup Gen1EnvironmentUpdateParameters) AsGen1EnvironmentUpdateParameters() (*Gen1EnvironmentUpdateParameters, bool) { + return &g1eup, true +} + +// AsGen2EnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for Gen1EnvironmentUpdateParameters. +func (g1eup Gen1EnvironmentUpdateParameters) AsGen2EnvironmentUpdateParameters() (*Gen2EnvironmentUpdateParameters, bool) { + return nil, false +} + +// AsEnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for Gen1EnvironmentUpdateParameters. +func (g1eup Gen1EnvironmentUpdateParameters) AsEnvironmentUpdateParameters() (*EnvironmentUpdateParameters, bool) { + return nil, false +} + +// AsBasicEnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for Gen1EnvironmentUpdateParameters. +func (g1eup Gen1EnvironmentUpdateParameters) AsBasicEnvironmentUpdateParameters() (BasicEnvironmentUpdateParameters, bool) { + return &g1eup, true +} + // UnmarshalJSON is the custom unmarshaler for Gen1EnvironmentUpdateParameters struct. func (g1eup *Gen1EnvironmentUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1808,6 +2517,15 @@ func (g1eup *Gen1EnvironmentUpdateParameters) UnmarshalJSON(body []byte) error { } g1eup.Tags = tags } + case "kind": + if v != nil { + var kind KindBasicEnvironmentUpdateParameters + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + g1eup.Kind = kind + } } } @@ -2100,6 +2818,12 @@ func (g2er *Gen2EnvironmentResource) UnmarshalJSON(body []byte) error { // Gen2EnvironmentResourceProperties properties of the Gen2 environment. type Gen2EnvironmentResourceProperties struct { + // TimeSeriesIDProperties - The list of event properties which will be used to define the environment's time series id. + TimeSeriesIDProperties *[]TimeSeriesIDProperty `json:"timeSeriesIdProperties,omitempty"` + // StorageConfiguration - The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. + StorageConfiguration *Gen2StorageConfigurationOutput `json:"storageConfiguration,omitempty"` + // WarmStoreConfiguration - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. + WarmStoreConfiguration *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` // DataAccessID - READ-ONLY; An id used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. DataAccessID *uuid.UUID `json:"dataAccessId,omitempty"` // DataAccessFqdn - READ-ONLY; The fully qualified domain name used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. @@ -2110,23 +2834,11 @@ type Gen2EnvironmentResourceProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CreationTime - READ-ONLY; The time the resource was created. CreationTime *date.Time `json:"creationTime,omitempty"` - // TimeSeriesIDProperties - The list of event properties which will be used to define the environment's time series id. - TimeSeriesIDProperties *[]TimeSeriesIDProperty `json:"timeSeriesIdProperties,omitempty"` - // StorageConfiguration - The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. - StorageConfiguration *Gen2StorageConfigurationOutput `json:"storageConfiguration,omitempty"` - // WarmStoreConfiguration - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. - WarmStoreConfiguration *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` } // MarshalJSON is the custom marshaler for Gen2EnvironmentResourceProperties. func (g2erp Gen2EnvironmentResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if g2erp.Status != nil { - objectMap["status"] = g2erp.Status - } - if g2erp.ProvisioningState != "" { - objectMap["provisioningState"] = g2erp.ProvisioningState - } if g2erp.TimeSeriesIDProperties != nil { objectMap["timeSeriesIdProperties"] = g2erp.TimeSeriesIDProperties } @@ -2136,6 +2848,12 @@ func (g2erp Gen2EnvironmentResourceProperties) MarshalJSON() ([]byte, error) { if g2erp.WarmStoreConfiguration != nil { objectMap["warmStoreConfiguration"] = g2erp.WarmStoreConfiguration } + if g2erp.Status != nil { + objectMap["status"] = g2erp.Status + } + if g2erp.ProvisioningState != "" { + objectMap["provisioningState"] = g2erp.ProvisioningState + } return json.Marshal(objectMap) } @@ -2146,10 +2864,13 @@ type Gen2EnvironmentUpdateParameters struct { *Gen2EnvironmentMutableProperties `json:"properties,omitempty"` // Tags - Key-value pairs of additional properties for the environment. Tags map[string]*string `json:"tags"` + // Kind - Possible values include: 'KindBasicEnvironmentUpdateParametersKindEnvironmentUpdateParameters', 'KindBasicEnvironmentUpdateParametersKindGen1', 'KindBasicEnvironmentUpdateParametersKindGen2' + Kind KindBasicEnvironmentUpdateParameters `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for Gen2EnvironmentUpdateParameters. func (g2eup Gen2EnvironmentUpdateParameters) MarshalJSON() ([]byte, error) { + g2eup.Kind = KindBasicEnvironmentUpdateParametersKindGen2 objectMap := make(map[string]interface{}) if g2eup.Gen2EnvironmentMutableProperties != nil { objectMap["properties"] = g2eup.Gen2EnvironmentMutableProperties @@ -2157,9 +2878,32 @@ func (g2eup Gen2EnvironmentUpdateParameters) MarshalJSON() ([]byte, error) { if g2eup.Tags != nil { objectMap["tags"] = g2eup.Tags } + if g2eup.Kind != "" { + objectMap["kind"] = g2eup.Kind + } return json.Marshal(objectMap) } +// AsGen1EnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for Gen2EnvironmentUpdateParameters. +func (g2eup Gen2EnvironmentUpdateParameters) AsGen1EnvironmentUpdateParameters() (*Gen1EnvironmentUpdateParameters, bool) { + return nil, false +} + +// AsGen2EnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for Gen2EnvironmentUpdateParameters. +func (g2eup Gen2EnvironmentUpdateParameters) AsGen2EnvironmentUpdateParameters() (*Gen2EnvironmentUpdateParameters, bool) { + return &g2eup, true +} + +// AsEnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for Gen2EnvironmentUpdateParameters. +func (g2eup Gen2EnvironmentUpdateParameters) AsEnvironmentUpdateParameters() (*EnvironmentUpdateParameters, bool) { + return nil, false +} + +// AsBasicEnvironmentUpdateParameters is the BasicEnvironmentUpdateParameters implementation for Gen2EnvironmentUpdateParameters. +func (g2eup Gen2EnvironmentUpdateParameters) AsBasicEnvironmentUpdateParameters() (BasicEnvironmentUpdateParameters, bool) { + return &g2eup, true +} + // UnmarshalJSON is the custom unmarshaler for Gen2EnvironmentUpdateParameters struct. func (g2eup *Gen2EnvironmentUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -2187,6 +2931,15 @@ func (g2eup *Gen2EnvironmentUpdateParameters) UnmarshalJSON(body []byte) error { } g2eup.Tags = tags } + case "kind": + if v != nil { + var kind KindBasicEnvironmentUpdateParameters + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + g2eup.Kind = kind + } } } @@ -2226,6 +2979,15 @@ type IngressEnvironmentStatus struct { StateDetails *EnvironmentStateDetails `json:"stateDetails,omitempty"` } +// IngressStartAtProperties an object that contains the details about the starting point in time to ingest +// events. +type IngressStartAtProperties struct { + // Type - The type of the ingressStartAt, It can be "EarliestAvailable", "EventSourceCreationTime", "CustomEnqueuedTime". Possible values include: 'EarliestAvailable', 'EventSourceCreationTime', 'CustomEnqueuedTime' + Type IngressStartAtType `json:"type,omitempty"` + // Time - ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying the date and time that will be the starting point for Events to be consumed. + Time *string `json:"time,omitempty"` +} + // IoTHubEventSourceCommonProperties properties of the IoTHub event source. type IoTHubEventSourceCommonProperties struct { // IotHubName - The name of the iot hub. @@ -2238,6 +3000,10 @@ type IoTHubEventSourceCommonProperties struct { EventSourceResourceID *string `json:"eventSourceResourceId,omitempty"` // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` + // IngressStartAtProperties - An object that contains the details about the starting point in time to ingest events. + *IngressStartAtProperties `json:"ingressStartAt,omitempty"` // ProvisioningState - Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CreationTime - READ-ONLY; The time the resource was created. @@ -2262,10 +3028,112 @@ func (ithescp IoTHubEventSourceCommonProperties) MarshalJSON() ([]byte, error) { if ithescp.TimestampPropertyName != nil { objectMap["timestampPropertyName"] = ithescp.TimestampPropertyName } + if ithescp.LocalTimestamp != nil { + objectMap["localTimestamp"] = ithescp.LocalTimestamp + } + if ithescp.IngressStartAtProperties != nil { + objectMap["ingressStartAt"] = ithescp.IngressStartAtProperties + } if ithescp.ProvisioningState != "" { objectMap["provisioningState"] = ithescp.ProvisioningState } - return json.Marshal(objectMap) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IoTHubEventSourceCommonProperties struct. +func (ithescp *IoTHubEventSourceCommonProperties) 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 "iotHubName": + if v != nil { + var iotHubName string + err = json.Unmarshal(*v, &iotHubName) + if err != nil { + return err + } + ithescp.IotHubName = &iotHubName + } + case "consumerGroupName": + if v != nil { + var consumerGroupName string + err = json.Unmarshal(*v, &consumerGroupName) + if err != nil { + return err + } + ithescp.ConsumerGroupName = &consumerGroupName + } + case "keyName": + if v != nil { + var keyName string + err = json.Unmarshal(*v, &keyName) + if err != nil { + return err + } + ithescp.KeyName = &keyName + } + case "eventSourceResourceId": + if v != nil { + var eventSourceResourceID string + err = json.Unmarshal(*v, &eventSourceResourceID) + if err != nil { + return err + } + ithescp.EventSourceResourceID = &eventSourceResourceID + } + case "timestampPropertyName": + if v != nil { + var timestampPropertyName string + err = json.Unmarshal(*v, ×tampPropertyName) + if err != nil { + return err + } + ithescp.TimestampPropertyName = ×tampPropertyName + } + case "localTimestamp": + if v != nil { + var localTimestamp LocalTimestamp + err = json.Unmarshal(*v, &localTimestamp) + if err != nil { + return err + } + ithescp.LocalTimestamp = &localTimestamp + } + case "ingressStartAt": + if v != nil { + var ingressStartAtProperties IngressStartAtProperties + err = json.Unmarshal(*v, &ingressStartAtProperties) + if err != nil { + return err + } + ithescp.IngressStartAtProperties = &ingressStartAtProperties + } + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + ithescp.ProvisioningState = provisioningState + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + ithescp.CreationTime = &creationTime + } + } + } + + return nil } // IoTHubEventSourceCreateOrUpdateParameters parameters supplied to the Create or Update Event Source @@ -2399,6 +3267,10 @@ type IoTHubEventSourceCreationProperties struct { EventSourceResourceID *string `json:"eventSourceResourceId,omitempty"` // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` + // IngressStartAtProperties - An object that contains the details about the starting point in time to ingest events. + *IngressStartAtProperties `json:"ingressStartAt,omitempty"` // ProvisioningState - Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CreationTime - READ-ONLY; The time the resource was created. @@ -2426,12 +3298,123 @@ func (ithescp IoTHubEventSourceCreationProperties) MarshalJSON() ([]byte, error) if ithescp.TimestampPropertyName != nil { objectMap["timestampPropertyName"] = ithescp.TimestampPropertyName } + if ithescp.LocalTimestamp != nil { + objectMap["localTimestamp"] = ithescp.LocalTimestamp + } + if ithescp.IngressStartAtProperties != nil { + objectMap["ingressStartAt"] = ithescp.IngressStartAtProperties + } if ithescp.ProvisioningState != "" { objectMap["provisioningState"] = ithescp.ProvisioningState } return json.Marshal(objectMap) } +// UnmarshalJSON is the custom unmarshaler for IoTHubEventSourceCreationProperties struct. +func (ithescp *IoTHubEventSourceCreationProperties) 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 "sharedAccessKey": + if v != nil { + var sharedAccessKey string + err = json.Unmarshal(*v, &sharedAccessKey) + if err != nil { + return err + } + ithescp.SharedAccessKey = &sharedAccessKey + } + case "iotHubName": + if v != nil { + var iotHubName string + err = json.Unmarshal(*v, &iotHubName) + if err != nil { + return err + } + ithescp.IotHubName = &iotHubName + } + case "consumerGroupName": + if v != nil { + var consumerGroupName string + err = json.Unmarshal(*v, &consumerGroupName) + if err != nil { + return err + } + ithescp.ConsumerGroupName = &consumerGroupName + } + case "keyName": + if v != nil { + var keyName string + err = json.Unmarshal(*v, &keyName) + if err != nil { + return err + } + ithescp.KeyName = &keyName + } + case "eventSourceResourceId": + if v != nil { + var eventSourceResourceID string + err = json.Unmarshal(*v, &eventSourceResourceID) + if err != nil { + return err + } + ithescp.EventSourceResourceID = &eventSourceResourceID + } + case "timestampPropertyName": + if v != nil { + var timestampPropertyName string + err = json.Unmarshal(*v, ×tampPropertyName) + if err != nil { + return err + } + ithescp.TimestampPropertyName = ×tampPropertyName + } + case "localTimestamp": + if v != nil { + var localTimestamp LocalTimestamp + err = json.Unmarshal(*v, &localTimestamp) + if err != nil { + return err + } + ithescp.LocalTimestamp = &localTimestamp + } + case "ingressStartAt": + if v != nil { + var ingressStartAtProperties IngressStartAtProperties + err = json.Unmarshal(*v, &ingressStartAtProperties) + if err != nil { + return err + } + ithescp.IngressStartAtProperties = &ingressStartAtProperties + } + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + ithescp.ProvisioningState = provisioningState + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + ithescp.CreationTime = &creationTime + } + } + } + + return nil +} + // IoTHubEventSourceMutableProperties an object that represents a set of mutable IoTHub event source // resource properties. type IoTHubEventSourceMutableProperties struct { @@ -2439,8 +3422,6 @@ type IoTHubEventSourceMutableProperties struct { SharedAccessKey *string `json:"sharedAccessKey,omitempty"` // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` - // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. - LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` } // IoTHubEventSourceResource an event source that receives its data from an Azure IoTHub. @@ -2589,6 +3570,10 @@ type IoTHubEventSourceResourceProperties struct { EventSourceResourceID *string `json:"eventSourceResourceId,omitempty"` // TimestampPropertyName - The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used. TimestampPropertyName *string `json:"timestampPropertyName,omitempty"` + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` + // IngressStartAtProperties - An object that contains the details about the starting point in time to ingest events. + *IngressStartAtProperties `json:"ingressStartAt,omitempty"` // ProvisioningState - Provisioning state of the resource. Possible values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CreationTime - READ-ONLY; The time the resource was created. @@ -2613,12 +3598,114 @@ func (ithesrp IoTHubEventSourceResourceProperties) MarshalJSON() ([]byte, error) if ithesrp.TimestampPropertyName != nil { objectMap["timestampPropertyName"] = ithesrp.TimestampPropertyName } + if ithesrp.LocalTimestamp != nil { + objectMap["localTimestamp"] = ithesrp.LocalTimestamp + } + if ithesrp.IngressStartAtProperties != nil { + objectMap["ingressStartAt"] = ithesrp.IngressStartAtProperties + } if ithesrp.ProvisioningState != "" { objectMap["provisioningState"] = ithesrp.ProvisioningState } return json.Marshal(objectMap) } +// UnmarshalJSON is the custom unmarshaler for IoTHubEventSourceResourceProperties struct. +func (ithesrp *IoTHubEventSourceResourceProperties) 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 "iotHubName": + if v != nil { + var iotHubName string + err = json.Unmarshal(*v, &iotHubName) + if err != nil { + return err + } + ithesrp.IotHubName = &iotHubName + } + case "consumerGroupName": + if v != nil { + var consumerGroupName string + err = json.Unmarshal(*v, &consumerGroupName) + if err != nil { + return err + } + ithesrp.ConsumerGroupName = &consumerGroupName + } + case "keyName": + if v != nil { + var keyName string + err = json.Unmarshal(*v, &keyName) + if err != nil { + return err + } + ithesrp.KeyName = &keyName + } + case "eventSourceResourceId": + if v != nil { + var eventSourceResourceID string + err = json.Unmarshal(*v, &eventSourceResourceID) + if err != nil { + return err + } + ithesrp.EventSourceResourceID = &eventSourceResourceID + } + case "timestampPropertyName": + if v != nil { + var timestampPropertyName string + err = json.Unmarshal(*v, ×tampPropertyName) + if err != nil { + return err + } + ithesrp.TimestampPropertyName = ×tampPropertyName + } + case "localTimestamp": + if v != nil { + var localTimestamp LocalTimestamp + err = json.Unmarshal(*v, &localTimestamp) + if err != nil { + return err + } + ithesrp.LocalTimestamp = &localTimestamp + } + case "ingressStartAt": + if v != nil { + var ingressStartAtProperties IngressStartAtProperties + err = json.Unmarshal(*v, &ingressStartAtProperties) + if err != nil { + return err + } + ithesrp.IngressStartAtProperties = &ingressStartAtProperties + } + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + ithesrp.ProvisioningState = provisioningState + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + ithesrp.CreationTime = &creationTime + } + } + } + + return nil +} + // IoTHubEventSourceUpdateParameters parameters supplied to the Update Event Source operation to update an // IoTHub event source. type IoTHubEventSourceUpdateParameters struct { @@ -2626,10 +3713,13 @@ type IoTHubEventSourceUpdateParameters struct { *IoTHubEventSourceMutableProperties `json:"properties,omitempty"` // Tags - Key-value pairs of additional properties for the event source. Tags map[string]*string `json:"tags"` + // Kind - Possible values include: 'KindBasicEventSourceUpdateParametersKindEventSourceUpdateParameters', 'KindBasicEventSourceUpdateParametersKindMicrosoftEventHub', 'KindBasicEventSourceUpdateParametersKindMicrosoftIoTHub' + Kind KindBasicEventSourceUpdateParameters `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for IoTHubEventSourceUpdateParameters. func (ithesup IoTHubEventSourceUpdateParameters) MarshalJSON() ([]byte, error) { + ithesup.Kind = KindBasicEventSourceUpdateParametersKindMicrosoftIoTHub objectMap := make(map[string]interface{}) if ithesup.IoTHubEventSourceMutableProperties != nil { objectMap["properties"] = ithesup.IoTHubEventSourceMutableProperties @@ -2637,9 +3727,32 @@ func (ithesup IoTHubEventSourceUpdateParameters) MarshalJSON() ([]byte, error) { if ithesup.Tags != nil { objectMap["tags"] = ithesup.Tags } + if ithesup.Kind != "" { + objectMap["kind"] = ithesup.Kind + } return json.Marshal(objectMap) } +// AsEventHubEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for IoTHubEventSourceUpdateParameters. +func (ithesup IoTHubEventSourceUpdateParameters) AsEventHubEventSourceUpdateParameters() (*EventHubEventSourceUpdateParameters, bool) { + return nil, false +} + +// AsIoTHubEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for IoTHubEventSourceUpdateParameters. +func (ithesup IoTHubEventSourceUpdateParameters) AsIoTHubEventSourceUpdateParameters() (*IoTHubEventSourceUpdateParameters, bool) { + return &ithesup, true +} + +// AsEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for IoTHubEventSourceUpdateParameters. +func (ithesup IoTHubEventSourceUpdateParameters) AsEventSourceUpdateParameters() (*EventSourceUpdateParameters, bool) { + return nil, false +} + +// AsBasicEventSourceUpdateParameters is the BasicEventSourceUpdateParameters implementation for IoTHubEventSourceUpdateParameters. +func (ithesup IoTHubEventSourceUpdateParameters) AsBasicEventSourceUpdateParameters() (BasicEventSourceUpdateParameters, bool) { + return &ithesup, true +} + // UnmarshalJSON is the custom unmarshaler for IoTHubEventSourceUpdateParameters struct. func (ithesup *IoTHubEventSourceUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -2667,6 +3780,15 @@ func (ithesup *IoTHubEventSourceUpdateParameters) UnmarshalJSON(body []byte) err } ithesup.Tags = tags } + case "kind": + if v != nil { + var kind KindBasicEventSourceUpdateParameters + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ithesup.Kind = kind + } } } @@ -2691,20 +3813,115 @@ type LocalTimestampTimeZoneOffset struct { PropertyName *string `json:"propertyName,omitempty"` } +// LogSpecification the specification of an Azure Monitoring log. +type LogSpecification struct { + // Name - Log name. + Name *string `json:"name,omitempty"` + // DisplayName - Log display name. + DisplayName *string `json:"displayName,omitempty"` +} + +// MetricAvailability retention policy of a resource metric. +type MetricAvailability struct { + TimeGrain *string `json:"timeGrain,omitempty"` + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// MetricSpecification metric specification of operation. +type MetricSpecification struct { + // Name - Name of metric specification. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of metric specification. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Display description of metric specification. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Unit could be Bytes or Count. + Unit *string `json:"unit,omitempty"` + // Dimensions - Dimensions of blobs, including blob type and access tier. + Dimensions *[]Dimension `json:"dimensions,omitempty"` + // AggregationType - Aggregation type could be Average. + AggregationType *string `json:"aggregationType,omitempty"` + // Availabilities - Retention policies of a resource metric. + Availabilities *[]MetricAvailability `json:"availabilities,omitempty"` + // Category - The category this metric specification belong to, could be Capacity. + Category *string `json:"category,omitempty"` + // ResourceIDDimensionNameOverride - Account Resource Id. + ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` +} + // Operation a Time Series Insights REST API operation type Operation struct { // Name - READ-ONLY; The name of the operation being performed on this particular object. Name *string `json:"name,omitempty"` // Display - READ-ONLY; Contains the localized display information for this particular operation / action. - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay `json:"display,omitempty"` + Origin *string `json:"origin,omitempty"` + *OperationProperties `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if o.Origin != nil { + objectMap["origin"] = o.Origin + } + if o.OperationProperties != nil { + objectMap["properties"] = o.OperationProperties + } return json.Marshal(objectMap) } +// UnmarshalJSON is the custom unmarshaler for Operation struct. +func (o *Operation) 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 "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + o.Name = &name + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + o.Display = &display + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + o.Origin = &origin + } + case "properties": + if v != nil { + var operationProperties OperationProperties + err = json.Unmarshal(*v, &operationProperties) + if err != nil { + return err + } + o.OperationProperties = &operationProperties + } + } + } + + return nil +} + // OperationDisplay contains the localized display information for this particular operation / action. type OperationDisplay struct { // Provider - READ-ONLY; The localized friendly form of the resource provider name. @@ -2889,6 +4106,12 @@ func NewOperationListResultPage(cur OperationListResult, getNextPage func(contex } } +// OperationProperties properties of operation, include metric specifications. +type OperationProperties struct { + // ServiceSpecification - One property of operation, include metric specifications. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + // ReferenceDataSetCreateOrUpdateParameters ... type ReferenceDataSetCreateOrUpdateParameters struct { *ReferenceDataSetCreationProperties `json:"properties,omitempty"` @@ -3157,6 +4380,14 @@ func (rp ResourceProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ServiceSpecification one property of operation, include metric specifications. +type ServiceSpecification struct { + // MetricSpecifications - Metric specifications of operation. + MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` + // LogSpecifications - A list of Azure Monitoring log definitions. + LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` +} + // Sku the sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 (L1). For Gen1 // environments the sku determines the capacity of the environment, the ingress rate, and the billing rate. type Sku struct { diff --git a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/timeseriesinsightsapi/interfaces.go b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/timeseriesinsightsapi/interfaces.go index 77269f9a3acd..cf62595e7273 100644 --- a/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/timeseriesinsightsapi/interfaces.go +++ b/services/timeseriesinsights/mgmt/2020-05-15/timeseriesinsights/timeseriesinsightsapi/interfaces.go @@ -27,7 +27,7 @@ type EnvironmentsClientAPI interface { Get(ctx context.Context, resourceGroupName string, environmentName string, expand string) (result timeseriesinsights.EnvironmentResourceModel, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result timeseriesinsights.EnvironmentListResponse, err error) ListBySubscription(ctx context.Context) (result timeseriesinsights.EnvironmentListResponse, err error) - Update(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters timeseriesinsights.EnvironmentUpdateParameters) (result timeseriesinsights.EnvironmentsUpdateFuture, err error) + Update(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters timeseriesinsights.BasicEnvironmentUpdateParameters) (result timeseriesinsights.EnvironmentsUpdateFuture, err error) } var _ EnvironmentsClientAPI = (*timeseriesinsights.EnvironmentsClient)(nil) @@ -38,7 +38,7 @@ type EventSourcesClientAPI interface { Delete(ctx context.Context, resourceGroupName string, environmentName string, eventSourceName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, environmentName string, eventSourceName string) (result timeseriesinsights.EventSourceResourceModel, err error) ListByEnvironment(ctx context.Context, resourceGroupName string, environmentName string) (result timeseriesinsights.EventSourceListResponse, err error) - Update(ctx context.Context, resourceGroupName string, environmentName string, eventSourceName string, eventSourceUpdateParameters timeseriesinsights.EventSourceUpdateParameters) (result timeseriesinsights.EventSourceResourceModel, err error) + Update(ctx context.Context, resourceGroupName string, environmentName string, eventSourceName string, eventSourceUpdateParameters timeseriesinsights.BasicEventSourceUpdateParameters) (result timeseriesinsights.EventSourceResourceModel, err error) } var _ EventSourcesClientAPI = (*timeseriesinsights.EventSourcesClient)(nil)