diff --git a/services/automation/mgmt/2015-10-31/automation/runbookdraft.go b/services/automation/mgmt/2015-10-31/automation/runbookdraft.go index 9de6ca1a79f3..ce3d3f111c44 100644 --- a/services/automation/mgmt/2015-10-31/automation/runbookdraft.go +++ b/services/automation/mgmt/2015-10-31/automation/runbookdraft.go @@ -22,6 +22,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" + "io" "net/http" ) @@ -279,7 +280,7 @@ func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result a // automationAccountName - the name of the automation account. // runbookName - the runbook name. // runbookContent - the runbook draft content. -func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (result RunbookDraftReplaceContentFuture, err error) { +func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (result RunbookDraftReplaceContentFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -304,7 +305,7 @@ func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGro } // ReplaceContentPreparer prepares the ReplaceContent request. -func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (*http.Request, error) { +func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -322,7 +323,7 @@ func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, res autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), - autorest.WithJSON(runbookContent), + autorest.WithFile(runbookContent), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/automation/mgmt/2017-05-15-preview/automation/runbookdraft.go b/services/preview/automation/mgmt/2017-05-15-preview/automation/runbookdraft.go index 9de6ca1a79f3..ce3d3f111c44 100644 --- a/services/preview/automation/mgmt/2017-05-15-preview/automation/runbookdraft.go +++ b/services/preview/automation/mgmt/2017-05-15-preview/automation/runbookdraft.go @@ -22,6 +22,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" + "io" "net/http" ) @@ -279,7 +280,7 @@ func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result a // automationAccountName - the name of the automation account. // runbookName - the runbook name. // runbookContent - the runbook draft content. -func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (result RunbookDraftReplaceContentFuture, err error) { +func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (result RunbookDraftReplaceContentFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -304,7 +305,7 @@ func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGro } // ReplaceContentPreparer prepares the ReplaceContent request. -func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (*http.Request, error) { +func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -322,7 +323,7 @@ func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, res autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), - autorest.WithJSON(runbookContent), + autorest.WithFile(runbookContent), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/automation/mgmt/2018-01-preview/automation/runbookdraft.go b/services/preview/automation/mgmt/2018-01-preview/automation/runbookdraft.go index c566bc58b792..b7b8a43ff956 100644 --- a/services/preview/automation/mgmt/2018-01-preview/automation/runbookdraft.go +++ b/services/preview/automation/mgmt/2018-01-preview/automation/runbookdraft.go @@ -22,6 +22,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" + "io" "net/http" ) @@ -279,7 +280,7 @@ func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result a // automationAccountName - the name of the automation account. // runbookName - the runbook name. // runbookContent - the runbook draft content. -func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (result RunbookDraftReplaceContentFuture, err error) { +func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (result RunbookDraftReplaceContentFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -304,7 +305,7 @@ func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGro } // ReplaceContentPreparer prepares the ReplaceContent request. -func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (*http.Request, error) { +func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -322,7 +323,7 @@ func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, res autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), - autorest.WithJSON(runbookContent), + autorest.WithFile(runbookContent), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) }