diff --git a/services/cdn/mgmt/2015-06-01/cdn/CHANGELOG.md b/services/cdn/mgmt/2015-06-01/cdn/CHANGELOG.md index f817772e217f..a1ecf841edb0 100644 --- a/services/cdn/mgmt/2015-06-01/cdn/CHANGELOG.md +++ b/services/cdn/mgmt/2015-06-01/cdn/CHANGELOG.md @@ -1,7 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. Resource.MarshalJSON() ([]byte, error) diff --git a/services/cdn/mgmt/2015-06-01/cdn/_meta.json b/services/cdn/mgmt/2015-06-01/cdn/_meta.json index d9d45ff92848..cd83af67d31b 100644 --- a/services/cdn/mgmt/2015-06-01/cdn/_meta.json +++ b/services/cdn/mgmt/2015-06-01/cdn/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a7155ecd04ca66b19505f391978da03aae1cc94a", "readme": "/_/azure-rest-api-specs/specification/cdn/resource-manager/readme.md", "tag": "package-2015-06", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/cdn/mgmt/2016-04-02/cdn/CHANGELOG.md b/services/cdn/mgmt/2016-04-02/cdn/CHANGELOG.md index f817772e217f..a1ecf841edb0 100644 --- a/services/cdn/mgmt/2016-04-02/cdn/CHANGELOG.md +++ b/services/cdn/mgmt/2016-04-02/cdn/CHANGELOG.md @@ -1,7 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. Resource.MarshalJSON() ([]byte, error) diff --git a/services/cdn/mgmt/2016-04-02/cdn/_meta.json b/services/cdn/mgmt/2016-04-02/cdn/_meta.json index c33076d6fba0..915581f10563 100644 --- a/services/cdn/mgmt/2016-04-02/cdn/_meta.json +++ b/services/cdn/mgmt/2016-04-02/cdn/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a7155ecd04ca66b19505f391978da03aae1cc94a", "readme": "/_/azure-rest-api-specs/specification/cdn/resource-manager/readme.md", "tag": "package-2016-04", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/cdn/mgmt/2016-10-02/cdn/CHANGELOG.md b/services/cdn/mgmt/2016-10-02/cdn/CHANGELOG.md index 8324c0098c02..a1ecf841edb0 100644 --- a/services/cdn/mgmt/2016-10-02/cdn/CHANGELOG.md +++ b/services/cdn/mgmt/2016-10-02/cdn/CHANGELOG.md @@ -1,7 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. ProfileProperties.MarshalJSON() ([]byte, error) diff --git a/services/cdn/mgmt/2016-10-02/cdn/_meta.json b/services/cdn/mgmt/2016-10-02/cdn/_meta.json index 411451d0f019..8afa6516ea67 100644 --- a/services/cdn/mgmt/2016-10-02/cdn/_meta.json +++ b/services/cdn/mgmt/2016-10-02/cdn/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a7155ecd04ca66b19505f391978da03aae1cc94a", "readme": "/_/azure-rest-api-specs/specification/cdn/resource-manager/readme.md", "tag": "package-2016-10", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/cdn/mgmt/2017-04-02/cdn/CHANGELOG.md b/services/cdn/mgmt/2017-04-02/cdn/CHANGELOG.md index 6984fcf64633..a1ecf841edb0 100644 --- a/services/cdn/mgmt/2017-04-02/cdn/CHANGELOG.md +++ b/services/cdn/mgmt/2017-04-02/cdn/CHANGELOG.md @@ -1,17 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. CheckNameAvailabilityOutput.MarshalJSON() ([]byte, error) -1. ErrorResponse.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. ProfileProperties.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. ResourceUsage.MarshalJSON() ([]byte, error) -1. SsoURI.MarshalJSON() ([]byte, error) -1. SupportedOptimizationTypesListResult.MarshalJSON() ([]byte, error) -1. ValidateCustomDomainOutput.MarshalJSON() ([]byte, error) -1. ValidateProbeOutput.MarshalJSON() ([]byte, error) diff --git a/services/cdn/mgmt/2017-04-02/cdn/_meta.json b/services/cdn/mgmt/2017-04-02/cdn/_meta.json index 502f323bdca5..23106c13157e 100644 --- a/services/cdn/mgmt/2017-04-02/cdn/_meta.json +++ b/services/cdn/mgmt/2017-04-02/cdn/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a7155ecd04ca66b19505f391978da03aae1cc94a", "readme": "/_/azure-rest-api-specs/specification/cdn/resource-manager/readme.md", "tag": "package-2017-04", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/cdn/mgmt/2017-10-12/cdn/CHANGELOG.md b/services/cdn/mgmt/2017-10-12/cdn/CHANGELOG.md index 6984fcf64633..a1ecf841edb0 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/CHANGELOG.md +++ b/services/cdn/mgmt/2017-10-12/cdn/CHANGELOG.md @@ -1,17 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. CheckNameAvailabilityOutput.MarshalJSON() ([]byte, error) -1. ErrorResponse.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. ProfileProperties.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. ResourceUsage.MarshalJSON() ([]byte, error) -1. SsoURI.MarshalJSON() ([]byte, error) -1. SupportedOptimizationTypesListResult.MarshalJSON() ([]byte, error) -1. ValidateCustomDomainOutput.MarshalJSON() ([]byte, error) -1. ValidateProbeOutput.MarshalJSON() ([]byte, error) diff --git a/services/cdn/mgmt/2017-10-12/cdn/_meta.json b/services/cdn/mgmt/2017-10-12/cdn/_meta.json index a60ae91fc8f7..c210b2b010cf 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/_meta.json +++ b/services/cdn/mgmt/2017-10-12/cdn/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a7155ecd04ca66b19505f391978da03aae1cc94a", "readme": "/_/azure-rest-api-specs/specification/cdn/resource-manager/readme.md", "tag": "package-2017-10", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/cdn/mgmt/2019-04-15/cdn/CHANGELOG.md b/services/cdn/mgmt/2019-04-15/cdn/CHANGELOG.md index 6984fcf64633..57a9ce8c7701 100644 --- a/services/cdn/mgmt/2019-04-15/cdn/CHANGELOG.md +++ b/services/cdn/mgmt/2019-04-15/cdn/CHANGELOG.md @@ -1,17 +1,38 @@ -# Change History +# Unreleased + +## Breaking Changes + +### Signature Changes + +#### Funcs + +1. CustomDomainsClient.DisableCustomHTTPS + - Returns + - From: CustomDomain, error + - To: CustomDomainsDisableCustomHTTPSFuture, error +1. CustomDomainsClient.DisableCustomHTTPSSender + - Returns + - From: *http.Response, error + - To: CustomDomainsDisableCustomHTTPSFuture, error +1. CustomDomainsClient.EnableCustomHTTPS + - Returns + - From: CustomDomain, error + - To: CustomDomainsEnableCustomHTTPSFuture, error +1. CustomDomainsClient.EnableCustomHTTPSSender + - Returns + - From: *http.Response, error + - To: CustomDomainsEnableCustomHTTPSFuture, error ## Additive Changes ### New Funcs -1. CheckNameAvailabilityOutput.MarshalJSON() ([]byte, error) -1. ErrorResponse.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. ProfileProperties.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. ResourceUsage.MarshalJSON() ([]byte, error) -1. SsoURI.MarshalJSON() ([]byte, error) -1. SupportedOptimizationTypesListResult.MarshalJSON() ([]byte, error) -1. ValidateCustomDomainOutput.MarshalJSON() ([]byte, error) -1. ValidateProbeOutput.MarshalJSON() ([]byte, error) +1. *CustomDomainsDisableCustomHTTPSFuture.UnmarshalJSON([]byte) error +1. *CustomDomainsEnableCustomHTTPSFuture.UnmarshalJSON([]byte) error + +### Struct Changes + +#### New Structs + +1. CustomDomainsDisableCustomHTTPSFuture +1. CustomDomainsEnableCustomHTTPSFuture diff --git a/services/cdn/mgmt/2019-04-15/cdn/_meta.json b/services/cdn/mgmt/2019-04-15/cdn/_meta.json index 59efc2b20009..91758ca28247 100644 --- a/services/cdn/mgmt/2019-04-15/cdn/_meta.json +++ b/services/cdn/mgmt/2019-04-15/cdn/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a7155ecd04ca66b19505f391978da03aae1cc94a", "readme": "/_/azure-rest-api-specs/specification/cdn/resource-manager/readme.md", "tag": "package-2019-04", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/cdn/mgmt/2019-04-15/cdn/cdnapi/interfaces.go b/services/cdn/mgmt/2019-04-15/cdn/cdnapi/interfaces.go index 26538fb03d0e..9963e601a5f8 100644 --- a/services/cdn/mgmt/2019-04-15/cdn/cdnapi/interfaces.go +++ b/services/cdn/mgmt/2019-04-15/cdn/cdnapi/interfaces.go @@ -71,8 +71,8 @@ var _ OriginsClientAPI = (*cdn.OriginsClient)(nil) type CustomDomainsClientAPI interface { Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties cdn.CustomDomainParameters) (result cdn.CustomDomainsCreateFuture, err error) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomainsDeleteFuture, err error) - DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomain, err error) - EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *cdn.BasicCustomDomainHTTPSParameters) (result cdn.CustomDomain, err error) + DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomainsDisableCustomHTTPSFuture, err error) + EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *cdn.BasicCustomDomainHTTPSParameters) (result cdn.CustomDomainsEnableCustomHTTPSFuture, err error) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomain, err error) ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.CustomDomainListResultPage, err error) ListByEndpointComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.CustomDomainListResultIterator, err error) diff --git a/services/cdn/mgmt/2019-04-15/cdn/customdomains.go b/services/cdn/mgmt/2019-04-15/cdn/customdomains.go index cf94d9403dee..6c85201e8ab9 100644 --- a/services/cdn/mgmt/2019-04-15/cdn/customdomains.go +++ b/services/cdn/mgmt/2019-04-15/cdn/customdomains.go @@ -223,13 +223,13 @@ func (client CustomDomainsClient) DeleteResponder(resp *http.Response) (result C // profileName - name of the CDN profile which is unique within the resource group. // endpointName - name of the endpoint under the profile which is unique globally. // customDomainName - name of the custom domain within an endpoint. -func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomain, err error) { +func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomainsDisableCustomHTTPSFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.DisableCustomHTTPS") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -248,16 +248,9 @@ func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resour return } - resp, err := client.DisableCustomHTTPSSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", resp, "Failure sending request") - return - } - - result, err = client.DisableCustomHTTPSResponder(resp) + result, err = client.DisableCustomHTTPSSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", nil, "Failure sending request") return } @@ -289,8 +282,17 @@ func (client CustomDomainsClient) DisableCustomHTTPSPreparer(ctx context.Context // DisableCustomHTTPSSender sends the DisableCustomHTTPS request. The method will close the // http.Response Body if it receives an error. -func (client CustomDomainsClient) DisableCustomHTTPSSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client CustomDomainsClient) DisableCustomHTTPSSender(req *http.Request) (future CustomDomainsDisableCustomHTTPSFuture, err error) { + var resp *http.Response + 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 } // DisableCustomHTTPSResponder handles the response to the DisableCustomHTTPS request. The method always @@ -314,13 +316,13 @@ func (client CustomDomainsClient) DisableCustomHTTPSResponder(resp *http.Respons // customDomainHTTPSParameters - the configuration specifying how to enable HTTPS for the custom domain - using // CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed // certificate by default. -func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *BasicCustomDomainHTTPSParameters) (result CustomDomain, err error) { +func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *BasicCustomDomainHTTPSParameters) (result CustomDomainsEnableCustomHTTPSFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.EnableCustomHTTPS") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -339,16 +341,9 @@ func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourc return } - resp, err := client.EnableCustomHTTPSSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", resp, "Failure sending request") - return - } - - result, err = client.EnableCustomHTTPSResponder(resp) + result, err = client.EnableCustomHTTPSSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", nil, "Failure sending request") return } @@ -385,8 +380,17 @@ func (client CustomDomainsClient) EnableCustomHTTPSPreparer(ctx context.Context, // EnableCustomHTTPSSender sends the EnableCustomHTTPS request. The method will close the // http.Response Body if it receives an error. -func (client CustomDomainsClient) EnableCustomHTTPSSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client CustomDomainsClient) EnableCustomHTTPSSender(req *http.Request) (future CustomDomainsEnableCustomHTTPSFuture, err error) { + var resp *http.Response + 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 } // EnableCustomHTTPSResponder handles the response to the EnableCustomHTTPS request. The method always diff --git a/services/cdn/mgmt/2019-04-15/cdn/models.go b/services/cdn/mgmt/2019-04-15/cdn/models.go index db2b5c87dd8a..13e66696bd93 100644 --- a/services/cdn/mgmt/2019-04-15/cdn/models.go +++ b/services/cdn/mgmt/2019-04-15/cdn/models.go @@ -670,6 +670,92 @@ func (future *CustomDomainsDeleteFuture) result(client CustomDomainsClient) (cd return } +// CustomDomainsDisableCustomHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CustomDomainsDisableCustomHTTPSFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CustomDomainsClient) (CustomDomain, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CustomDomainsDisableCustomHTTPSFuture) 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 CustomDomainsDisableCustomHTTPSFuture.Result. +func (future *CustomDomainsDisableCustomHTTPSFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDisableCustomHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsDisableCustomHTTPSFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { + cd, err = client.DisableCustomHTTPSResponder(cd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDisableCustomHTTPSFuture", "Result", cd.Response.Response, "Failure responding to request") + } + } + return +} + +// CustomDomainsEnableCustomHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CustomDomainsEnableCustomHTTPSFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CustomDomainsClient) (CustomDomain, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CustomDomainsEnableCustomHTTPSFuture) 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 CustomDomainsEnableCustomHTTPSFuture.Result. +func (future *CustomDomainsEnableCustomHTTPSFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsEnableCustomHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsEnableCustomHTTPSFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { + cd, err = client.EnableCustomHTTPSResponder(cd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsEnableCustomHTTPSFuture", "Result", cd.Response.Response, "Failure responding to request") + } + } + return +} + // DeepCreatedOrigin the main origin of CDN content which is added when creating a CDN endpoint. type DeepCreatedOrigin struct { // Name - Origin name diff --git a/services/cdn/mgmt/2019-06-15/cdn/CHANGELOG.md b/services/cdn/mgmt/2019-06-15/cdn/CHANGELOG.md index 4f99f0da927a..57a9ce8c7701 100644 --- a/services/cdn/mgmt/2019-06-15/cdn/CHANGELOG.md +++ b/services/cdn/mgmt/2019-06-15/cdn/CHANGELOG.md @@ -1,20 +1,38 @@ -# Change History +# Unreleased + +## Breaking Changes + +### Signature Changes + +#### Funcs + +1. CustomDomainsClient.DisableCustomHTTPS + - Returns + - From: CustomDomain, error + - To: CustomDomainsDisableCustomHTTPSFuture, error +1. CustomDomainsClient.DisableCustomHTTPSSender + - Returns + - From: *http.Response, error + - To: CustomDomainsDisableCustomHTTPSFuture, error +1. CustomDomainsClient.EnableCustomHTTPS + - Returns + - From: CustomDomain, error + - To: CustomDomainsEnableCustomHTTPSFuture, error +1. CustomDomainsClient.EnableCustomHTTPSSender + - Returns + - From: *http.Response, error + - To: CustomDomainsEnableCustomHTTPSFuture, error ## Additive Changes ### New Funcs -1. CheckNameAvailabilityOutput.MarshalJSON() ([]byte, error) -1. ErrorResponse.MarshalJSON() ([]byte, error) -1. ManagedRuleDefinition.MarshalJSON() ([]byte, error) -1. ManagedRuleGroupDefinition.MarshalJSON() ([]byte, error) -1. ManagedRuleSetDefinitionProperties.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. ProfileProperties.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. ResourceUsage.MarshalJSON() ([]byte, error) -1. SsoURI.MarshalJSON() ([]byte, error) -1. SupportedOptimizationTypesListResult.MarshalJSON() ([]byte, error) -1. ValidateCustomDomainOutput.MarshalJSON() ([]byte, error) -1. ValidateProbeOutput.MarshalJSON() ([]byte, error) +1. *CustomDomainsDisableCustomHTTPSFuture.UnmarshalJSON([]byte) error +1. *CustomDomainsEnableCustomHTTPSFuture.UnmarshalJSON([]byte) error + +### Struct Changes + +#### New Structs + +1. CustomDomainsDisableCustomHTTPSFuture +1. CustomDomainsEnableCustomHTTPSFuture diff --git a/services/cdn/mgmt/2019-06-15/cdn/_meta.json b/services/cdn/mgmt/2019-06-15/cdn/_meta.json index 99e1b68a932c..034e7838f4da 100644 --- a/services/cdn/mgmt/2019-06-15/cdn/_meta.json +++ b/services/cdn/mgmt/2019-06-15/cdn/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a7155ecd04ca66b19505f391978da03aae1cc94a", "readme": "/_/azure-rest-api-specs/specification/cdn/resource-manager/readme.md", "tag": "package-2019-06", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/cdn/mgmt/2019-06-15/cdn/cdnapi/interfaces.go b/services/cdn/mgmt/2019-06-15/cdn/cdnapi/interfaces.go index 3153bddd5b1f..994f4675720e 100644 --- a/services/cdn/mgmt/2019-06-15/cdn/cdnapi/interfaces.go +++ b/services/cdn/mgmt/2019-06-15/cdn/cdnapi/interfaces.go @@ -72,8 +72,8 @@ var _ OriginsClientAPI = (*cdn.OriginsClient)(nil) type CustomDomainsClientAPI interface { Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties cdn.CustomDomainParameters) (result cdn.CustomDomainsCreateFuture, err error) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomainsDeleteFuture, err error) - DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomain, err error) - EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *cdn.BasicCustomDomainHTTPSParameters) (result cdn.CustomDomain, err error) + DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomainsDisableCustomHTTPSFuture, err error) + EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *cdn.BasicCustomDomainHTTPSParameters) (result cdn.CustomDomainsEnableCustomHTTPSFuture, err error) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomain, err error) ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.CustomDomainListResultPage, err error) ListByEndpointComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.CustomDomainListResultIterator, err error) diff --git a/services/cdn/mgmt/2019-06-15/cdn/customdomains.go b/services/cdn/mgmt/2019-06-15/cdn/customdomains.go index a385e3657a51..3396b3ea9d3a 100644 --- a/services/cdn/mgmt/2019-06-15/cdn/customdomains.go +++ b/services/cdn/mgmt/2019-06-15/cdn/customdomains.go @@ -223,13 +223,13 @@ func (client CustomDomainsClient) DeleteResponder(resp *http.Response) (result C // profileName - name of the CDN profile which is unique within the resource group. // endpointName - name of the endpoint under the profile which is unique globally. // customDomainName - name of the custom domain within an endpoint. -func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomain, err error) { +func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomainsDisableCustomHTTPSFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.DisableCustomHTTPS") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -248,16 +248,9 @@ func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resour return } - resp, err := client.DisableCustomHTTPSSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", resp, "Failure sending request") - return - } - - result, err = client.DisableCustomHTTPSResponder(resp) + result, err = client.DisableCustomHTTPSSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", nil, "Failure sending request") return } @@ -289,8 +282,17 @@ func (client CustomDomainsClient) DisableCustomHTTPSPreparer(ctx context.Context // DisableCustomHTTPSSender sends the DisableCustomHTTPS request. The method will close the // http.Response Body if it receives an error. -func (client CustomDomainsClient) DisableCustomHTTPSSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client CustomDomainsClient) DisableCustomHTTPSSender(req *http.Request) (future CustomDomainsDisableCustomHTTPSFuture, err error) { + var resp *http.Response + 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 } // DisableCustomHTTPSResponder handles the response to the DisableCustomHTTPS request. The method always @@ -314,13 +316,13 @@ func (client CustomDomainsClient) DisableCustomHTTPSResponder(resp *http.Respons // customDomainHTTPSParameters - the configuration specifying how to enable HTTPS for the custom domain - using // CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed // certificate by default. -func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *BasicCustomDomainHTTPSParameters) (result CustomDomain, err error) { +func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *BasicCustomDomainHTTPSParameters) (result CustomDomainsEnableCustomHTTPSFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.EnableCustomHTTPS") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -339,16 +341,9 @@ func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourc return } - resp, err := client.EnableCustomHTTPSSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", resp, "Failure sending request") - return - } - - result, err = client.EnableCustomHTTPSResponder(resp) + result, err = client.EnableCustomHTTPSSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", nil, "Failure sending request") return } @@ -385,8 +380,17 @@ func (client CustomDomainsClient) EnableCustomHTTPSPreparer(ctx context.Context, // EnableCustomHTTPSSender sends the EnableCustomHTTPS request. The method will close the // http.Response Body if it receives an error. -func (client CustomDomainsClient) EnableCustomHTTPSSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client CustomDomainsClient) EnableCustomHTTPSSender(req *http.Request) (future CustomDomainsEnableCustomHTTPSFuture, err error) { + var resp *http.Response + 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 } // EnableCustomHTTPSResponder handles the response to the EnableCustomHTTPS request. The method always diff --git a/services/cdn/mgmt/2019-06-15/cdn/models.go b/services/cdn/mgmt/2019-06-15/cdn/models.go index 2ff08eadfb43..b048fa6edfc5 100644 --- a/services/cdn/mgmt/2019-06-15/cdn/models.go +++ b/services/cdn/mgmt/2019-06-15/cdn/models.go @@ -670,6 +670,92 @@ func (future *CustomDomainsDeleteFuture) result(client CustomDomainsClient) (cd return } +// CustomDomainsDisableCustomHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CustomDomainsDisableCustomHTTPSFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CustomDomainsClient) (CustomDomain, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CustomDomainsDisableCustomHTTPSFuture) 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 CustomDomainsDisableCustomHTTPSFuture.Result. +func (future *CustomDomainsDisableCustomHTTPSFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDisableCustomHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsDisableCustomHTTPSFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { + cd, err = client.DisableCustomHTTPSResponder(cd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDisableCustomHTTPSFuture", "Result", cd.Response.Response, "Failure responding to request") + } + } + return +} + +// CustomDomainsEnableCustomHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CustomDomainsEnableCustomHTTPSFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CustomDomainsClient) (CustomDomain, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CustomDomainsEnableCustomHTTPSFuture) 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 CustomDomainsEnableCustomHTTPSFuture.Result. +func (future *CustomDomainsEnableCustomHTTPSFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsEnableCustomHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsEnableCustomHTTPSFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { + cd, err = client.EnableCustomHTTPSResponder(cd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsEnableCustomHTTPSFuture", "Result", cd.Response.Response, "Failure responding to request") + } + } + return +} + // CustomRule defines the common attributes for a custom rule that can be included in a waf policy type CustomRule struct { // Name - Defines the name of the custom rule diff --git a/services/cdn/mgmt/2020-04-15/cdn/CHANGELOG.md b/services/cdn/mgmt/2020-04-15/cdn/CHANGELOG.md index 4f99f0da927a..57a9ce8c7701 100644 --- a/services/cdn/mgmt/2020-04-15/cdn/CHANGELOG.md +++ b/services/cdn/mgmt/2020-04-15/cdn/CHANGELOG.md @@ -1,20 +1,38 @@ -# Change History +# Unreleased + +## Breaking Changes + +### Signature Changes + +#### Funcs + +1. CustomDomainsClient.DisableCustomHTTPS + - Returns + - From: CustomDomain, error + - To: CustomDomainsDisableCustomHTTPSFuture, error +1. CustomDomainsClient.DisableCustomHTTPSSender + - Returns + - From: *http.Response, error + - To: CustomDomainsDisableCustomHTTPSFuture, error +1. CustomDomainsClient.EnableCustomHTTPS + - Returns + - From: CustomDomain, error + - To: CustomDomainsEnableCustomHTTPSFuture, error +1. CustomDomainsClient.EnableCustomHTTPSSender + - Returns + - From: *http.Response, error + - To: CustomDomainsEnableCustomHTTPSFuture, error ## Additive Changes ### New Funcs -1. CheckNameAvailabilityOutput.MarshalJSON() ([]byte, error) -1. ErrorResponse.MarshalJSON() ([]byte, error) -1. ManagedRuleDefinition.MarshalJSON() ([]byte, error) -1. ManagedRuleGroupDefinition.MarshalJSON() ([]byte, error) -1. ManagedRuleSetDefinitionProperties.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. ProfileProperties.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. ResourceUsage.MarshalJSON() ([]byte, error) -1. SsoURI.MarshalJSON() ([]byte, error) -1. SupportedOptimizationTypesListResult.MarshalJSON() ([]byte, error) -1. ValidateCustomDomainOutput.MarshalJSON() ([]byte, error) -1. ValidateProbeOutput.MarshalJSON() ([]byte, error) +1. *CustomDomainsDisableCustomHTTPSFuture.UnmarshalJSON([]byte) error +1. *CustomDomainsEnableCustomHTTPSFuture.UnmarshalJSON([]byte) error + +### Struct Changes + +#### New Structs + +1. CustomDomainsDisableCustomHTTPSFuture +1. CustomDomainsEnableCustomHTTPSFuture diff --git a/services/cdn/mgmt/2020-04-15/cdn/_meta.json b/services/cdn/mgmt/2020-04-15/cdn/_meta.json index 60357761287e..11b161c9b936 100644 --- a/services/cdn/mgmt/2020-04-15/cdn/_meta.json +++ b/services/cdn/mgmt/2020-04-15/cdn/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "a7155ecd04ca66b19505f391978da03aae1cc94a", "readme": "/_/azure-rest-api-specs/specification/cdn/resource-manager/readme.md", "tag": "package-2020-04", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/cdn/mgmt/2020-04-15/cdn/cdnapi/interfaces.go b/services/cdn/mgmt/2020-04-15/cdn/cdnapi/interfaces.go index 885b4e7b7102..a0e439d4fe1b 100644 --- a/services/cdn/mgmt/2020-04-15/cdn/cdnapi/interfaces.go +++ b/services/cdn/mgmt/2020-04-15/cdn/cdnapi/interfaces.go @@ -86,8 +86,8 @@ var _ OriginGroupsClientAPI = (*cdn.OriginGroupsClient)(nil) type CustomDomainsClientAPI interface { Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties cdn.CustomDomainParameters) (result cdn.CustomDomainsCreateFuture, err error) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomainsDeleteFuture, err error) - DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomain, err error) - EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *cdn.BasicCustomDomainHTTPSParameters) (result cdn.CustomDomain, err error) + DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomainsDisableCustomHTTPSFuture, err error) + EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *cdn.BasicCustomDomainHTTPSParameters) (result cdn.CustomDomainsEnableCustomHTTPSFuture, err error) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomain, err error) ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.CustomDomainListResultPage, err error) ListByEndpointComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.CustomDomainListResultIterator, err error) diff --git a/services/cdn/mgmt/2020-04-15/cdn/customdomains.go b/services/cdn/mgmt/2020-04-15/cdn/customdomains.go index dab271834b1b..1dba03f23270 100644 --- a/services/cdn/mgmt/2020-04-15/cdn/customdomains.go +++ b/services/cdn/mgmt/2020-04-15/cdn/customdomains.go @@ -223,13 +223,13 @@ func (client CustomDomainsClient) DeleteResponder(resp *http.Response) (result C // profileName - name of the CDN profile which is unique within the resource group. // endpointName - name of the endpoint under the profile which is unique globally. // customDomainName - name of the custom domain within an endpoint. -func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomain, err error) { +func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomainsDisableCustomHTTPSFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.DisableCustomHTTPS") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -248,16 +248,9 @@ func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resour return } - resp, err := client.DisableCustomHTTPSSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", resp, "Failure sending request") - return - } - - result, err = client.DisableCustomHTTPSResponder(resp) + result, err = client.DisableCustomHTTPSSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", nil, "Failure sending request") return } @@ -289,8 +282,17 @@ func (client CustomDomainsClient) DisableCustomHTTPSPreparer(ctx context.Context // DisableCustomHTTPSSender sends the DisableCustomHTTPS request. The method will close the // http.Response Body if it receives an error. -func (client CustomDomainsClient) DisableCustomHTTPSSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client CustomDomainsClient) DisableCustomHTTPSSender(req *http.Request) (future CustomDomainsDisableCustomHTTPSFuture, err error) { + var resp *http.Response + 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 } // DisableCustomHTTPSResponder handles the response to the DisableCustomHTTPS request. The method always @@ -314,13 +316,13 @@ func (client CustomDomainsClient) DisableCustomHTTPSResponder(resp *http.Respons // customDomainHTTPSParameters - the configuration specifying how to enable HTTPS for the custom domain - using // CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed // certificate by default. -func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *BasicCustomDomainHTTPSParameters) (result CustomDomain, err error) { +func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *BasicCustomDomainHTTPSParameters) (result CustomDomainsEnableCustomHTTPSFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.EnableCustomHTTPS") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -339,16 +341,9 @@ func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourc return } - resp, err := client.EnableCustomHTTPSSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", resp, "Failure sending request") - return - } - - result, err = client.EnableCustomHTTPSResponder(resp) + result, err = client.EnableCustomHTTPSSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", nil, "Failure sending request") return } @@ -385,8 +380,17 @@ func (client CustomDomainsClient) EnableCustomHTTPSPreparer(ctx context.Context, // EnableCustomHTTPSSender sends the EnableCustomHTTPS request. The method will close the // http.Response Body if it receives an error. -func (client CustomDomainsClient) EnableCustomHTTPSSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client CustomDomainsClient) EnableCustomHTTPSSender(req *http.Request) (future CustomDomainsEnableCustomHTTPSFuture, err error) { + var resp *http.Response + 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 } // EnableCustomHTTPSResponder handles the response to the EnableCustomHTTPS request. The method always diff --git a/services/cdn/mgmt/2020-04-15/cdn/models.go b/services/cdn/mgmt/2020-04-15/cdn/models.go index 967556048788..4a7288d1cc94 100644 --- a/services/cdn/mgmt/2020-04-15/cdn/models.go +++ b/services/cdn/mgmt/2020-04-15/cdn/models.go @@ -590,6 +590,92 @@ func (future *CustomDomainsDeleteFuture) result(client CustomDomainsClient) (cd return } +// CustomDomainsDisableCustomHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CustomDomainsDisableCustomHTTPSFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CustomDomainsClient) (CustomDomain, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CustomDomainsDisableCustomHTTPSFuture) 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 CustomDomainsDisableCustomHTTPSFuture.Result. +func (future *CustomDomainsDisableCustomHTTPSFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDisableCustomHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsDisableCustomHTTPSFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { + cd, err = client.DisableCustomHTTPSResponder(cd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDisableCustomHTTPSFuture", "Result", cd.Response.Response, "Failure responding to request") + } + } + return +} + +// CustomDomainsEnableCustomHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CustomDomainsEnableCustomHTTPSFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CustomDomainsClient) (CustomDomain, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CustomDomainsEnableCustomHTTPSFuture) 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 CustomDomainsEnableCustomHTTPSFuture.Result. +func (future *CustomDomainsEnableCustomHTTPSFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsEnableCustomHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsEnableCustomHTTPSFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { + cd, err = client.EnableCustomHTTPSResponder(cd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsEnableCustomHTTPSFuture", "Result", cd.Response.Response, "Failure responding to request") + } + } + return +} + // CustomRule defines the common attributes for a custom rule that can be included in a waf policy type CustomRule struct { // Name - Defines the name of the custom rule diff --git a/services/cdn/mgmt/2020-09-01/cdn/CHANGELOG.md b/services/cdn/mgmt/2020-09-01/cdn/CHANGELOG.md index ed5374a28d0a..15165cdae889 100644 --- a/services/cdn/mgmt/2020-09-01/cdn/CHANGELOG.md +++ b/services/cdn/mgmt/2020-09-01/cdn/CHANGELOG.md @@ -1,24 +1,143 @@ -# Change History +# Unreleased + +## Breaking Changes + +### Signature Changes + +#### Funcs + +1. CustomDomainsClient.DisableCustomHTTPS + - Returns + - From: CustomDomain, error + - To: CustomDomainsDisableCustomHTTPSFuture, error +1. CustomDomainsClient.DisableCustomHTTPSSender + - Returns + - From: *http.Response, error + - To: CustomDomainsDisableCustomHTTPSFuture, error +1. CustomDomainsClient.EnableCustomHTTPS + - Returns + - From: CustomDomain, error + - To: CustomDomainsEnableCustomHTTPSFuture, error +1. CustomDomainsClient.EnableCustomHTTPSSender + - Returns + - From: *http.Response, error + - To: CustomDomainsEnableCustomHTTPSFuture, error +1. LogAnalyticsClient.GetLogAnalyticsMetrics + - Params + - From: context.Context, string, string, []string, date.Time, date.Time, string, []string, []string, []string, []string, []string + - To: context.Context, string, string, []LogMetric, date.Time, date.Time, LogMetricsGranularity, []string, []string, []LogMetricsGroupBy, []string, []string +1. LogAnalyticsClient.GetLogAnalyticsMetricsPreparer + - Params + - From: context.Context, string, string, []string, date.Time, date.Time, string, []string, []string, []string, []string, []string + - To: context.Context, string, string, []LogMetric, date.Time, date.Time, LogMetricsGranularity, []string, []string, []LogMetricsGroupBy, []string, []string +1. LogAnalyticsClient.GetLogAnalyticsRankings + - Params + - From: context.Context, string, string, []string, []string, int32, date.Time, date.Time, []string + - To: context.Context, string, string, []LogRanking, []LogRankingMetric, int32, date.Time, date.Time, []string +1. LogAnalyticsClient.GetLogAnalyticsRankingsPreparer + - Params + - From: context.Context, string, string, []string, []string, int32, date.Time, date.Time, []string + - To: context.Context, string, string, []LogRanking, []LogRankingMetric, int32, date.Time, date.Time, []string +1. LogAnalyticsClient.GetWafLogAnalyticsMetrics + - Params + - From: context.Context, string, string, []string, date.Time, date.Time, string, []string, []string, []string + - To: context.Context, string, string, []WafMetric, date.Time, date.Time, WafGranularity, []WafAction, []WafRankingGroupBy, []WafRuleType +1. LogAnalyticsClient.GetWafLogAnalyticsMetricsPreparer + - Params + - From: context.Context, string, string, []string, date.Time, date.Time, string, []string, []string, []string + - To: context.Context, string, string, []WafMetric, date.Time, date.Time, WafGranularity, []WafAction, []WafRankingGroupBy, []WafRuleType +1. LogAnalyticsClient.GetWafLogAnalyticsRankings + - Params + - From: context.Context, string, string, []string, date.Time, date.Time, int32, []string, []string, []string + - To: context.Context, string, string, []WafMetric, date.Time, date.Time, int32, []WafRankingType, []WafAction, []WafRuleType +1. LogAnalyticsClient.GetWafLogAnalyticsRankingsPreparer + - Params + - From: context.Context, string, string, []string, date.Time, date.Time, int32, []string, []string, []string + - To: context.Context, string, string, []WafMetric, date.Time, date.Time, int32, []WafRankingType, []WafAction, []WafRuleType +1. RuleSetsClient.Create + - Params + - From: context.Context, string, string, string, RuleSet + - To: context.Context, string, string, string +1. RuleSetsClient.CreatePreparer + - Params + - From: context.Context, string, string, string, RuleSet + - To: context.Context, string, string, string ## Additive Changes +### New Constants + +1. LogMetric.ClientRequestBandwidth +1. LogMetric.ClientRequestCount +1. LogMetric.ClientRequestTraffic +1. LogMetric.OriginRequestBandwidth +1. LogMetric.OriginRequestTraffic +1. LogMetric.TotalLatency +1. LogMetricsGranularity.LogMetricsGranularityP1D +1. LogMetricsGranularity.LogMetricsGranularityPT1H +1. LogMetricsGranularity.LogMetricsGranularityPT5M +1. LogMetricsGroupBy.LogMetricsGroupByCacheStatus +1. LogMetricsGroupBy.LogMetricsGroupByCountry +1. LogMetricsGroupBy.LogMetricsGroupByCustomDomain +1. LogMetricsGroupBy.LogMetricsGroupByHTTPStatusCode +1. LogMetricsGroupBy.LogMetricsGroupByProtocol +1. LogRanking.LogRankingBrowser +1. LogRanking.LogRankingCountryOrRegion +1. LogRanking.LogRankingReferrer +1. LogRanking.LogRankingURL +1. LogRanking.LogRankingUserAgent +1. LogRankingMetric.LogRankingMetricClientRequestCount +1. LogRankingMetric.LogRankingMetricClientRequestTraffic +1. LogRankingMetric.LogRankingMetricErrorCount +1. LogRankingMetric.LogRankingMetricHitCount +1. LogRankingMetric.LogRankingMetricMissCount +1. LogRankingMetric.LogRankingMetricUserErrorCount +1. WafAction.WafActionAllow +1. WafAction.WafActionBlock +1. WafAction.WafActionLog +1. WafAction.WafActionRedirect +1. WafGranularity.WafGranularityP1D +1. WafGranularity.WafGranularityPT1H +1. WafGranularity.WafGranularityPT5M +1. WafMetric.WafMetricClientRequestCount +1. WafRankingGroupBy.WafRankingGroupByCustomDomain +1. WafRankingGroupBy.WafRankingGroupByHTTPStatusCode +1. WafRankingType.WafRankingTypeAction +1. WafRankingType.WafRankingTypeClientIP +1. WafRankingType.WafRankingTypeCountry +1. WafRankingType.WafRankingTypeRuleGroup +1. WafRankingType.WafRankingTypeRuleID +1. WafRankingType.WafRankingTypeRuleType +1. WafRankingType.WafRankingTypeURL +1. WafRankingType.WafRankingTypeUserAgent +1. WafRuleType.Bot +1. WafRuleType.Custom +1. WafRuleType.Managed + ### New Funcs -1. AFDStateProperties.MarshalJSON() ([]byte, error) -1. CheckNameAvailabilityOutput.MarshalJSON() ([]byte, error) -1. DomainValidationProperties.MarshalJSON() ([]byte, error) -1. ErrorResponse.MarshalJSON() ([]byte, error) -1. ManagedRuleDefinition.MarshalJSON() ([]byte, error) -1. ManagedRuleGroupDefinition.MarshalJSON() ([]byte, error) -1. ManagedRuleSetDefinitionProperties.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. ProfileProperties.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. ResourceUsage.MarshalJSON() ([]byte, error) -1. RuleSetProperties.MarshalJSON() ([]byte, error) -1. SsoURI.MarshalJSON() ([]byte, error) -1. SupportedOptimizationTypesListResult.MarshalJSON() ([]byte, error) -1. ValidateCustomDomainOutput.MarshalJSON() ([]byte, error) -1. ValidateProbeOutput.MarshalJSON() ([]byte, error) -1. ValidationToken.MarshalJSON() ([]byte, error) +1. *CustomDomainsDisableCustomHTTPSFuture.UnmarshalJSON([]byte) error +1. *CustomDomainsEnableCustomHTTPSFuture.UnmarshalJSON([]byte) error +1. PossibleLogMetricValues() []LogMetric +1. PossibleLogMetricsGranularityValues() []LogMetricsGranularity +1. PossibleLogMetricsGroupByValues() []LogMetricsGroupBy +1. PossibleLogRankingMetricValues() []LogRankingMetric +1. PossibleLogRankingValues() []LogRanking +1. PossibleWafActionValues() []WafAction +1. PossibleWafGranularityValues() []WafGranularity +1. PossibleWafMetricValues() []WafMetric +1. PossibleWafRankingGroupByValues() []WafRankingGroupBy +1. PossibleWafRankingTypeValues() []WafRankingType +1. PossibleWafRuleTypeValues() []WafRuleType + +### Struct Changes + +#### New Structs + +1. CustomDomainsDisableCustomHTTPSFuture +1. CustomDomainsEnableCustomHTTPSFuture + +#### New Struct Fields + +1. ManagedRuleSetDefinition.SystemData +1. Resource.SystemData diff --git a/services/cdn/mgmt/2020-09-01/cdn/_meta.json b/services/cdn/mgmt/2020-09-01/cdn/_meta.json index 486df12a5a94..60f89dc3fe3b 100644 --- a/services/cdn/mgmt/2020-09-01/cdn/_meta.json +++ b/services/cdn/mgmt/2020-09-01/cdn/_meta.json @@ -1,5 +1,5 @@ { - "commit": "138759b8a5987252fd66658078907e1d93969c85", + "commit": "a7155ecd04ca66b19505f391978da03aae1cc94a", "readme": "/_/azure-rest-api-specs/specification/cdn/resource-manager/readme.md", "tag": "package-2020-09", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/cdn/mgmt/2020-09-01/cdn/cdnapi/interfaces.go b/services/cdn/mgmt/2020-09-01/cdn/cdnapi/interfaces.go index 6ce58975e0d5..2cafb7bf50d5 100644 --- a/services/cdn/mgmt/2020-09-01/cdn/cdnapi/interfaces.go +++ b/services/cdn/mgmt/2020-09-01/cdn/cdnapi/interfaces.go @@ -87,8 +87,8 @@ var _ OriginGroupsClientAPI = (*cdn.OriginGroupsClient)(nil) type CustomDomainsClientAPI interface { Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties cdn.CustomDomainParameters) (result cdn.CustomDomainsCreateFuture, err error) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomainsDeleteFuture, err error) - DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomain, err error) - EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *cdn.BasicCustomDomainHTTPSParameters) (result cdn.CustomDomain, err error) + DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomainsDisableCustomHTTPSFuture, err error) + EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *cdn.BasicCustomDomainHTTPSParameters) (result cdn.CustomDomainsEnableCustomHTTPSFuture, err error) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomain, err error) ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.CustomDomainListResultPage, err error) ListByEndpointComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.CustomDomainListResultIterator, err error) @@ -198,7 +198,7 @@ var _ RoutesClientAPI = (*cdn.RoutesClient)(nil) // RuleSetsClientAPI contains the set of methods on the RuleSetsClient type. type RuleSetsClientAPI interface { - Create(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleSet cdn.RuleSet) (result cdn.RuleSetsCreateFuture, err error) + Create(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string) (result cdn.RuleSetsCreateFuture, err error) Delete(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string) (result cdn.RuleSetsDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string) (result cdn.RuleSet, err error) ListByProfile(ctx context.Context, resourceGroupName string, profileName string) (result cdn.RuleSetListResultPage, err error) @@ -255,11 +255,11 @@ var _ ValidateClientAPI = (*cdn.ValidateClient)(nil) // LogAnalyticsClientAPI contains the set of methods on the LogAnalyticsClient type. type LogAnalyticsClientAPI interface { GetLogAnalyticsLocations(ctx context.Context, resourceGroupName string, profileName string) (result cdn.ContinentsResponse, err error) - GetLogAnalyticsMetrics(ctx context.Context, resourceGroupName string, profileName string, metrics []string, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity string, groupBy []string, continents []string, countryOrRegions []string, customDomains []string, protocols []string) (result cdn.MetricsResponse, err error) - GetLogAnalyticsRankings(ctx context.Context, resourceGroupName string, profileName string, rankings []string, metrics []string, maxRanking int32, dateTimeBegin date.Time, dateTimeEnd date.Time, customDomains []string) (result cdn.RankingsResponse, err error) + GetLogAnalyticsMetrics(ctx context.Context, resourceGroupName string, profileName string, metrics []cdn.LogMetric, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity cdn.LogMetricsGranularity, customDomains []string, protocols []string, groupBy []cdn.LogMetricsGroupBy, continents []string, countryOrRegions []string) (result cdn.MetricsResponse, err error) + GetLogAnalyticsRankings(ctx context.Context, resourceGroupName string, profileName string, rankings []cdn.LogRanking, metrics []cdn.LogRankingMetric, maxRanking int32, dateTimeBegin date.Time, dateTimeEnd date.Time, customDomains []string) (result cdn.RankingsResponse, err error) GetLogAnalyticsResources(ctx context.Context, resourceGroupName string, profileName string) (result cdn.ResourcesResponse, err error) - GetWafLogAnalyticsMetrics(ctx context.Context, resourceGroupName string, profileName string, metrics []string, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity string, actions []string, groupBy []string, ruleTypes []string) (result cdn.WafMetricsResponse, err error) - GetWafLogAnalyticsRankings(ctx context.Context, resourceGroupName string, profileName string, metrics []string, dateTimeBegin date.Time, dateTimeEnd date.Time, maxRanking int32, rankings []string, actions []string, ruleTypes []string) (result cdn.WafRankingsResponse, err error) + GetWafLogAnalyticsMetrics(ctx context.Context, resourceGroupName string, profileName string, metrics []cdn.WafMetric, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity cdn.WafGranularity, actions []cdn.WafAction, groupBy []cdn.WafRankingGroupBy, ruleTypes []cdn.WafRuleType) (result cdn.WafMetricsResponse, err error) + GetWafLogAnalyticsRankings(ctx context.Context, resourceGroupName string, profileName string, metrics []cdn.WafMetric, dateTimeBegin date.Time, dateTimeEnd date.Time, maxRanking int32, rankings []cdn.WafRankingType, actions []cdn.WafAction, ruleTypes []cdn.WafRuleType) (result cdn.WafRankingsResponse, err error) } var _ LogAnalyticsClientAPI = (*cdn.LogAnalyticsClient)(nil) diff --git a/services/cdn/mgmt/2020-09-01/cdn/customdomains.go b/services/cdn/mgmt/2020-09-01/cdn/customdomains.go index e7baf4d78a7a..546a79e83e60 100644 --- a/services/cdn/mgmt/2020-09-01/cdn/customdomains.go +++ b/services/cdn/mgmt/2020-09-01/cdn/customdomains.go @@ -223,13 +223,13 @@ func (client CustomDomainsClient) DeleteResponder(resp *http.Response) (result C // profileName - name of the CDN profile which is unique within the resource group. // endpointName - name of the endpoint under the profile which is unique globally. // customDomainName - name of the custom domain within an endpoint. -func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomain, err error) { +func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomainsDisableCustomHTTPSFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.DisableCustomHTTPS") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -248,16 +248,9 @@ func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resour return } - resp, err := client.DisableCustomHTTPSSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", resp, "Failure sending request") - return - } - - result, err = client.DisableCustomHTTPSResponder(resp) + result, err = client.DisableCustomHTTPSSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", nil, "Failure sending request") return } @@ -289,8 +282,17 @@ func (client CustomDomainsClient) DisableCustomHTTPSPreparer(ctx context.Context // DisableCustomHTTPSSender sends the DisableCustomHTTPS request. The method will close the // http.Response Body if it receives an error. -func (client CustomDomainsClient) DisableCustomHTTPSSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client CustomDomainsClient) DisableCustomHTTPSSender(req *http.Request) (future CustomDomainsDisableCustomHTTPSFuture, err error) { + var resp *http.Response + 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 } // DisableCustomHTTPSResponder handles the response to the DisableCustomHTTPS request. The method always @@ -314,13 +316,13 @@ func (client CustomDomainsClient) DisableCustomHTTPSResponder(resp *http.Respons // customDomainHTTPSParameters - the configuration specifying how to enable HTTPS for the custom domain - using // CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed // certificate by default. -func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *BasicCustomDomainHTTPSParameters) (result CustomDomain, err error) { +func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *BasicCustomDomainHTTPSParameters) (result CustomDomainsEnableCustomHTTPSFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.EnableCustomHTTPS") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -339,16 +341,9 @@ func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourc return } - resp, err := client.EnableCustomHTTPSSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", resp, "Failure sending request") - return - } - - result, err = client.EnableCustomHTTPSResponder(resp) + result, err = client.EnableCustomHTTPSSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", nil, "Failure sending request") return } @@ -385,8 +380,17 @@ func (client CustomDomainsClient) EnableCustomHTTPSPreparer(ctx context.Context, // EnableCustomHTTPSSender sends the EnableCustomHTTPS request. The method will close the // http.Response Body if it receives an error. -func (client CustomDomainsClient) EnableCustomHTTPSSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client CustomDomainsClient) EnableCustomHTTPSSender(req *http.Request) (future CustomDomainsEnableCustomHTTPSFuture, err error) { + var resp *http.Response + 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 } // EnableCustomHTTPSResponder handles the response to the EnableCustomHTTPS request. The method always diff --git a/services/cdn/mgmt/2020-09-01/cdn/enums.go b/services/cdn/mgmt/2020-09-01/cdn/enums.go index ef64d3abb8fe..f24f78a3bc08 100644 --- a/services/cdn/mgmt/2020-09-01/cdn/enums.go +++ b/services/cdn/mgmt/2020-09-01/cdn/enums.go @@ -531,6 +531,111 @@ func PossibleLinkToDefaultDomainValues() []LinkToDefaultDomain { return []LinkToDefaultDomain{LinkToDefaultDomainDisabled, LinkToDefaultDomainEnabled} } +// LogMetric enumerates the values for log metric. +type LogMetric string + +const ( + // ClientRequestBandwidth ... + ClientRequestBandwidth LogMetric = "clientRequestBandwidth" + // ClientRequestCount ... + ClientRequestCount LogMetric = "clientRequestCount" + // ClientRequestTraffic ... + ClientRequestTraffic LogMetric = "clientRequestTraffic" + // OriginRequestBandwidth ... + OriginRequestBandwidth LogMetric = "originRequestBandwidth" + // OriginRequestTraffic ... + OriginRequestTraffic LogMetric = "originRequestTraffic" + // TotalLatency ... + TotalLatency LogMetric = "totalLatency" +) + +// PossibleLogMetricValues returns an array of possible values for the LogMetric const type. +func PossibleLogMetricValues() []LogMetric { + return []LogMetric{ClientRequestBandwidth, ClientRequestCount, ClientRequestTraffic, OriginRequestBandwidth, OriginRequestTraffic, TotalLatency} +} + +// LogMetricsGranularity enumerates the values for log metrics granularity. +type LogMetricsGranularity string + +const ( + // LogMetricsGranularityP1D ... + LogMetricsGranularityP1D LogMetricsGranularity = "P1D" + // LogMetricsGranularityPT1H ... + LogMetricsGranularityPT1H LogMetricsGranularity = "PT1H" + // LogMetricsGranularityPT5M ... + LogMetricsGranularityPT5M LogMetricsGranularity = "PT5M" +) + +// PossibleLogMetricsGranularityValues returns an array of possible values for the LogMetricsGranularity const type. +func PossibleLogMetricsGranularityValues() []LogMetricsGranularity { + return []LogMetricsGranularity{LogMetricsGranularityP1D, LogMetricsGranularityPT1H, LogMetricsGranularityPT5M} +} + +// LogMetricsGroupBy enumerates the values for log metrics group by. +type LogMetricsGroupBy string + +const ( + // LogMetricsGroupByCacheStatus ... + LogMetricsGroupByCacheStatus LogMetricsGroupBy = "cacheStatus" + // LogMetricsGroupByCountry ... + LogMetricsGroupByCountry LogMetricsGroupBy = "country" + // LogMetricsGroupByCustomDomain ... + LogMetricsGroupByCustomDomain LogMetricsGroupBy = "customDomain" + // LogMetricsGroupByHTTPStatusCode ... + LogMetricsGroupByHTTPStatusCode LogMetricsGroupBy = "httpStatusCode" + // LogMetricsGroupByProtocol ... + LogMetricsGroupByProtocol LogMetricsGroupBy = "protocol" +) + +// PossibleLogMetricsGroupByValues returns an array of possible values for the LogMetricsGroupBy const type. +func PossibleLogMetricsGroupByValues() []LogMetricsGroupBy { + return []LogMetricsGroupBy{LogMetricsGroupByCacheStatus, LogMetricsGroupByCountry, LogMetricsGroupByCustomDomain, LogMetricsGroupByHTTPStatusCode, LogMetricsGroupByProtocol} +} + +// LogRanking enumerates the values for log ranking. +type LogRanking string + +const ( + // LogRankingBrowser ... + LogRankingBrowser LogRanking = "browser" + // LogRankingCountryOrRegion ... + LogRankingCountryOrRegion LogRanking = "countryOrRegion" + // LogRankingReferrer ... + LogRankingReferrer LogRanking = "referrer" + // LogRankingURL ... + LogRankingURL LogRanking = "url" + // LogRankingUserAgent ... + LogRankingUserAgent LogRanking = "userAgent" +) + +// PossibleLogRankingValues returns an array of possible values for the LogRanking const type. +func PossibleLogRankingValues() []LogRanking { + return []LogRanking{LogRankingBrowser, LogRankingCountryOrRegion, LogRankingReferrer, LogRankingURL, LogRankingUserAgent} +} + +// LogRankingMetric enumerates the values for log ranking metric. +type LogRankingMetric string + +const ( + // LogRankingMetricClientRequestCount ... + LogRankingMetricClientRequestCount LogRankingMetric = "clientRequestCount" + // LogRankingMetricClientRequestTraffic ... + LogRankingMetricClientRequestTraffic LogRankingMetric = "clientRequestTraffic" + // LogRankingMetricErrorCount ... + LogRankingMetricErrorCount LogRankingMetric = "errorCount" + // LogRankingMetricHitCount ... + LogRankingMetricHitCount LogRankingMetric = "hitCount" + // LogRankingMetricMissCount ... + LogRankingMetricMissCount LogRankingMetric = "missCount" + // LogRankingMetricUserErrorCount ... + LogRankingMetricUserErrorCount LogRankingMetric = "userErrorCount" +) + +// PossibleLogRankingMetricValues returns an array of possible values for the LogRankingMetric const type. +func PossibleLogRankingMetricValues() []LogRankingMetric { + return []LogRankingMetric{LogRankingMetricClientRequestCount, LogRankingMetricClientRequestTraffic, LogRankingMetricErrorCount, LogRankingMetricHitCount, LogRankingMetricMissCount, LogRankingMetricUserErrorCount} +} + // ManagedRuleEnabledState enumerates the values for managed rule enabled state. type ManagedRuleEnabledState string @@ -1477,3 +1582,111 @@ const ( func PossibleValidateSecretTypeValues() []ValidateSecretType { return []ValidateSecretType{ValidateSecretTypeCustomerCertificate, ValidateSecretTypeManagedCertificate, ValidateSecretTypeURLSigningKey} } + +// WafAction enumerates the values for waf action. +type WafAction string + +const ( + // WafActionAllow ... + WafActionAllow WafAction = "allow" + // WafActionBlock ... + WafActionBlock WafAction = "block" + // WafActionLog ... + WafActionLog WafAction = "log" + // WafActionRedirect ... + WafActionRedirect WafAction = "redirect" +) + +// PossibleWafActionValues returns an array of possible values for the WafAction const type. +func PossibleWafActionValues() []WafAction { + return []WafAction{WafActionAllow, WafActionBlock, WafActionLog, WafActionRedirect} +} + +// WafGranularity enumerates the values for waf granularity. +type WafGranularity string + +const ( + // WafGranularityP1D ... + WafGranularityP1D WafGranularity = "P1D" + // WafGranularityPT1H ... + WafGranularityPT1H WafGranularity = "PT1H" + // WafGranularityPT5M ... + WafGranularityPT5M WafGranularity = "PT5M" +) + +// PossibleWafGranularityValues returns an array of possible values for the WafGranularity const type. +func PossibleWafGranularityValues() []WafGranularity { + return []WafGranularity{WafGranularityP1D, WafGranularityPT1H, WafGranularityPT5M} +} + +// WafMetric enumerates the values for waf metric. +type WafMetric string + +const ( + // WafMetricClientRequestCount ... + WafMetricClientRequestCount WafMetric = "clientRequestCount" +) + +// PossibleWafMetricValues returns an array of possible values for the WafMetric const type. +func PossibleWafMetricValues() []WafMetric { + return []WafMetric{WafMetricClientRequestCount} +} + +// WafRankingGroupBy enumerates the values for waf ranking group by. +type WafRankingGroupBy string + +const ( + // WafRankingGroupByCustomDomain ... + WafRankingGroupByCustomDomain WafRankingGroupBy = "customDomain" + // WafRankingGroupByHTTPStatusCode ... + WafRankingGroupByHTTPStatusCode WafRankingGroupBy = "httpStatusCode" +) + +// PossibleWafRankingGroupByValues returns an array of possible values for the WafRankingGroupBy const type. +func PossibleWafRankingGroupByValues() []WafRankingGroupBy { + return []WafRankingGroupBy{WafRankingGroupByCustomDomain, WafRankingGroupByHTTPStatusCode} +} + +// WafRankingType enumerates the values for waf ranking type. +type WafRankingType string + +const ( + // WafRankingTypeAction ... + WafRankingTypeAction WafRankingType = "action" + // WafRankingTypeClientIP ... + WafRankingTypeClientIP WafRankingType = "clientIp" + // WafRankingTypeCountry ... + WafRankingTypeCountry WafRankingType = "country" + // WafRankingTypeRuleGroup ... + WafRankingTypeRuleGroup WafRankingType = "ruleGroup" + // WafRankingTypeRuleID ... + WafRankingTypeRuleID WafRankingType = "ruleId" + // WafRankingTypeRuleType ... + WafRankingTypeRuleType WafRankingType = "ruleType" + // WafRankingTypeURL ... + WafRankingTypeURL WafRankingType = "url" + // WafRankingTypeUserAgent ... + WafRankingTypeUserAgent WafRankingType = "userAgent" +) + +// PossibleWafRankingTypeValues returns an array of possible values for the WafRankingType const type. +func PossibleWafRankingTypeValues() []WafRankingType { + return []WafRankingType{WafRankingTypeAction, WafRankingTypeClientIP, WafRankingTypeCountry, WafRankingTypeRuleGroup, WafRankingTypeRuleID, WafRankingTypeRuleType, WafRankingTypeURL, WafRankingTypeUserAgent} +} + +// WafRuleType enumerates the values for waf rule type. +type WafRuleType string + +const ( + // Bot ... + Bot WafRuleType = "bot" + // Custom ... + Custom WafRuleType = "custom" + // Managed ... + Managed WafRuleType = "managed" +) + +// PossibleWafRuleTypeValues returns an array of possible values for the WafRuleType const type. +func PossibleWafRuleTypeValues() []WafRuleType { + return []WafRuleType{Bot, Custom, Managed} +} diff --git a/services/cdn/mgmt/2020-09-01/cdn/loganalytics.go b/services/cdn/mgmt/2020-09-01/cdn/loganalytics.go index aa900b955ae0..bae499fb0c8e 100644 --- a/services/cdn/mgmt/2020-09-01/cdn/loganalytics.go +++ b/services/cdn/mgmt/2020-09-01/cdn/loganalytics.go @@ -121,7 +121,7 @@ func (client LogAnalyticsClient) GetLogAnalyticsLocationsResponder(resp *http.Re // resourceGroupName - name of the Resource group within the Azure subscription. // profileName - name of the CDN profile which is unique within the resource group. // granularity - -func (client LogAnalyticsClient) GetLogAnalyticsMetrics(ctx context.Context, resourceGroupName string, profileName string, metrics []string, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity string, groupBy []string, continents []string, countryOrRegions []string, customDomains []string, protocols []string) (result MetricsResponse, err error) { +func (client LogAnalyticsClient) GetLogAnalyticsMetrics(ctx context.Context, resourceGroupName string, profileName string, metrics []LogMetric, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity LogMetricsGranularity, customDomains []string, protocols []string, groupBy []LogMetricsGroupBy, continents []string, countryOrRegions []string) (result MetricsResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.GetLogAnalyticsMetrics") defer func() { @@ -138,11 +138,15 @@ func (client LogAnalyticsClient) GetLogAnalyticsMetrics(ctx context.Context, res {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: metrics, - Constraints: []validation.Constraint{{Target: "metrics", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "metrics", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: customDomains, + Constraints: []validation.Constraint{{Target: "customDomains", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: protocols, + Constraints: []validation.Constraint{{Target: "protocols", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("cdn.LogAnalyticsClient", "GetLogAnalyticsMetrics", err.Error()) } - req, err := client.GetLogAnalyticsMetricsPreparer(ctx, resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, granularity, groupBy, continents, countryOrRegions, customDomains, protocols) + req, err := client.GetLogAnalyticsMetricsPreparer(ctx, resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, granularity, customDomains, protocols, groupBy, continents, countryOrRegions) if err != nil { err = autorest.NewErrorWithError(err, "cdn.LogAnalyticsClient", "GetLogAnalyticsMetrics", nil, "Failure preparing request") return @@ -165,7 +169,7 @@ func (client LogAnalyticsClient) GetLogAnalyticsMetrics(ctx context.Context, res } // GetLogAnalyticsMetricsPreparer prepares the GetLogAnalyticsMetrics request. -func (client LogAnalyticsClient) GetLogAnalyticsMetricsPreparer(ctx context.Context, resourceGroupName string, profileName string, metrics []string, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity string, groupBy []string, continents []string, countryOrRegions []string, customDomains []string, protocols []string) (*http.Request, error) { +func (client LogAnalyticsClient) GetLogAnalyticsMetricsPreparer(ctx context.Context, resourceGroupName string, profileName string, metrics []LogMetric, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity LogMetricsGranularity, customDomains []string, protocols []string, groupBy []LogMetricsGroupBy, continents []string, countryOrRegions []string) (*http.Request, error) { pathParameters := map[string]interface{}{ "profileName": autorest.Encode("path", profileName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -175,25 +179,21 @@ func (client LogAnalyticsClient) GetLogAnalyticsMetricsPreparer(ctx context.Cont const APIVersion = "2020-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, + "customDomains": customDomains, "dateTimeBegin": autorest.Encode("query", dateTimeBegin), "dateTimeEnd": autorest.Encode("query", dateTimeEnd), "granularity": autorest.Encode("query", granularity), - "metrics": autorest.Encode("query", metrics, ","), + "metrics": metrics, + "protocols": protocols, } if groupBy != nil && len(groupBy) > 0 { - queryParameters["groupBy"] = autorest.Encode("query", groupBy, ",") + queryParameters["groupBy"] = groupBy } if continents != nil && len(continents) > 0 { - queryParameters["continents"] = autorest.Encode("query", continents, ",") + queryParameters["continents"] = continents } if countryOrRegions != nil && len(countryOrRegions) > 0 { - queryParameters["countryOrRegions"] = autorest.Encode("query", countryOrRegions, ",") - } - if customDomains != nil && len(customDomains) > 0 { - queryParameters["customDomains"] = autorest.Encode("query", customDomains, ",") - } - if protocols != nil && len(protocols) > 0 { - queryParameters["protocols"] = autorest.Encode("query", protocols, ",") + queryParameters["countryOrRegions"] = countryOrRegions } preparer := autorest.CreatePreparer( @@ -226,7 +226,7 @@ func (client LogAnalyticsClient) GetLogAnalyticsMetricsResponder(resp *http.Resp // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. // profileName - name of the CDN profile which is unique within the resource group. -func (client LogAnalyticsClient) GetLogAnalyticsRankings(ctx context.Context, resourceGroupName string, profileName string, rankings []string, metrics []string, maxRanking int32, dateTimeBegin date.Time, dateTimeEnd date.Time, customDomains []string) (result RankingsResponse, err error) { +func (client LogAnalyticsClient) GetLogAnalyticsRankings(ctx context.Context, resourceGroupName string, profileName string, rankings []LogRanking, metrics []LogRankingMetric, maxRanking int32, dateTimeBegin date.Time, dateTimeEnd date.Time, customDomains []string) (result RankingsResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.GetLogAnalyticsRankings") defer func() { @@ -272,7 +272,7 @@ func (client LogAnalyticsClient) GetLogAnalyticsRankings(ctx context.Context, re } // GetLogAnalyticsRankingsPreparer prepares the GetLogAnalyticsRankings request. -func (client LogAnalyticsClient) GetLogAnalyticsRankingsPreparer(ctx context.Context, resourceGroupName string, profileName string, rankings []string, metrics []string, maxRanking int32, dateTimeBegin date.Time, dateTimeEnd date.Time, customDomains []string) (*http.Request, error) { +func (client LogAnalyticsClient) GetLogAnalyticsRankingsPreparer(ctx context.Context, resourceGroupName string, profileName string, rankings []LogRanking, metrics []LogRankingMetric, maxRanking int32, dateTimeBegin date.Time, dateTimeEnd date.Time, customDomains []string) (*http.Request, error) { pathParameters := map[string]interface{}{ "profileName": autorest.Encode("path", profileName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -285,11 +285,11 @@ func (client LogAnalyticsClient) GetLogAnalyticsRankingsPreparer(ctx context.Con "dateTimeBegin": autorest.Encode("query", dateTimeBegin), "dateTimeEnd": autorest.Encode("query", dateTimeEnd), "maxRanking": autorest.Encode("query", maxRanking), - "metrics": autorest.Encode("query", metrics, ","), - "rankings": autorest.Encode("query", rankings, ","), + "metrics": metrics, + "rankings": rankings, } if customDomains != nil && len(customDomains) > 0 { - queryParameters["customDomains"] = autorest.Encode("query", customDomains, ",") + queryParameters["customDomains"] = customDomains } preparer := autorest.CreatePreparer( @@ -407,7 +407,7 @@ func (client LogAnalyticsClient) GetLogAnalyticsResourcesResponder(resp *http.Re // resourceGroupName - name of the Resource group within the Azure subscription. // profileName - name of the CDN profile which is unique within the resource group. // granularity - -func (client LogAnalyticsClient) GetWafLogAnalyticsMetrics(ctx context.Context, resourceGroupName string, profileName string, metrics []string, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity string, actions []string, groupBy []string, ruleTypes []string) (result WafMetricsResponse, err error) { +func (client LogAnalyticsClient) GetWafLogAnalyticsMetrics(ctx context.Context, resourceGroupName string, profileName string, metrics []WafMetric, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity WafGranularity, actions []WafAction, groupBy []WafRankingGroupBy, ruleTypes []WafRuleType) (result WafMetricsResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.GetWafLogAnalyticsMetrics") defer func() { @@ -451,7 +451,7 @@ func (client LogAnalyticsClient) GetWafLogAnalyticsMetrics(ctx context.Context, } // GetWafLogAnalyticsMetricsPreparer prepares the GetWafLogAnalyticsMetrics request. -func (client LogAnalyticsClient) GetWafLogAnalyticsMetricsPreparer(ctx context.Context, resourceGroupName string, profileName string, metrics []string, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity string, actions []string, groupBy []string, ruleTypes []string) (*http.Request, error) { +func (client LogAnalyticsClient) GetWafLogAnalyticsMetricsPreparer(ctx context.Context, resourceGroupName string, profileName string, metrics []WafMetric, dateTimeBegin date.Time, dateTimeEnd date.Time, granularity WafGranularity, actions []WafAction, groupBy []WafRankingGroupBy, ruleTypes []WafRuleType) (*http.Request, error) { pathParameters := map[string]interface{}{ "profileName": autorest.Encode("path", profileName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -464,16 +464,16 @@ func (client LogAnalyticsClient) GetWafLogAnalyticsMetricsPreparer(ctx context.C "dateTimeBegin": autorest.Encode("query", dateTimeBegin), "dateTimeEnd": autorest.Encode("query", dateTimeEnd), "granularity": autorest.Encode("query", granularity), - "metrics": autorest.Encode("query", metrics, ","), + "metrics": metrics, } if actions != nil && len(actions) > 0 { - queryParameters["actions"] = autorest.Encode("query", actions, ",") + queryParameters["actions"] = actions } if groupBy != nil && len(groupBy) > 0 { - queryParameters["groupBy"] = autorest.Encode("query", groupBy, ",") + queryParameters["groupBy"] = groupBy } if ruleTypes != nil && len(ruleTypes) > 0 { - queryParameters["ruleTypes"] = autorest.Encode("query", ruleTypes, ",") + queryParameters["ruleTypes"] = ruleTypes } preparer := autorest.CreatePreparer( @@ -506,7 +506,7 @@ func (client LogAnalyticsClient) GetWafLogAnalyticsMetricsResponder(resp *http.R // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. // profileName - name of the CDN profile which is unique within the resource group. -func (client LogAnalyticsClient) GetWafLogAnalyticsRankings(ctx context.Context, resourceGroupName string, profileName string, metrics []string, dateTimeBegin date.Time, dateTimeEnd date.Time, maxRanking int32, rankings []string, actions []string, ruleTypes []string) (result WafRankingsResponse, err error) { +func (client LogAnalyticsClient) GetWafLogAnalyticsRankings(ctx context.Context, resourceGroupName string, profileName string, metrics []WafMetric, dateTimeBegin date.Time, dateTimeEnd date.Time, maxRanking int32, rankings []WafRankingType, actions []WafAction, ruleTypes []WafRuleType) (result WafRankingsResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.GetWafLogAnalyticsRankings") defer func() { @@ -552,7 +552,7 @@ func (client LogAnalyticsClient) GetWafLogAnalyticsRankings(ctx context.Context, } // GetWafLogAnalyticsRankingsPreparer prepares the GetWafLogAnalyticsRankings request. -func (client LogAnalyticsClient) GetWafLogAnalyticsRankingsPreparer(ctx context.Context, resourceGroupName string, profileName string, metrics []string, dateTimeBegin date.Time, dateTimeEnd date.Time, maxRanking int32, rankings []string, actions []string, ruleTypes []string) (*http.Request, error) { +func (client LogAnalyticsClient) GetWafLogAnalyticsRankingsPreparer(ctx context.Context, resourceGroupName string, profileName string, metrics []WafMetric, dateTimeBegin date.Time, dateTimeEnd date.Time, maxRanking int32, rankings []WafRankingType, actions []WafAction, ruleTypes []WafRuleType) (*http.Request, error) { pathParameters := map[string]interface{}{ "profileName": autorest.Encode("path", profileName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -565,14 +565,14 @@ func (client LogAnalyticsClient) GetWafLogAnalyticsRankingsPreparer(ctx context. "dateTimeBegin": autorest.Encode("query", dateTimeBegin), "dateTimeEnd": autorest.Encode("query", dateTimeEnd), "maxRanking": autorest.Encode("query", maxRanking), - "metrics": autorest.Encode("query", metrics, ","), - "rankings": autorest.Encode("query", rankings, ","), + "metrics": metrics, + "rankings": rankings, } if actions != nil && len(actions) > 0 { - queryParameters["actions"] = autorest.Encode("query", actions, ",") + queryParameters["actions"] = actions } if ruleTypes != nil && len(ruleTypes) > 0 { - queryParameters["ruleTypes"] = autorest.Encode("query", ruleTypes, ",") + queryParameters["ruleTypes"] = ruleTypes } preparer := autorest.CreatePreparer( diff --git a/services/cdn/mgmt/2020-09-01/cdn/models.go b/services/cdn/mgmt/2020-09-01/cdn/models.go index 21d1385408eb..18071b8ed670 100644 --- a/services/cdn/mgmt/2020-09-01/cdn/models.go +++ b/services/cdn/mgmt/2020-09-01/cdn/models.go @@ -191,14 +191,14 @@ func (future *AFDCustomDomainsUpdateFuture) result(client AFDCustomDomainsClient type AFDDomain struct { autorest.Response `json:"-"` *AFDDomainProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for AFDDomain. @@ -228,15 +228,6 @@ func (ad *AFDDomain) UnmarshalJSON(body []byte) error { } ad.AFDDomainProperties = &aFDDomainProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - ad.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -264,6 +255,15 @@ func (ad *AFDDomain) UnmarshalJSON(body []byte) error { } ad.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + ad.SystemData = &systemData + } } } @@ -539,14 +539,14 @@ type AFDEndpoint struct { Location *string `json:"location,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for AFDEndpoint. @@ -600,15 +600,6 @@ func (ae *AFDEndpoint) UnmarshalJSON(body []byte) error { } ae.Tags = tags } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - ae.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -636,6 +627,15 @@ func (ae *AFDEndpoint) UnmarshalJSON(body []byte) error { } ae.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + ae.SystemData = &systemData + } } } @@ -1070,14 +1070,14 @@ type AfdErrorResponse struct { type AFDOrigin struct { autorest.Response `json:"-"` *AFDOriginProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for AFDOrigin. @@ -1107,15 +1107,6 @@ func (ao *AFDOrigin) UnmarshalJSON(body []byte) error { } ao.AFDOriginProperties = &aFDOriginProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - ao.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -1143,6 +1134,15 @@ func (ao *AFDOrigin) UnmarshalJSON(body []byte) error { } ao.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + ao.SystemData = &systemData + } } } @@ -1154,14 +1154,14 @@ func (ao *AFDOrigin) UnmarshalJSON(body []byte) error { type AFDOriginGroup struct { autorest.Response `json:"-"` *AFDOriginGroupProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for AFDOriginGroup. @@ -1191,15 +1191,6 @@ func (aog *AFDOriginGroup) UnmarshalJSON(body []byte) error { } aog.AFDOriginGroupProperties = &aFDOriginGroupProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - aog.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -1227,6 +1218,15 @@ func (aog *AFDOriginGroup) UnmarshalJSON(body []byte) error { } aog.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + aog.SystemData = &systemData + } } } @@ -2167,14 +2167,14 @@ type CookiesMatchConditionParameters struct { type CustomDomain struct { autorest.Response `json:"-"` *CustomDomainProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for CustomDomain. @@ -2204,15 +2204,6 @@ func (cd *CustomDomain) UnmarshalJSON(body []byte) error { } cd.CustomDomainProperties = &customDomainProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - cd.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -2240,6 +2231,15 @@ func (cd *CustomDomain) UnmarshalJSON(body []byte) error { } cd.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + cd.SystemData = &systemData + } } } @@ -2668,6 +2668,92 @@ func (future *CustomDomainsDeleteFuture) result(client CustomDomainsClient) (cd return } +// CustomDomainsDisableCustomHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CustomDomainsDisableCustomHTTPSFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CustomDomainsClient) (CustomDomain, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CustomDomainsDisableCustomHTTPSFuture) 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 CustomDomainsDisableCustomHTTPSFuture.Result. +func (future *CustomDomainsDisableCustomHTTPSFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDisableCustomHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsDisableCustomHTTPSFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { + cd, err = client.DisableCustomHTTPSResponder(cd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDisableCustomHTTPSFuture", "Result", cd.Response.Response, "Failure responding to request") + } + } + return +} + +// CustomDomainsEnableCustomHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CustomDomainsEnableCustomHTTPSFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CustomDomainsClient) (CustomDomain, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CustomDomainsEnableCustomHTTPSFuture) 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 CustomDomainsEnableCustomHTTPSFuture.Result. +func (future *CustomDomainsEnableCustomHTTPSFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsEnableCustomHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsEnableCustomHTTPSFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { + cd, err = client.EnableCustomHTTPSResponder(cd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsEnableCustomHTTPSFuture", "Result", cd.Response.Response, "Failure responding to request") + } + } + return +} + // CustomerCertificate customer Certificate used for https type CustomerCertificate struct { // Version - Certificate version. @@ -5041,14 +5127,14 @@ func (dvp DomainValidationProperties) MarshalJSON() ([]byte, error) { // EdgeNode edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. type EdgeNode struct { *EdgeNodeProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for EdgeNode. @@ -5078,15 +5164,6 @@ func (en *EdgeNode) UnmarshalJSON(body []byte) error { } en.EdgeNodeProperties = &edgeNodeProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - en.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -5114,6 +5191,15 @@ func (en *EdgeNode) UnmarshalJSON(body []byte) error { } en.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + en.SystemData = &systemData + } } } @@ -5305,14 +5391,14 @@ type Endpoint struct { Location *string `json:"location,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for Endpoint. @@ -5366,15 +5452,6 @@ func (e *Endpoint) UnmarshalJSON(body []byte) error { } e.Tags = tags } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - e.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -5402,6 +5479,15 @@ func (e *Endpoint) UnmarshalJSON(body []byte) error { } e.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + e.SystemData = &systemData + } } } @@ -6378,6 +6464,8 @@ type ManagedRuleSetDefinition struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for ManagedRuleSetDefinition. @@ -6446,6 +6534,15 @@ func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { } mrsd.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + mrsd.SystemData = &systemData + } } } @@ -6900,14 +6997,14 @@ func NewOperationsListResultPage(cur OperationsListResult, getNextPage func(cont type Origin struct { autorest.Response `json:"-"` *OriginProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for Origin. @@ -6937,15 +7034,6 @@ func (o *Origin) UnmarshalJSON(body []byte) error { } o.OriginProperties = &originProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - o.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -6973,6 +7061,15 @@ func (o *Origin) UnmarshalJSON(body []byte) error { } o.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + o.SystemData = &systemData + } } } @@ -6984,14 +7081,14 @@ func (o *Origin) UnmarshalJSON(body []byte) error { type OriginGroup struct { autorest.Response `json:"-"` *OriginGroupProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for OriginGroup. @@ -7021,15 +7118,6 @@ func (og *OriginGroup) UnmarshalJSON(body []byte) error { } og.OriginGroupProperties = &originGroupProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - og.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -7057,6 +7145,15 @@ func (og *OriginGroup) UnmarshalJSON(body []byte) error { } og.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + og.SystemData = &systemData + } } } @@ -8070,14 +8167,14 @@ type Profile struct { Location *string `json:"location,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for Profile. @@ -8143,15 +8240,6 @@ func (p *Profile) UnmarshalJSON(body []byte) error { } p.Tags = tags } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - p.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -8179,6 +8267,15 @@ func (p *Profile) UnmarshalJSON(body []byte) error { } p.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + p.SystemData = &systemData + } } } @@ -8511,14 +8608,14 @@ func (pup ProfileUpdateParameters) MarshalJSON() ([]byte, error) { // ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than // required location and tags type ProxyResource struct { - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for ProxyResource. @@ -8681,6 +8778,8 @@ type Resource struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for Resource. @@ -8927,14 +9026,14 @@ type ResponseBasedOriginErrorDetectionParameters struct { type Route struct { autorest.Response `json:"-"` *RouteProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for Route. @@ -8964,15 +9063,6 @@ func (r *Route) UnmarshalJSON(body []byte) error { } r.RouteProperties = &routeProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - r.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -9000,6 +9090,15 @@ func (r *Route) UnmarshalJSON(body []byte) error { } r.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + r.SystemData = &systemData + } } } @@ -9439,14 +9538,14 @@ type RouteUpdatePropertiesParameters struct { type Rule struct { autorest.Response `json:"-"` *RuleProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for Rule. @@ -9476,15 +9575,6 @@ func (r *Rule) UnmarshalJSON(body []byte) error { } r.RuleProperties = &ruleProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - r.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -9512,6 +9602,15 @@ func (r *Rule) UnmarshalJSON(body []byte) error { } r.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + r.SystemData = &systemData + } } } @@ -9870,14 +9969,14 @@ func (future *RulesDeleteFuture) result(client RulesClient) (ar autorest.Respons type RuleSet struct { autorest.Response `json:"-"` *RuleSetProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for RuleSet. @@ -9907,15 +10006,6 @@ func (rs *RuleSet) UnmarshalJSON(body []byte) error { } rs.RuleSetProperties = &ruleSetProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - rs.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -9943,6 +10033,15 @@ func (rs *RuleSet) UnmarshalJSON(body []byte) error { } rs.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + rs.SystemData = &systemData + } } } @@ -10357,14 +10456,14 @@ func (rupp *RuleUpdatePropertiesParameters) UnmarshalJSON(body []byte) error { type Secret struct { autorest.Response `json:"-"` *SecretProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for Secret. @@ -10394,15 +10493,6 @@ func (s *Secret) UnmarshalJSON(body []byte) error { } s.SecretProperties = &secretProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - s.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -10430,6 +10520,15 @@ func (s *Secret) UnmarshalJSON(body []byte) error { } s.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + s.SystemData = &systemData + } } } @@ -11007,14 +11106,14 @@ func (future *SecurityPoliciesPatchFuture) result(client SecurityPoliciesClient) type SecurityPolicy struct { autorest.Response `json:"-"` *SecurityPolicyProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for SecurityPolicy. @@ -11044,15 +11143,6 @@ func (sp *SecurityPolicy) UnmarshalJSON(body []byte) error { } sp.SecurityPolicyProperties = &securityPolicyProperties } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - sp.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -11080,6 +11170,15 @@ func (sp *SecurityPolicy) UnmarshalJSON(body []byte) error { } sp.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + sp.SystemData = &systemData + } } } @@ -11505,14 +11604,14 @@ type TrackedResource struct { Location *string `json:"location,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for TrackedResource. @@ -12281,14 +12380,14 @@ type WebApplicationFirewallPolicy struct { Location *string `json:"location,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // SystemData - READ-ONLY - SystemData *SystemData `json:"systemData,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for WebApplicationFirewallPolicy. @@ -12366,15 +12465,6 @@ func (wafp *WebApplicationFirewallPolicy) UnmarshalJSON(body []byte) error { } wafp.Tags = tags } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - wafp.SystemData = &systemData - } case "id": if v != nil { var ID string @@ -12402,6 +12492,15 @@ func (wafp *WebApplicationFirewallPolicy) UnmarshalJSON(body []byte) error { } wafp.Type = &typeVar } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + wafp.SystemData = &systemData + } } } diff --git a/services/cdn/mgmt/2020-09-01/cdn/rulesets.go b/services/cdn/mgmt/2020-09-01/cdn/rulesets.go index 3f21d47ee07c..055c0feaf3d5 100644 --- a/services/cdn/mgmt/2020-09-01/cdn/rulesets.go +++ b/services/cdn/mgmt/2020-09-01/cdn/rulesets.go @@ -36,8 +36,7 @@ func NewRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) RuleSet // resourceGroupName - name of the Resource group within the Azure subscription. // profileName - name of the CDN profile which is unique within the resource group. // ruleSetName - name of the rule set under the profile which is unique globally -// ruleSet - ruleSet properties -func (client RuleSetsClient) Create(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleSet RuleSet) (result RuleSetsCreateFuture, err error) { +func (client RuleSetsClient) Create(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string) (result RuleSetsCreateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RuleSetsClient.Create") defer func() { @@ -56,7 +55,7 @@ func (client RuleSetsClient) Create(ctx context.Context, resourceGroupName strin return result, validation.NewError("cdn.RuleSetsClient", "Create", err.Error()) } - req, err := client.CreatePreparer(ctx, resourceGroupName, profileName, ruleSetName, ruleSet) + req, err := client.CreatePreparer(ctx, resourceGroupName, profileName, ruleSetName) if err != nil { err = autorest.NewErrorWithError(err, "cdn.RuleSetsClient", "Create", nil, "Failure preparing request") return @@ -72,7 +71,7 @@ func (client RuleSetsClient) Create(ctx context.Context, resourceGroupName strin } // CreatePreparer prepares the Create request. -func (client RuleSetsClient) CreatePreparer(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleSet RuleSet) (*http.Request, error) { +func (client RuleSetsClient) CreatePreparer(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "profileName": autorest.Encode("path", profileName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -86,11 +85,9 @@ func (client RuleSetsClient) CreatePreparer(ctx context.Context, resourceGroupNa } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}", pathParameters), - autorest.WithJSON(ruleSet), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) }