diff --git a/internal/services/automation/automation_account_data_source.go b/internal/services/automation/automation_account_data_source.go index f7f477b20284..bd7db195ccdb 100644 --- a/internal/services/automation/automation_account_data_source.go +++ b/internal/services/automation/automation_account_data_source.go @@ -7,14 +7,16 @@ import ( "fmt" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" - identity2 "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/automationaccount" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) func dataSourceAutomationAccount() *pluginsdk.Resource { @@ -84,7 +86,6 @@ func dataSourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{} defer cancel() id := automationaccount.NewAutomationAccountID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) - resp, err := client.Get(ctx, id) if err != nil { if response.WasNotFound(resp.HttpResponse) { @@ -94,43 +95,55 @@ func dataSourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{} } d.SetId(id.ID()) - iresp, err := iclient.Get(ctx, id.ResourceGroupName, id.AutomationAccountName) + infoId := agentregistrationinformation.NewAutomationAccountID(id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName) + infoResp, err := iclient.Get(ctx, infoId) if err != nil { - if utils.ResponseWasNotFound(iresp.Response) { - return fmt.Errorf("%q Account Registration Information was not found", id) - } - return fmt.Errorf("retreiving Automation Account Registration Information %s: %+v", id, err) - } - if iresp.Keys != nil { - d.Set("primary_key", iresp.Keys.Primary) - d.Set("secondary_key", iresp.Keys.Secondary) + return fmt.Errorf("retreiving Agent Registration Information for %s: %+v", id, err) } - identity, err := identity2.FlattenSystemAndUserAssignedMap(resp.Model.Identity) - if err != nil { - return fmt.Errorf("flattening `identity`: %+v", err) - } - if err := d.Set("identity", identity); err != nil { - return fmt.Errorf("setting `identity`: %+v", err) + if model := resp.Model; model != nil { + flattenedIdentity, err := identity.FlattenSystemAndUserAssignedMap(model.Identity) + if err != nil { + return fmt.Errorf("flattening `identity`: %+v", err) + } + if err := d.Set("identity", flattenedIdentity); err != nil { + return fmt.Errorf("setting `identity`: %+v", err) + } + + if props := model.Properties; props != nil { + d.Set("private_endpoint_connection", flattenPrivateEndpointConnectionsDataSource(props.PrivateEndpointConnections)) + d.Set("hybrid_service_url", props.AutomationHybridServiceUrl) + } } - d.Set("endpoint", iresp.Endpoint) - if resp.Model != nil && resp.Model.Properties != nil { - d.Set("private_endpoint_connection", flattenPrivateEndpointConnections(resp.Model.Properties.PrivateEndpointConnections)) - d.Set("hybrid_service_url", resp.Model.Properties.AutomationHybridServiceUrl) + endpoint := "" + primaryKey := "" + secondaryKey := "" + if model := infoResp.Model; model != nil { + endpoint = pointer.From(model.Endpoint) + if keys := model.Keys; keys != nil { + primaryKey = pointer.From(keys.Primary) + secondaryKey = pointer.From(keys.Secondary) + } } + d.Set("endpoint", endpoint) + d.Set("primary_key", primaryKey) + d.Set("secondary_key", secondaryKey) + return nil } -func flattenPrivateEndpointConnections(conns *[]automationaccount.PrivateEndpointConnection) (res []interface{}) { - if conns == nil || len(*conns) == 0 { - return +func flattenPrivateEndpointConnectionsDataSource(input *[]automationaccount.PrivateEndpointConnection) []interface{} { + if input == nil { + return []interface{}{} } - for _, con := range *conns { - res = append(res, map[string]interface{}{ - "id": con.Id, - "name": con.Name, + + output := make([]interface{}, 0) + for _, item := range *input { + output = append(output, map[string]interface{}{ + "id": pointer.From(item.Id), + "name": pointer.From(item.Name), }) } - return res + return output } diff --git a/internal/services/automation/automation_account_resource.go b/internal/services/automation/automation_account_resource.go index 92cd9b86b669..f45c786554fd 100644 --- a/internal/services/automation/automation_account_resource.go +++ b/internal/services/automation/automation_account_resource.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/automationaccount" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -282,7 +283,8 @@ func resourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}) return fmt.Errorf("retrieving %s: %+v", *id, err) } - keysResp, err := registrationClient.Get(ctx, id.ResourceGroupName, id.AutomationAccountName) + infoId := agentregistrationinformation.NewAutomationAccountID(id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName) + keysResp, err := registrationClient.Get(ctx, infoId) if err != nil { if response.WasNotFound(resp.HttpResponse) { log.Printf("[DEBUG] Agent Registration Info for %s was not found - removing from state!", *id) @@ -296,55 +298,56 @@ func resourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}) d.Set("name", id.AutomationAccountName) d.Set("resource_group_name", id.ResourceGroupName) - d.Set("location", location.NormalizeNilable(resp.Model.Location)) - publicNetworkAccessEnabled := true - if resp.Model == nil || resp.Model.Properties == nil { - return fmt.Errorf("retrieving Automation Account got empty Model") - } - prop := resp.Model.Properties - if prop.PublicNetworkAccess != nil { - publicNetworkAccessEnabled = *prop.PublicNetworkAccess - } - d.Set("public_network_access_enabled", publicNetworkAccessEnabled) - skuName := "" - if sku := prop.Sku; sku != nil { - skuName = string(prop.Sku.Name) - } - d.Set("sku_name", skuName) + if model := resp.Model; model != nil { + d.Set("location", location.NormalizeNilable(model.Location)) + if props := model.Properties; props != nil { + publicNetworkAccessEnabled := true + if props.PublicNetworkAccess != nil { + publicNetworkAccessEnabled = *props.PublicNetworkAccess + } + d.Set("public_network_access_enabled", publicNetworkAccessEnabled) - localAuthEnabled := true - if val := prop.DisableLocalAuth; val != nil && *val { - localAuthEnabled = false - } - d.Set("local_authentication_enabled", localAuthEnabled) + skuName := "" + if sku := props.Sku; sku != nil { + skuName = string(sku.Name) + } + d.Set("sku_name", skuName) - if err := d.Set("encryption", flattenEncryption(prop.Encryption)); err != nil { - return fmt.Errorf("setting `encryption`: %+v", err) - } + localAuthEnabled := true + if val := props.DisableLocalAuth; val != nil && *val { + localAuthEnabled = false + } + d.Set("local_authentication_enabled", localAuthEnabled) - d.Set("dsc_server_endpoint", keysResp.Endpoint) - if keys := keysResp.Keys; keys != nil { - d.Set("dsc_primary_access_key", keys.Primary) - d.Set("dsc_secondary_access_key", keys.Secondary) - } + if err := d.Set("encryption", flattenEncryption(props.Encryption)); err != nil { + return fmt.Errorf("setting `encryption`: %+v", err) + } + d.Set("hybrid_service_url", props.AutomationHybridServiceUrl) - d.Set("hybrid_service_url", prop.AutomationHybridServiceUrl) + identity, err := identity.FlattenSystemAndUserAssignedMap(model.Identity) + if err != nil { + return fmt.Errorf("flattening `identity`: %+v", err) + } + if err := d.Set("identity", identity); err != nil { + return fmt.Errorf("setting `identity`: %+v", err) + } - identity, err := identity.FlattenSystemAndUserAssignedMap(resp.Model.Identity) - if err != nil { - return fmt.Errorf("flattening `identity`: %+v", err) - } - if err := d.Set("identity", identity); err != nil { - return fmt.Errorf("setting `identity`: %+v", err) - } + d.Set("private_endpoint_connection", flattenPrivateEndpointConnections(props.PrivateEndpointConnections)) + } - if resp.Model != nil && resp.Model.Properties != nil { - d.Set("private_endpoint_connection", flattenPrivateEndpointConnections(resp.Model.Properties.PrivateEndpointConnections)) + if err := tags.FlattenAndSet(d, model.Tags); err != nil { + return err + } } - if resp.Model.Tags != nil { - return flattenAndSetTags(d, *resp.Model.Tags) + if model := keysResp.Model; model != nil { + d.Set("dsc_server_endpoint", model.Endpoint) + if keys := model.Keys; keys != nil { + d.Set("dsc_primary_access_key", keys.Primary) + d.Set("dsc_secondary_access_key", keys.Secondary) + } } + return nil } @@ -438,3 +441,18 @@ func flattenEncryption(encryption *automationaccount.EncryptionProperties) []int }, } } + +func flattenPrivateEndpointConnections(input *[]automationaccount.PrivateEndpointConnection) []interface{} { + if input == nil { + return []interface{}{} + } + + output := make([]interface{}, 0) + for _, item := range *input { + output = append(output, map[string]interface{}{ + "id": pointer.From(item.Id), + "name": pointer.From(item.Name), + }) + } + return output +} diff --git a/internal/services/automation/automation_account_resource_test.go b/internal/services/automation/automation_account_resource_test.go index 990fd89fa223..072d79950235 100644 --- a/internal/services/automation/automation_account_resource_test.go +++ b/internal/services/automation/automation_account_resource_test.go @@ -219,7 +219,7 @@ func (t AutomationAccountResource) Exists(ctx context.Context, clients *clients. return nil, fmt.Errorf("retrieving Automation Account %q (resource group: %q): %+v", id.AutomationAccountName, id.ResourceGroupName, err) } - return utils.Bool(resp.Model.Properties != nil), nil + return utils.Bool(resp.Model != nil), nil } func (AutomationAccountResource) basic(data acceptance.TestData) string { diff --git a/internal/services/automation/automation_dsc_configuration_resource.go b/internal/services/automation/automation_dsc_configuration_resource.go index cee73aecbc4b..33984a8a0f3c 100644 --- a/internal/services/automation/automation_dsc_configuration_resource.go +++ b/internal/services/automation/automation_dsc_configuration_resource.go @@ -13,12 +13,12 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscconfiguration" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -88,7 +88,7 @@ func resourceAutomationDscConfiguration() *pluginsdk.Resource { Computed: true, }, - "tags": tags.Schema(), + "tags": commonschema.Tags(), }, } } @@ -178,13 +178,9 @@ func resourceAutomationDscConfigurationRead(d *pluginsdk.ResourceData, meta inte d.Set("state", string(pointer.From(props.State))) } - if model.Tags != nil { - err := flattenAndSetTags(d, *model.Tags) - if err != nil { - return err - } + if err := tags.FlattenAndSet(d, model.Tags); err != nil { + return err } - } contentResp, err := client.GetContent(ctx, *id) diff --git a/internal/services/automation/automation_runbook_resource.go b/internal/services/automation/automation_runbook_resource.go index f3ffde67c4cd..5f4be4fda1b8 100644 --- a/internal/services/automation/automation_runbook_resource.go +++ b/internal/services/automation/automation_runbook_resource.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobschedule" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbook" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft" @@ -21,7 +22,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/helper" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -239,7 +239,7 @@ func resourceAutomationRunbook() *pluginsdk.Resource { ValidateFunc: validation.IntAtLeast(0), }, - "tags": tags.Schema(), + "tags": commonschema.Tags(), }, } } @@ -438,8 +438,8 @@ func resourceAutomationRunbookRead(d *pluginsdk.ResourceData, meta interface{}) return fmt.Errorf("setting `job_schedule`: %+v", err) } - if t := model.Tags; t != nil { - return flattenAndSetTags(d, *t) + if err := tags.FlattenAndSet(d, model.Tags); err != nil { + return err } return nil diff --git a/internal/services/automation/client/client.go b/internal/services/automation/client/client.go index 4067b341aa3a..4f90c1e7c398 100644 --- a/internal/services/automation/client/client.go +++ b/internal/services/automation/client/client.go @@ -6,8 +6,8 @@ package client import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2015-10-31/webhook" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/softwareupdateconfiguration" "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2020-01-13-preview/watcher" automation_2022_08_08 "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08" @@ -18,7 +18,7 @@ import ( type Client struct { *automation_2022_08_08.Client - AgentRegistrationInfoClient *automation.AgentRegistrationInformationClient + AgentRegistrationInfoClient *agentregistrationinformation.AgentRegistrationInformationClient SoftwareUpdateConfigClient *softwareupdateconfiguration.SoftwareUpdateConfigurationClient WebhookClient *webhook.WebhookClient WatcherClient *watcher.WatcherClient @@ -32,7 +32,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) { return nil, fmt.Errorf("building Automation client: %+v", err) } - agentRegistrationInfoClient := automation.NewAgentRegistrationInformationClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + agentRegistrationInfoClient := agentregistrationinformation.NewAgentRegistrationInformationClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&agentRegistrationInfoClient.Client, o.ResourceManagerAuthorizer) softUpClient := softwareupdateconfiguration.NewSoftwareUpdateConfigurationClientWithBaseURI(o.ResourceManagerEndpoint) diff --git a/internal/services/automation/transition.go b/internal/services/automation/transition.go index f3b3f02006d4..fcfd9b949c98 100644 --- a/internal/services/automation/transition.go +++ b/internal/services/automation/transition.go @@ -5,8 +5,6 @@ package automation import ( "fmt" - - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) func interfaceValueToString(v interface{}) (string, error) { @@ -42,12 +40,3 @@ func flattenMap(strStrMap map[string]string) map[string]interface{} { return output } - -func flattenAndSetTags(d *pluginsdk.ResourceData, tagMap map[string]string) error { - flattened := flattenMap(tagMap) - if err := d.Set("tags", flattened); err != nil { - return fmt.Errorf("setting `tags`: %s", err) - } - - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/_meta.json deleted file mode 100644 index 66f1656631dc..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "3b9b0a930e29cbead33df69ae46c7080408e4c0f", - "readme": "/_/azure-rest-api-specs/specification/automation/resource-manager/readme.md", - "tag": "package-2020-01-13-preview", - "use": "@microsoft.azure/autorest.go@2.1.187", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-01-13-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/automation/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/account.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/account.go deleted file mode 100644 index fbf9b942083e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/account.go +++ /dev/null @@ -1,610 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AccountClient is the automation Client -type AccountClient struct { - BaseClient -} - -// NewAccountClient creates an instance of the AccountClient client. -func NewAccountClient(subscriptionID string) AccountClient { - return NewAccountClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAccountClientWithBaseURI creates an instance of the AccountClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAccountClientWithBaseURI(baseURI string, subscriptionID string) AccountClient { - return AccountClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update automation account. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// parameters - parameters supplied to the create or update automation account. -func (client AccountClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountCreateOrUpdateParameters) (result Account, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.AccountClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AccountClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AccountClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete an automation account. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client AccountClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.AccountClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AccountClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AccountClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get information about an Automation Account. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client AccountClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result Account, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.AccountClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AccountClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AccountClient) GetResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieve a list of accounts within a given subscription. -func (client AccountClient) List(ctx context.Context) (result AccountListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.List") - defer func() { - sc := -1 - if result.alr.Response.Response != nil { - sc = result.alr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.alr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", resp, "Failure sending request") - return - } - - result.alr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", resp, "Failure responding to request") - return - } - if result.alr.hasNextLink() && result.alr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AccountClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AccountClient) ListResponder(resp *http.Response) (result AccountListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AccountClient) listNextResults(ctx context.Context, lastResults AccountListResult) (result AccountListResult, err error) { - req, err := lastResults.accountListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountClient) ListComplete(ctx context.Context) (result AccountListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup retrieve a list of accounts within a given resource group. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -func (client AccountClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.alr.Response.Response != nil { - sc = result.alr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.AccountClient", "ListByResourceGroup", err.Error()) - } - - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.alr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.alr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.alr.hasNextLink() && result.alr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AccountClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client AccountClient) ListByResourceGroupResponder(resp *http.Response) (result AccountListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client AccountClient) listByResourceGroupNextResults(ctx context.Context, lastResults AccountListResult) (result AccountListResult, err error) { - req, err := lastResults.accountListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AccountListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update update an automation account. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// parameters - parameters supplied to the update automation account. -func (client AccountClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountUpdateParameters) (result Account, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.AccountClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client AccountClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client AccountClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client AccountClient) UpdateResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/activity.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/activity.go deleted file mode 100644 index 6a568bcedc90..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/activity.go +++ /dev/null @@ -1,248 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ActivityClient is the automation Client -type ActivityClient struct { - BaseClient -} - -// NewActivityClient creates an instance of the ActivityClient client. -func NewActivityClient(subscriptionID string) ActivityClient { - return NewActivityClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewActivityClientWithBaseURI creates an instance of the ActivityClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewActivityClientWithBaseURI(baseURI string, subscriptionID string) ActivityClient { - return ActivityClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve the activity in the module identified by module name and activity name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// moduleName - the name of module. -// activityName - the name of activity. -func (client ActivityClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (result Activity, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ActivityClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ActivityClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName, activityName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ActivityClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "activityName": autorest.Encode("path", activityName), - "automationAccountName": autorest.Encode("path", automationAccountName), - "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ActivityClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ActivityClient) GetResponder(resp *http.Response) (result Activity, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByModule retrieve a list of activities in the module identified by module name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// moduleName - the name of module. -func (client ActivityClient) ListByModule(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ActivityClient.ListByModule") - defer func() { - sc := -1 - if result.alr.Response.Response != nil { - sc = result.alr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ActivityClient", "ListByModule", err.Error()) - } - - result.fn = client.listByModuleNextResults - req, err := client.ListByModulePreparer(ctx, resourceGroupName, automationAccountName, moduleName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", nil, "Failure preparing request") - return - } - - resp, err := client.ListByModuleSender(req) - if err != nil { - result.alr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", resp, "Failure sending request") - return - } - - result.alr, err = client.ListByModuleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", resp, "Failure responding to request") - return - } - if result.alr.hasNextLink() && result.alr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByModulePreparer prepares the ListByModule request. -func (client ActivityClient) ListByModulePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByModuleSender sends the ListByModule request. The method will close the -// http.Response Body if it receives an error. -func (client ActivityClient) ListByModuleSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByModuleResponder handles the response to the ListByModule request. The method always -// closes the http.Response Body. -func (client ActivityClient) ListByModuleResponder(resp *http.Response) (result ActivityListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByModuleNextResults retrieves the next set of results, if any. -func (client ActivityClient) listByModuleNextResults(ctx context.Context, lastResults ActivityListResult) (result ActivityListResult, err error) { - req, err := lastResults.activityListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByModuleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByModuleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByModuleComplete enumerates all values, automatically crossing page boundaries as required. -func (client ActivityClient) ListByModuleComplete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ActivityClient.ListByModule") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByModule(ctx, resourceGroupName, automationAccountName, moduleName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/agentregistrationinformation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/agentregistrationinformation.go deleted file mode 100644 index 32c83b556e76..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/agentregistrationinformation.go +++ /dev/null @@ -1,204 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AgentRegistrationInformationClient is the automation Client -type AgentRegistrationInformationClient struct { - BaseClient -} - -// NewAgentRegistrationInformationClient creates an instance of the AgentRegistrationInformationClient client. -func NewAgentRegistrationInformationClient(subscriptionID string) AgentRegistrationInformationClient { - return NewAgentRegistrationInformationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAgentRegistrationInformationClientWithBaseURI creates an instance of the AgentRegistrationInformationClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewAgentRegistrationInformationClientWithBaseURI(baseURI string, subscriptionID string) AgentRegistrationInformationClient { - return AgentRegistrationInformationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve the automation agent registration information. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client AgentRegistrationInformationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result AgentRegistration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AgentRegistrationInformationClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.AgentRegistrationInformationClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AgentRegistrationInformationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AgentRegistrationInformationClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AgentRegistrationInformationClient) GetResponder(resp *http.Response) (result AgentRegistration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// RegenerateKey regenerate a primary or secondary agent registration key -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// parameters - the name of the agent registration key to be regenerated -func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (result AgentRegistration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AgentRegistrationInformationClient.RegenerateKey") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.AgentRegistrationInformationClient", "RegenerateKey", err.Error()) - } - - req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, automationAccountName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", nil, "Failure preparing request") - return - } - - resp, err := client.RegenerateKeySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", resp, "Failure sending request") - return - } - - result, err = client.RegenerateKeyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", resp, "Failure responding to request") - return - } - - return -} - -// RegenerateKeyPreparer prepares the RegenerateKey request. -func (client AgentRegistrationInformationClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RegenerateKeySender sends the RegenerateKey request. The method will close the -// http.Response Body if it receives an error. -func (client AgentRegistrationInformationClient) RegenerateKeySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always -// closes the http.Response Body. -func (client AgentRegistrationInformationClient) RegenerateKeyResponder(resp *http.Response) (result AgentRegistration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/certificate.go deleted file mode 100644 index 3310dcbc156d..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/certificate.go +++ /dev/null @@ -1,511 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CertificateClient is the automation Client -type CertificateClient struct { - BaseClient -} - -// NewCertificateClient creates an instance of the CertificateClient client. -func NewCertificateClient(subscriptionID string) CertificateClient { - return NewCertificateClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string) CertificateClient { - return CertificateClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create a certificate. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// certificateName - the parameters supplied to the create or update certificate operation. -// parameters - the parameters supplied to the create or update certificate operation. -func (client CertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (result Certificate, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.CertificateCreateOrUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties.Base64Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("automation.CertificateClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client CertificateClient) CreateOrUpdateResponder(resp *http.Response) (result Certificate, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the certificate. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// certificateName - the name of certificate. -func (client CertificateClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.CertificateClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, certificateName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the certificate identified by certificate name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// certificateName - the name of certificate. -func (client CertificateClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result Certificate, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.CertificateClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, certificateName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CertificateClient) GetResponder(resp *http.Response) (result Certificate, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of certificates. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client CertificateClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.clr.Response.Response != nil { - sc = result.clr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.CertificateClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.clr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.clr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.clr.hasNextLink() && result.clr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client CertificateClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client CertificateClient) ListByAutomationAccountResponder(resp *http.Response) (result CertificateListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client CertificateClient) listByAutomationAccountNextResults(ctx context.Context, lastResults CertificateListResult) (result CertificateListResult, err error) { - req, err := lastResults.certificateListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client CertificateClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) - return -} - -// Update update a certificate. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// certificateName - the parameters supplied to the update certificate operation. -// parameters - the parameters supplied to the update certificate operation. -func (client CertificateClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (result Certificate, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.CertificateClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client CertificateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client CertificateClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client CertificateClient) UpdateResponder(resp *http.Response) (result Certificate, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/client.go deleted file mode 100644 index ed6aabd94eae..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/client.go +++ /dev/null @@ -1,43 +0,0 @@ -// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details. -// -// Package automation implements the Azure ARM Automation service API version . -// -// Automation Client -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Automation - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Automation. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/connection.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/connection.go deleted file mode 100644 index b6707c71e05e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/connection.go +++ /dev/null @@ -1,511 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ConnectionClient is the automation Client -type ConnectionClient struct { - BaseClient -} - -// NewConnectionClient creates an instance of the ConnectionClient client. -func NewConnectionClient(subscriptionID string) ConnectionClient { - return NewConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewConnectionClientWithBaseURI creates an instance of the ConnectionClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewConnectionClientWithBaseURI(baseURI string, subscriptionID string) ConnectionClient { - return ConnectionClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a connection. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// connectionName - the parameters supplied to the create or update connection operation. -// parameters - the parameters supplied to the create or update connection operation. -func (client ConnectionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (result Connection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ConnectionCreateOrUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ConnectionCreateOrUpdateProperties.ConnectionType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("automation.ConnectionClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ConnectionClient) CreateOrUpdateResponder(resp *http.Response) (result Connection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the connection. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// connectionName - the name of connection. -func (client ConnectionClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ConnectionClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ConnectionClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ConnectionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the connection identified by connection name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// connectionName - the name of connection. -func (client ConnectionClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ConnectionClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ConnectionClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ConnectionClient) GetResponder(resp *http.Response) (result Connection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of connections. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.clr.Response.Response != nil { - sc = result.clr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ConnectionClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.clr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.clr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.clr.hasNextLink() && result.clr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ConnectionClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client ConnectionClient) ListByAutomationAccountResponder(resp *http.Response) (result ConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client ConnectionClient) listByAutomationAccountNextResults(ctx context.Context, lastResults ConnectionListResult) (result ConnectionListResult, err error) { - req, err := lastResults.connectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ConnectionClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) - return -} - -// Update update a connection. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// connectionName - the parameters supplied to the update a connection operation. -// parameters - the parameters supplied to the update a connection operation. -func (client ConnectionClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (result Connection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ConnectionClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ConnectionClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ConnectionClient) UpdateResponder(resp *http.Response) (result Connection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/connectiontype.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/connectiontype.go deleted file mode 100644 index a0b63baf7321..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/connectiontype.go +++ /dev/null @@ -1,422 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ConnectionTypeClient is the automation Client -type ConnectionTypeClient struct { - BaseClient -} - -// NewConnectionTypeClient creates an instance of the ConnectionTypeClient client. -func NewConnectionTypeClient(subscriptionID string) ConnectionTypeClient { - return NewConnectionTypeClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewConnectionTypeClientWithBaseURI creates an instance of the ConnectionTypeClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string) ConnectionTypeClient { - return ConnectionTypeClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create a connection type. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// connectionTypeName - the parameters supplied to the create or update connection type operation. -// parameters - the parameters supplied to the create or update connection type operation. -func (client ConnectionTypeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (result ConnectionType, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ConnectionTypeCreateOrUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ConnectionTypeCreateOrUpdateProperties.FieldDefinitions", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("automation.ConnectionTypeClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectionTypeClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "connectionTypeName": autorest.Encode("path", connectionTypeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionTypeClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ConnectionTypeClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectionType, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the connection type. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// connectionTypeName - the name of connection type. -func (client ConnectionTypeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ConnectionTypeClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ConnectionTypeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "connectionTypeName": autorest.Encode("path", connectionTypeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionTypeClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ConnectionTypeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the connection type identified by connection type name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// connectionTypeName - the name of connection type. -func (client ConnectionTypeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result ConnectionType, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ConnectionTypeClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ConnectionTypeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "connectionTypeName": autorest.Encode("path", connectionTypeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionTypeClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ConnectionTypeClient) GetResponder(resp *http.Response) (result ConnectionType, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of connection types. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.ctlr.Response.Response != nil { - sc = result.ctlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ConnectionTypeClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.ctlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.ctlr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.ctlr.hasNextLink() && result.ctlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ConnectionTypeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionTypeClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client ConnectionTypeClient) ListByAutomationAccountResponder(resp *http.Response) (result ConnectionTypeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client ConnectionTypeClient) listByAutomationAccountNextResults(ctx context.Context, lastResults ConnectionTypeListResult) (result ConnectionTypeListResult, err error) { - req, err := lastResults.connectionTypeListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ConnectionTypeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/credential.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/credential.go deleted file mode 100644 index 876567b18c17..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/credential.go +++ /dev/null @@ -1,513 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CredentialClient is the automation Client -type CredentialClient struct { - BaseClient -} - -// NewCredentialClient creates an instance of the CredentialClient client. -func NewCredentialClient(subscriptionID string) CredentialClient { - return NewCredentialClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCredentialClientWithBaseURI creates an instance of the CredentialClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewCredentialClientWithBaseURI(baseURI string, subscriptionID string) CredentialClient { - return CredentialClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create a credential. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// credentialName - the parameters supplied to the create or update credential operation. -// parameters - the parameters supplied to the create or update credential operation. -func (client CredentialClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (result Credential, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.CredentialCreateOrUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.CredentialCreateOrUpdateProperties.UserName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.CredentialCreateOrUpdateProperties.Password", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("automation.CredentialClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CredentialClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client CredentialClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client CredentialClient) CreateOrUpdateResponder(resp *http.Response) (result Credential, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the credential. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// credentialName - the name of credential. -func (client CredentialClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.CredentialClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, credentialName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CredentialClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client CredentialClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CredentialClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the credential identified by credential name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// credentialName - the name of credential. -func (client CredentialClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result Credential, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.CredentialClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, credentialName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CredentialClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CredentialClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CredentialClient) GetResponder(resp *http.Response) (result Credential, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of credentials. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client CredentialClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.clr.Response.Response != nil { - sc = result.clr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.CredentialClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.clr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.clr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.clr.hasNextLink() && result.clr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client CredentialClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client CredentialClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client CredentialClient) ListByAutomationAccountResponder(resp *http.Response) (result CredentialListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client CredentialClient) listByAutomationAccountNextResults(ctx context.Context, lastResults CredentialListResult) (result CredentialListResult, err error) { - req, err := lastResults.credentialListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client CredentialClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) - return -} - -// Update update a credential. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// credentialName - the parameters supplied to the Update credential operation. -// parameters - the parameters supplied to the Update credential operation. -func (client CredentialClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (result Credential, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.CredentialClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client CredentialClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client CredentialClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client CredentialClient) UpdateResponder(resp *http.Response) (result Credential, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjob.go deleted file mode 100644 index c767e72429da..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjob.go +++ /dev/null @@ -1,433 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "github.com/gofrs/uuid" - "net/http" -) - -// DscCompilationJobClient is the automation Client -type DscCompilationJobClient struct { - BaseClient -} - -// NewDscCompilationJobClient creates an instance of the DscCompilationJobClient client. -func NewDscCompilationJobClient(subscriptionID string) DscCompilationJobClient { - return NewDscCompilationJobClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDscCompilationJobClientWithBaseURI creates an instance of the DscCompilationJobClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobClient { - return DscCompilationJobClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates the Dsc compilation job of the configuration. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// compilationJobName - the DSC configuration Id. -// parameters - the parameters supplied to the create compilation job operation. -func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string, parameters DscCompilationJobCreateParameters) (result DscCompilationJobCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.Create") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties.Configuration", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("automation.DscCompilationJobClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, compilationJobName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client DscCompilationJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string, parameters DscCompilationJobCreateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "compilationJobName": autorest.Encode("path", compilationJobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client DscCompilationJobClient) CreateSender(req *http.Request) (future DscCompilationJobCreateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client DscCompilationJobClient) CreateResponder(resp *http.Response) (result DscCompilationJob, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieve the Dsc configuration compilation job identified by job id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// compilationJobName - the DSC configuration Id. -func (client DscCompilationJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string) (result DscCompilationJob, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscCompilationJobClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, compilationJobName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DscCompilationJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "compilationJobName": autorest.Encode("path", compilationJobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DscCompilationJobClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DscCompilationJobClient) GetResponder(resp *http.Response) (result DscCompilationJob, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetStream retrieve the job stream identified by job stream id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobID - the job id. -// jobStreamID - the job stream id. -func (client DscCompilationJobClient) GetStream(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (result JobStream, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.GetStream") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscCompilationJobClient", "GetStream", err.Error()) - } - - req, err := client.GetStreamPreparer(ctx, resourceGroupName, automationAccountName, jobID, jobStreamID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", nil, "Failure preparing request") - return - } - - resp, err := client.GetStreamSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", resp, "Failure sending request") - return - } - - result, err = client.GetStreamResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", resp, "Failure responding to request") - return - } - - return -} - -// GetStreamPreparer prepares the GetStream request. -func (client DscCompilationJobClient) GetStreamPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobId": autorest.Encode("path", jobID), - "jobStreamId": autorest.Encode("path", jobStreamID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetStreamSender sends the GetStream request. The method will close the -// http.Response Body if it receives an error. -func (client DscCompilationJobClient) GetStreamSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetStreamResponder handles the response to the GetStream request. The method always -// closes the http.Response Body. -func (client DscCompilationJobClient) GetStreamResponder(resp *http.Response) (result JobStream, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of dsc compilation jobs. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.dcjlr.Response.Response != nil { - sc = result.dcjlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscCompilationJobClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.dcjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.dcjlr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.dcjlr.hasNextLink() && result.dcjlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscCompilationJobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client DscCompilationJobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client DscCompilationJobClient) ListByAutomationAccountResponder(resp *http.Response) (result DscCompilationJobListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client DscCompilationJobClient) listByAutomationAccountNextResults(ctx context.Context, lastResults DscCompilationJobListResult) (result DscCompilationJobListResult, err error) { - req, err := lastResults.dscCompilationJobListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscCompilationJobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjobstream.go deleted file mode 100644 index 89f0ce06c66f..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjobstream.go +++ /dev/null @@ -1,120 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "github.com/gofrs/uuid" - "net/http" -) - -// DscCompilationJobStreamClient is the automation Client -type DscCompilationJobStreamClient struct { - BaseClient -} - -// NewDscCompilationJobStreamClient creates an instance of the DscCompilationJobStreamClient client. -func NewDscCompilationJobStreamClient(subscriptionID string) DscCompilationJobStreamClient { - return NewDscCompilationJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDscCompilationJobStreamClientWithBaseURI creates an instance of the DscCompilationJobStreamClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewDscCompilationJobStreamClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobStreamClient { - return DscCompilationJobStreamClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByJob retrieve all the job streams for the compilation Job. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobID - the job id. -func (client DscCompilationJobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result JobStreamListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobStreamClient.ListByJob") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscCompilationJobStreamClient", "ListByJob", err.Error()) - } - - req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", nil, "Failure preparing request") - return - } - - resp, err := client.ListByJobSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure sending request") - return - } - - result, err = client.ListByJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure responding to request") - return - } - - return -} - -// ListByJobPreparer prepares the ListByJob request. -func (client DscCompilationJobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByJobSender sends the ListByJob request. The method will close the -// http.Response Body if it receives an error. -func (client DscCompilationJobStreamClient) ListByJobSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByJobResponder handles the response to the ListByJob request. The method always -// closes the http.Response Body. -func (client DscCompilationJobStreamClient) ListByJobResponder(resp *http.Response) (result JobStreamListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dscconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dscconfiguration.go deleted file mode 100644 index 52e6d6ba9094..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dscconfiguration.go +++ /dev/null @@ -1,622 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DscConfigurationClient is the automation Client -type DscConfigurationClient struct { - BaseClient -} - -// NewDscConfigurationClient creates an instance of the DscConfigurationClient client. -func NewDscConfigurationClient(subscriptionID string) DscConfigurationClient { - return NewDscConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDscConfigurationClientWithBaseURI creates an instance of the DscConfigurationClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDscConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscConfigurationClient { - return DscConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create the configuration identified by configuration name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// configurationName - the create or update parameters for configuration. -// parameters - the create or update parameters for configuration. -func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (result DscConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash.Value", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("automation.DscConfigurationClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, configurationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DscConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DscConfigurationClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DscConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result DscConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the dsc configuration identified by configuration name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// configurationName - the configuration name. -func (client DscConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscConfigurationClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, configurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DscConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DscConfigurationClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DscConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the configuration identified by configuration name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// configurationName - the configuration name. -func (client DscConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result DscConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscConfigurationClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, configurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DscConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DscConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DscConfigurationClient) GetResponder(resp *http.Response) (result DscConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetContent retrieve the configuration script identified by configuration name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// configurationName - the configuration name. -func (client DscConfigurationClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result String, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.GetContent") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscConfigurationClient", "GetContent", err.Error()) - } - - req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, configurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", nil, "Failure preparing request") - return - } - - resp, err := client.GetContentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", resp, "Failure sending request") - return - } - - result, err = client.GetContentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", resp, "Failure responding to request") - return - } - - return -} - -// GetContentPreparer prepares the GetContent request. -func (client DscConfigurationClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetContentSender sends the GetContent request. The method will close the -// http.Response Body if it receives an error. -func (client DscConfigurationClient) GetContentSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetContentResponder handles the response to the GetContent request. The method always -// closes the http.Response Body. -func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of configurations. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -// skip - the number of rows to skip. -// top - the number of rows to take. -// inlinecount - return total rows. -func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.dclr.Response.Response != nil { - sc = result.dclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscConfigurationClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.dclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.dclr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.dclr.hasNextLink() && result.dclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(inlinecount) > 0 { - queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client DscConfigurationClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client DscConfigurationClient) ListByAutomationAccountResponder(resp *http.Response) (result DscConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client DscConfigurationClient) listByAutomationAccountNextResults(ctx context.Context, lastResults DscConfigurationListResult) (result DscConfigurationListResult, err error) { - req, err := lastResults.dscConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) - return -} - -// Update create the configuration identified by configuration name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// configurationName - the create or update parameters for configuration. -// parameters - the create or update parameters for configuration. -func (client DscConfigurationClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (result DscConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscConfigurationClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, configurationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DscConfigurationClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DscConfigurationClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DscConfigurationClient) UpdateResponder(resp *http.Response) (result DscConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnode.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnode.go deleted file mode 100644 index 51c8d790f327..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnode.go +++ /dev/null @@ -1,434 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DscNodeClient is the automation Client -type DscNodeClient struct { - BaseClient -} - -// NewDscNodeClient creates an instance of the DscNodeClient client. -func NewDscNodeClient(subscriptionID string) DscNodeClient { - return NewDscNodeClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDscNodeClientWithBaseURI creates an instance of the DscNodeClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDscNodeClientWithBaseURI(baseURI string, subscriptionID string) DscNodeClient { - return DscNodeClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete delete the dsc node identified by node id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// nodeID - the node id. -func (client DscNodeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscNodeClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DscNodeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DscNodeClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DscNodeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the dsc node identified by node id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// nodeID - the node id. -func (client DscNodeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscNodeClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DscNodeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DscNodeClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DscNodeClient) GetResponder(resp *http.Response) (result DscNode, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of dsc nodes. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -// skip - the number of rows to skip. -// top - the number of rows to take. -// inlinecount - return total rows. -func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.dnlr.Response.Response != nil { - sc = result.dnlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscNodeClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.dnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.dnlr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.dnlr.hasNextLink() && result.dnlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscNodeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(inlinecount) > 0 { - queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client DscNodeClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client DscNodeClient) ListByAutomationAccountResponder(resp *http.Response) (result DscNodeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client DscNodeClient) listByAutomationAccountNextResults(ctx context.Context, lastResults DscNodeListResult) (result DscNodeListResult, err error) { - req, err := lastResults.dscNodeListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscNodeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) - return -} - -// Update update the dsc node. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// nodeID - parameters supplied to the update dsc node. -// dscNodeUpdateParameters - parameters supplied to the update dsc node. -func (client DscNodeClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, dscNodeUpdateParameters DscNodeUpdateParameters) (result DscNode, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscNodeClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeID, dscNodeUpdateParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DscNodeClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, dscNodeUpdateParameters DscNodeUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), - autorest.WithJSON(dscNodeUpdateParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DscNodeClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DscNodeClient) UpdateResponder(resp *http.Response) (result DscNode, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnodeconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnodeconfiguration.go deleted file mode 100644 index 3a92f43e7f47..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnodeconfiguration.go +++ /dev/null @@ -1,448 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DscNodeConfigurationClient is the automation Client -type DscNodeConfigurationClient struct { - BaseClient -} - -// NewDscNodeConfigurationClient creates an instance of the DscNodeConfigurationClient client. -func NewDscNodeConfigurationClient(subscriptionID string) DscNodeConfigurationClient { - return NewDscNodeConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDscNodeConfigurationClientWithBaseURI creates an instance of the DscNodeConfigurationClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscNodeConfigurationClient { - return DscNodeConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create the node configuration identified by node configuration name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// nodeConfigurationName - the Dsc node configuration name. -// parameters - the create or update parameters for configuration. -func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (result DscNodeConfigurationCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source.Hash", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source.Hash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source.Hash.Value", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - {Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Configuration", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("automation.DscNodeConfigurationClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DscNodeConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DscNodeConfigurationClient) CreateOrUpdateSender(req *http.Request) (future DscNodeConfigurationCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DscNodeConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result DscNodeConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the Dsc node configurations by node configuration. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// nodeConfigurationName - the Dsc node configuration name. -func (client DscNodeConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscNodeConfigurationClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DscNodeConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DscNodeConfigurationClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DscNodeConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the Dsc node configurations by node configuration. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// nodeConfigurationName - the Dsc node configuration name. -func (client DscNodeConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result DscNodeConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscNodeConfigurationClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DscNodeConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DscNodeConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DscNodeConfigurationClient) GetResponder(resp *http.Response) (result DscNodeConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of dsc node configurations. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -// skip - the number of rows to skip. -// top - the number of rows to take. -// inlinecount - return total rows. -func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.dnclr.Response.Response != nil { - sc = result.dnclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscNodeConfigurationClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.dnclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.dnclr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.dnclr.hasNextLink() && result.dnclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscNodeConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(inlinecount) > 0 { - queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client DscNodeConfigurationClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client DscNodeConfigurationClient) ListByAutomationAccountResponder(resp *http.Response) (result DscNodeConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client DscNodeConfigurationClient) listByAutomationAccountNextResults(ctx context.Context, lastResults DscNodeConfigurationListResult) (result DscNodeConfigurationListResult, err error) { - req, err := lastResults.dscNodeConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscNodeConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/enums.go deleted file mode 100644 index 80726695a21d..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/enums.go +++ /dev/null @@ -1,680 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// AccountState enumerates the values for account state. -type AccountState string - -const ( - // AccountStateOk ... - AccountStateOk AccountState = "Ok" - // AccountStateSuspended ... - AccountStateSuspended AccountState = "Suspended" - // AccountStateUnavailable ... - AccountStateUnavailable AccountState = "Unavailable" -) - -// PossibleAccountStateValues returns an array of possible values for the AccountState const type. -func PossibleAccountStateValues() []AccountState { - return []AccountState{AccountStateOk, AccountStateSuspended, AccountStateUnavailable} -} - -// AgentRegistrationKeyName enumerates the values for agent registration key name. -type AgentRegistrationKeyName string - -const ( - // AgentRegistrationKeyNamePrimary ... - AgentRegistrationKeyNamePrimary AgentRegistrationKeyName = "primary" - // AgentRegistrationKeyNameSecondary ... - AgentRegistrationKeyNameSecondary AgentRegistrationKeyName = "secondary" -) - -// PossibleAgentRegistrationKeyNameValues returns an array of possible values for the AgentRegistrationKeyName const type. -func PossibleAgentRegistrationKeyNameValues() []AgentRegistrationKeyName { - return []AgentRegistrationKeyName{AgentRegistrationKeyNamePrimary, AgentRegistrationKeyNameSecondary} -} - -// ContentSourceType enumerates the values for content source type. -type ContentSourceType string - -const ( - // ContentSourceTypeEmbeddedContent ... - ContentSourceTypeEmbeddedContent ContentSourceType = "embeddedContent" - // ContentSourceTypeURI ... - ContentSourceTypeURI ContentSourceType = "uri" -) - -// PossibleContentSourceTypeValues returns an array of possible values for the ContentSourceType const type. -func PossibleContentSourceTypeValues() []ContentSourceType { - return []ContentSourceType{ContentSourceTypeEmbeddedContent, ContentSourceTypeURI} -} - -// CountType enumerates the values for count type. -type CountType string - -const ( - // CountTypeNodeconfiguration ... - CountTypeNodeconfiguration CountType = "nodeconfiguration" - // CountTypeStatus ... - CountTypeStatus CountType = "status" -) - -// PossibleCountTypeValues returns an array of possible values for the CountType const type. -func PossibleCountTypeValues() []CountType { - return []CountType{CountTypeNodeconfiguration, CountTypeStatus} -} - -// DscConfigurationProvisioningState enumerates the values for dsc configuration provisioning state. -type DscConfigurationProvisioningState string - -const ( - // DscConfigurationProvisioningStateSucceeded ... - DscConfigurationProvisioningStateSucceeded DscConfigurationProvisioningState = "Succeeded" -) - -// PossibleDscConfigurationProvisioningStateValues returns an array of possible values for the DscConfigurationProvisioningState const type. -func PossibleDscConfigurationProvisioningStateValues() []DscConfigurationProvisioningState { - return []DscConfigurationProvisioningState{DscConfigurationProvisioningStateSucceeded} -} - -// DscConfigurationState enumerates the values for dsc configuration state. -type DscConfigurationState string - -const ( - // DscConfigurationStateEdit ... - DscConfigurationStateEdit DscConfigurationState = "Edit" - // DscConfigurationStateNew ... - DscConfigurationStateNew DscConfigurationState = "New" - // DscConfigurationStatePublished ... - DscConfigurationStatePublished DscConfigurationState = "Published" -) - -// PossibleDscConfigurationStateValues returns an array of possible values for the DscConfigurationState const type. -func PossibleDscConfigurationStateValues() []DscConfigurationState { - return []DscConfigurationState{DscConfigurationStateEdit, DscConfigurationStateNew, DscConfigurationStatePublished} -} - -// EncryptionKeySourceType enumerates the values for encryption key source type. -type EncryptionKeySourceType string - -const ( - // EncryptionKeySourceTypeMicrosoftAutomation ... - EncryptionKeySourceTypeMicrosoftAutomation EncryptionKeySourceType = "Microsoft.Automation" - // EncryptionKeySourceTypeMicrosoftKeyvault ... - EncryptionKeySourceTypeMicrosoftKeyvault EncryptionKeySourceType = "Microsoft.Keyvault" -) - -// PossibleEncryptionKeySourceTypeValues returns an array of possible values for the EncryptionKeySourceType const type. -func PossibleEncryptionKeySourceTypeValues() []EncryptionKeySourceType { - return []EncryptionKeySourceType{EncryptionKeySourceTypeMicrosoftAutomation, EncryptionKeySourceTypeMicrosoftKeyvault} -} - -// GroupTypeEnum enumerates the values for group type enum. -type GroupTypeEnum string - -const ( - // GroupTypeEnumSystem ... - GroupTypeEnumSystem GroupTypeEnum = "System" - // GroupTypeEnumUser ... - GroupTypeEnumUser GroupTypeEnum = "User" -) - -// PossibleGroupTypeEnumValues returns an array of possible values for the GroupTypeEnum const type. -func PossibleGroupTypeEnumValues() []GroupTypeEnum { - return []GroupTypeEnum{GroupTypeEnumSystem, GroupTypeEnumUser} -} - -// HTTPStatusCode enumerates the values for http status code. -type HTTPStatusCode string - -const ( - // HTTPStatusCodeAccepted ... - HTTPStatusCodeAccepted HTTPStatusCode = "Accepted" - // HTTPStatusCodeAmbiguous ... - HTTPStatusCodeAmbiguous HTTPStatusCode = "Ambiguous" - // HTTPStatusCodeBadGateway ... - HTTPStatusCodeBadGateway HTTPStatusCode = "BadGateway" - // HTTPStatusCodeBadRequest ... - HTTPStatusCodeBadRequest HTTPStatusCode = "BadRequest" - // HTTPStatusCodeConflict ... - HTTPStatusCodeConflict HTTPStatusCode = "Conflict" - // HTTPStatusCodeContinue ... - HTTPStatusCodeContinue HTTPStatusCode = "Continue" - // HTTPStatusCodeCreated ... - HTTPStatusCodeCreated HTTPStatusCode = "Created" - // HTTPStatusCodeExpectationFailed ... - HTTPStatusCodeExpectationFailed HTTPStatusCode = "ExpectationFailed" - // HTTPStatusCodeForbidden ... - HTTPStatusCodeForbidden HTTPStatusCode = "Forbidden" - // HTTPStatusCodeFound ... - HTTPStatusCodeFound HTTPStatusCode = "Found" - // HTTPStatusCodeGatewayTimeout ... - HTTPStatusCodeGatewayTimeout HTTPStatusCode = "GatewayTimeout" - // HTTPStatusCodeGone ... - HTTPStatusCodeGone HTTPStatusCode = "Gone" - // HTTPStatusCodeHTTPVersionNotSupported ... - HTTPStatusCodeHTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" - // HTTPStatusCodeInternalServerError ... - HTTPStatusCodeInternalServerError HTTPStatusCode = "InternalServerError" - // HTTPStatusCodeLengthRequired ... - HTTPStatusCodeLengthRequired HTTPStatusCode = "LengthRequired" - // HTTPStatusCodeMethodNotAllowed ... - HTTPStatusCodeMethodNotAllowed HTTPStatusCode = "MethodNotAllowed" - // HTTPStatusCodeMoved ... - HTTPStatusCodeMoved HTTPStatusCode = "Moved" - // HTTPStatusCodeMovedPermanently ... - HTTPStatusCodeMovedPermanently HTTPStatusCode = "MovedPermanently" - // HTTPStatusCodeMultipleChoices ... - HTTPStatusCodeMultipleChoices HTTPStatusCode = "MultipleChoices" - // HTTPStatusCodeNoContent ... - HTTPStatusCodeNoContent HTTPStatusCode = "NoContent" - // HTTPStatusCodeNonAuthoritativeInformation ... - HTTPStatusCodeNonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" - // HTTPStatusCodeNotAcceptable ... - HTTPStatusCodeNotAcceptable HTTPStatusCode = "NotAcceptable" - // HTTPStatusCodeNotFound ... - HTTPStatusCodeNotFound HTTPStatusCode = "NotFound" - // HTTPStatusCodeNotImplemented ... - HTTPStatusCodeNotImplemented HTTPStatusCode = "NotImplemented" - // HTTPStatusCodeNotModified ... - HTTPStatusCodeNotModified HTTPStatusCode = "NotModified" - // HTTPStatusCodeOK ... - HTTPStatusCodeOK HTTPStatusCode = "OK" - // HTTPStatusCodePartialContent ... - HTTPStatusCodePartialContent HTTPStatusCode = "PartialContent" - // HTTPStatusCodePaymentRequired ... - HTTPStatusCodePaymentRequired HTTPStatusCode = "PaymentRequired" - // HTTPStatusCodePreconditionFailed ... - HTTPStatusCodePreconditionFailed HTTPStatusCode = "PreconditionFailed" - // HTTPStatusCodeProxyAuthenticationRequired ... - HTTPStatusCodeProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" - // HTTPStatusCodeRedirect ... - HTTPStatusCodeRedirect HTTPStatusCode = "Redirect" - // HTTPStatusCodeRedirectKeepVerb ... - HTTPStatusCodeRedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" - // HTTPStatusCodeRedirectMethod ... - HTTPStatusCodeRedirectMethod HTTPStatusCode = "RedirectMethod" - // HTTPStatusCodeRequestedRangeNotSatisfiable ... - HTTPStatusCodeRequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" - // HTTPStatusCodeRequestEntityTooLarge ... - HTTPStatusCodeRequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" - // HTTPStatusCodeRequestTimeout ... - HTTPStatusCodeRequestTimeout HTTPStatusCode = "RequestTimeout" - // HTTPStatusCodeRequestURITooLong ... - HTTPStatusCodeRequestURITooLong HTTPStatusCode = "RequestUriTooLong" - // HTTPStatusCodeResetContent ... - HTTPStatusCodeResetContent HTTPStatusCode = "ResetContent" - // HTTPStatusCodeSeeOther ... - HTTPStatusCodeSeeOther HTTPStatusCode = "SeeOther" - // HTTPStatusCodeServiceUnavailable ... - HTTPStatusCodeServiceUnavailable HTTPStatusCode = "ServiceUnavailable" - // HTTPStatusCodeSwitchingProtocols ... - HTTPStatusCodeSwitchingProtocols HTTPStatusCode = "SwitchingProtocols" - // HTTPStatusCodeTemporaryRedirect ... - HTTPStatusCodeTemporaryRedirect HTTPStatusCode = "TemporaryRedirect" - // HTTPStatusCodeUnauthorized ... - HTTPStatusCodeUnauthorized HTTPStatusCode = "Unauthorized" - // HTTPStatusCodeUnsupportedMediaType ... - HTTPStatusCodeUnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" - // HTTPStatusCodeUnused ... - HTTPStatusCodeUnused HTTPStatusCode = "Unused" - // HTTPStatusCodeUpgradeRequired ... - HTTPStatusCodeUpgradeRequired HTTPStatusCode = "UpgradeRequired" - // HTTPStatusCodeUseProxy ... - HTTPStatusCodeUseProxy HTTPStatusCode = "UseProxy" -) - -// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. -func PossibleHTTPStatusCodeValues() []HTTPStatusCode { - return []HTTPStatusCode{HTTPStatusCodeAccepted, HTTPStatusCodeAmbiguous, HTTPStatusCodeBadGateway, HTTPStatusCodeBadRequest, HTTPStatusCodeConflict, HTTPStatusCodeContinue, HTTPStatusCodeCreated, HTTPStatusCodeExpectationFailed, HTTPStatusCodeForbidden, HTTPStatusCodeFound, HTTPStatusCodeGatewayTimeout, HTTPStatusCodeGone, HTTPStatusCodeHTTPVersionNotSupported, HTTPStatusCodeInternalServerError, HTTPStatusCodeLengthRequired, HTTPStatusCodeMethodNotAllowed, HTTPStatusCodeMoved, HTTPStatusCodeMovedPermanently, HTTPStatusCodeMultipleChoices, HTTPStatusCodeNoContent, HTTPStatusCodeNonAuthoritativeInformation, HTTPStatusCodeNotAcceptable, HTTPStatusCodeNotFound, HTTPStatusCodeNotImplemented, HTTPStatusCodeNotModified, HTTPStatusCodeOK, HTTPStatusCodePartialContent, HTTPStatusCodePaymentRequired, HTTPStatusCodePreconditionFailed, HTTPStatusCodeProxyAuthenticationRequired, HTTPStatusCodeRedirect, HTTPStatusCodeRedirectKeepVerb, HTTPStatusCodeRedirectMethod, HTTPStatusCodeRequestedRangeNotSatisfiable, HTTPStatusCodeRequestEntityTooLarge, HTTPStatusCodeRequestTimeout, HTTPStatusCodeRequestURITooLong, HTTPStatusCodeResetContent, HTTPStatusCodeSeeOther, HTTPStatusCodeServiceUnavailable, HTTPStatusCodeSwitchingProtocols, HTTPStatusCodeTemporaryRedirect, HTTPStatusCodeUnauthorized, HTTPStatusCodeUnsupportedMediaType, HTTPStatusCodeUnused, HTTPStatusCodeUpgradeRequired, HTTPStatusCodeUseProxy} -} - -// JobProvisioningState enumerates the values for job provisioning state. -type JobProvisioningState string - -const ( - // JobProvisioningStateFailed ... - JobProvisioningStateFailed JobProvisioningState = "Failed" - // JobProvisioningStateProcessing ... - JobProvisioningStateProcessing JobProvisioningState = "Processing" - // JobProvisioningStateSucceeded ... - JobProvisioningStateSucceeded JobProvisioningState = "Succeeded" - // JobProvisioningStateSuspended ... - JobProvisioningStateSuspended JobProvisioningState = "Suspended" -) - -// PossibleJobProvisioningStateValues returns an array of possible values for the JobProvisioningState const type. -func PossibleJobProvisioningStateValues() []JobProvisioningState { - return []JobProvisioningState{JobProvisioningStateFailed, JobProvisioningStateProcessing, JobProvisioningStateSucceeded, JobProvisioningStateSuspended} -} - -// JobStatus enumerates the values for job status. -type JobStatus string - -const ( - // JobStatusActivating ... - JobStatusActivating JobStatus = "Activating" - // JobStatusBlocked ... - JobStatusBlocked JobStatus = "Blocked" - // JobStatusCompleted ... - JobStatusCompleted JobStatus = "Completed" - // JobStatusDisconnected ... - JobStatusDisconnected JobStatus = "Disconnected" - // JobStatusFailed ... - JobStatusFailed JobStatus = "Failed" - // JobStatusNew ... - JobStatusNew JobStatus = "New" - // JobStatusRemoving ... - JobStatusRemoving JobStatus = "Removing" - // JobStatusResuming ... - JobStatusResuming JobStatus = "Resuming" - // JobStatusRunning ... - JobStatusRunning JobStatus = "Running" - // JobStatusStopped ... - JobStatusStopped JobStatus = "Stopped" - // JobStatusStopping ... - JobStatusStopping JobStatus = "Stopping" - // JobStatusSuspended ... - JobStatusSuspended JobStatus = "Suspended" - // JobStatusSuspending ... - JobStatusSuspending JobStatus = "Suspending" -) - -// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. -func PossibleJobStatusValues() []JobStatus { - return []JobStatus{JobStatusActivating, JobStatusBlocked, JobStatusCompleted, JobStatusDisconnected, JobStatusFailed, JobStatusNew, JobStatusRemoving, JobStatusResuming, JobStatusRunning, JobStatusStopped, JobStatusStopping, JobStatusSuspended, JobStatusSuspending} -} - -// JobStreamType enumerates the values for job stream type. -type JobStreamType string - -const ( - // JobStreamTypeAny ... - JobStreamTypeAny JobStreamType = "Any" - // JobStreamTypeDebug ... - JobStreamTypeDebug JobStreamType = "Debug" - // JobStreamTypeError ... - JobStreamTypeError JobStreamType = "Error" - // JobStreamTypeOutput ... - JobStreamTypeOutput JobStreamType = "Output" - // JobStreamTypeProgress ... - JobStreamTypeProgress JobStreamType = "Progress" - // JobStreamTypeVerbose ... - JobStreamTypeVerbose JobStreamType = "Verbose" - // JobStreamTypeWarning ... - JobStreamTypeWarning JobStreamType = "Warning" -) - -// PossibleJobStreamTypeValues returns an array of possible values for the JobStreamType const type. -func PossibleJobStreamTypeValues() []JobStreamType { - return []JobStreamType{JobStreamTypeAny, JobStreamTypeDebug, JobStreamTypeError, JobStreamTypeOutput, JobStreamTypeProgress, JobStreamTypeVerbose, JobStreamTypeWarning} -} - -// KeyName enumerates the values for key name. -type KeyName string - -const ( - // KeyNamePrimary ... - KeyNamePrimary KeyName = "Primary" - // KeyNameSecondary ... - KeyNameSecondary KeyName = "Secondary" -) - -// PossibleKeyNameValues returns an array of possible values for the KeyName const type. -func PossibleKeyNameValues() []KeyName { - return []KeyName{KeyNamePrimary, KeyNameSecondary} -} - -// KeyPermissions enumerates the values for key permissions. -type KeyPermissions string - -const ( - // KeyPermissionsFull ... - KeyPermissionsFull KeyPermissions = "Full" - // KeyPermissionsRead ... - KeyPermissionsRead KeyPermissions = "Read" -) - -// PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. -func PossibleKeyPermissionsValues() []KeyPermissions { - return []KeyPermissions{KeyPermissionsFull, KeyPermissionsRead} -} - -// LinuxUpdateClasses enumerates the values for linux update classes. -type LinuxUpdateClasses string - -const ( - // LinuxUpdateClassesCritical ... - LinuxUpdateClassesCritical LinuxUpdateClasses = "Critical" - // LinuxUpdateClassesOther ... - LinuxUpdateClassesOther LinuxUpdateClasses = "Other" - // LinuxUpdateClassesSecurity ... - LinuxUpdateClassesSecurity LinuxUpdateClasses = "Security" - // LinuxUpdateClassesUnclassified ... - LinuxUpdateClassesUnclassified LinuxUpdateClasses = "Unclassified" -) - -// PossibleLinuxUpdateClassesValues returns an array of possible values for the LinuxUpdateClasses const type. -func PossibleLinuxUpdateClassesValues() []LinuxUpdateClasses { - return []LinuxUpdateClasses{LinuxUpdateClassesCritical, LinuxUpdateClassesOther, LinuxUpdateClassesSecurity, LinuxUpdateClassesUnclassified} -} - -// ModuleProvisioningState enumerates the values for module provisioning state. -type ModuleProvisioningState string - -const ( - // ModuleProvisioningStateActivitiesStored ... - ModuleProvisioningStateActivitiesStored ModuleProvisioningState = "ActivitiesStored" - // ModuleProvisioningStateCancelled ... - ModuleProvisioningStateCancelled ModuleProvisioningState = "Cancelled" - // ModuleProvisioningStateConnectionTypeImported ... - ModuleProvisioningStateConnectionTypeImported ModuleProvisioningState = "ConnectionTypeImported" - // ModuleProvisioningStateContentDownloaded ... - ModuleProvisioningStateContentDownloaded ModuleProvisioningState = "ContentDownloaded" - // ModuleProvisioningStateContentRetrieved ... - ModuleProvisioningStateContentRetrieved ModuleProvisioningState = "ContentRetrieved" - // ModuleProvisioningStateContentStored ... - ModuleProvisioningStateContentStored ModuleProvisioningState = "ContentStored" - // ModuleProvisioningStateContentValidated ... - ModuleProvisioningStateContentValidated ModuleProvisioningState = "ContentValidated" - // ModuleProvisioningStateCreated ... - ModuleProvisioningStateCreated ModuleProvisioningState = "Created" - // ModuleProvisioningStateCreating ... - ModuleProvisioningStateCreating ModuleProvisioningState = "Creating" - // ModuleProvisioningStateFailed ... - ModuleProvisioningStateFailed ModuleProvisioningState = "Failed" - // ModuleProvisioningStateModuleDataStored ... - ModuleProvisioningStateModuleDataStored ModuleProvisioningState = "ModuleDataStored" - // ModuleProvisioningStateModuleImportRunbookComplete ... - ModuleProvisioningStateModuleImportRunbookComplete ModuleProvisioningState = "ModuleImportRunbookComplete" - // ModuleProvisioningStateRunningImportModuleRunbook ... - ModuleProvisioningStateRunningImportModuleRunbook ModuleProvisioningState = "RunningImportModuleRunbook" - // ModuleProvisioningStateStartingImportModuleRunbook ... - ModuleProvisioningStateStartingImportModuleRunbook ModuleProvisioningState = "StartingImportModuleRunbook" - // ModuleProvisioningStateSucceeded ... - ModuleProvisioningStateSucceeded ModuleProvisioningState = "Succeeded" - // ModuleProvisioningStateUpdating ... - ModuleProvisioningStateUpdating ModuleProvisioningState = "Updating" -) - -// PossibleModuleProvisioningStateValues returns an array of possible values for the ModuleProvisioningState const type. -func PossibleModuleProvisioningStateValues() []ModuleProvisioningState { - return []ModuleProvisioningState{ModuleProvisioningStateActivitiesStored, ModuleProvisioningStateCancelled, ModuleProvisioningStateConnectionTypeImported, ModuleProvisioningStateContentDownloaded, ModuleProvisioningStateContentRetrieved, ModuleProvisioningStateContentStored, ModuleProvisioningStateContentValidated, ModuleProvisioningStateCreated, ModuleProvisioningStateCreating, ModuleProvisioningStateFailed, ModuleProvisioningStateModuleDataStored, ModuleProvisioningStateModuleImportRunbookComplete, ModuleProvisioningStateRunningImportModuleRunbook, ModuleProvisioningStateStartingImportModuleRunbook, ModuleProvisioningStateSucceeded, ModuleProvisioningStateUpdating} -} - -// OperatingSystemType enumerates the values for operating system type. -type OperatingSystemType string - -const ( - // OperatingSystemTypeLinux ... - OperatingSystemTypeLinux OperatingSystemType = "Linux" - // OperatingSystemTypeWindows ... - OperatingSystemTypeWindows OperatingSystemType = "Windows" -) - -// PossibleOperatingSystemTypeValues returns an array of possible values for the OperatingSystemType const type. -func PossibleOperatingSystemTypeValues() []OperatingSystemType { - return []OperatingSystemType{OperatingSystemTypeLinux, OperatingSystemTypeWindows} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // ProvisioningStateCompleted ... - ProvisioningStateCompleted ProvisioningState = "Completed" - // ProvisioningStateFailed ... - ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateRunning ... - ProvisioningStateRunning ProvisioningState = "Running" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ProvisioningStateCompleted, ProvisioningStateFailed, ProvisioningStateRunning} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// RunbookProvisioningState enumerates the values for runbook provisioning state. -type RunbookProvisioningState string - -const ( - // RunbookProvisioningStateSucceeded ... - RunbookProvisioningStateSucceeded RunbookProvisioningState = "Succeeded" -) - -// PossibleRunbookProvisioningStateValues returns an array of possible values for the RunbookProvisioningState const type. -func PossibleRunbookProvisioningStateValues() []RunbookProvisioningState { - return []RunbookProvisioningState{RunbookProvisioningStateSucceeded} -} - -// RunbookState enumerates the values for runbook state. -type RunbookState string - -const ( - // RunbookStateEdit ... - RunbookStateEdit RunbookState = "Edit" - // RunbookStateNew ... - RunbookStateNew RunbookState = "New" - // RunbookStatePublished ... - RunbookStatePublished RunbookState = "Published" -) - -// PossibleRunbookStateValues returns an array of possible values for the RunbookState const type. -func PossibleRunbookStateValues() []RunbookState { - return []RunbookState{RunbookStateEdit, RunbookStateNew, RunbookStatePublished} -} - -// RunbookTypeEnum enumerates the values for runbook type enum. -type RunbookTypeEnum string - -const ( - // RunbookTypeEnumGraph ... - RunbookTypeEnumGraph RunbookTypeEnum = "Graph" - // RunbookTypeEnumGraphPowerShell ... - RunbookTypeEnumGraphPowerShell RunbookTypeEnum = "GraphPowerShell" - // RunbookTypeEnumGraphPowerShellWorkflow ... - RunbookTypeEnumGraphPowerShellWorkflow RunbookTypeEnum = "GraphPowerShellWorkflow" - // RunbookTypeEnumPowerShell ... - RunbookTypeEnumPowerShell RunbookTypeEnum = "PowerShell" - // RunbookTypeEnumPowerShellWorkflow ... - RunbookTypeEnumPowerShellWorkflow RunbookTypeEnum = "PowerShellWorkflow" - // RunbookTypeEnumScript ... - RunbookTypeEnumScript RunbookTypeEnum = "Script" -) - -// PossibleRunbookTypeEnumValues returns an array of possible values for the RunbookTypeEnum const type. -func PossibleRunbookTypeEnumValues() []RunbookTypeEnum { - return []RunbookTypeEnum{RunbookTypeEnumGraph, RunbookTypeEnumGraphPowerShell, RunbookTypeEnumGraphPowerShellWorkflow, RunbookTypeEnumPowerShell, RunbookTypeEnumPowerShellWorkflow, RunbookTypeEnumScript} -} - -// ScheduleDay enumerates the values for schedule day. -type ScheduleDay string - -const ( - // ScheduleDayFriday ... - ScheduleDayFriday ScheduleDay = "Friday" - // ScheduleDayMonday ... - ScheduleDayMonday ScheduleDay = "Monday" - // ScheduleDaySaturday ... - ScheduleDaySaturday ScheduleDay = "Saturday" - // ScheduleDaySunday ... - ScheduleDaySunday ScheduleDay = "Sunday" - // ScheduleDayThursday ... - ScheduleDayThursday ScheduleDay = "Thursday" - // ScheduleDayTuesday ... - ScheduleDayTuesday ScheduleDay = "Tuesday" - // ScheduleDayWednesday ... - ScheduleDayWednesday ScheduleDay = "Wednesday" -) - -// PossibleScheduleDayValues returns an array of possible values for the ScheduleDay const type. -func PossibleScheduleDayValues() []ScheduleDay { - return []ScheduleDay{ScheduleDayFriday, ScheduleDayMonday, ScheduleDaySaturday, ScheduleDaySunday, ScheduleDayThursday, ScheduleDayTuesday, ScheduleDayWednesday} -} - -// ScheduleFrequency enumerates the values for schedule frequency. -type ScheduleFrequency string - -const ( - // ScheduleFrequencyDay ... - ScheduleFrequencyDay ScheduleFrequency = "Day" - // ScheduleFrequencyHour ... - ScheduleFrequencyHour ScheduleFrequency = "Hour" - // ScheduleFrequencyMinute The minimum allowed interval for Minute schedules is 15 minutes. - ScheduleFrequencyMinute ScheduleFrequency = "Minute" - // ScheduleFrequencyMonth ... - ScheduleFrequencyMonth ScheduleFrequency = "Month" - // ScheduleFrequencyOneTime ... - ScheduleFrequencyOneTime ScheduleFrequency = "OneTime" - // ScheduleFrequencyWeek ... - ScheduleFrequencyWeek ScheduleFrequency = "Week" -) - -// PossibleScheduleFrequencyValues returns an array of possible values for the ScheduleFrequency const type. -func PossibleScheduleFrequencyValues() []ScheduleFrequency { - return []ScheduleFrequency{ScheduleFrequencyDay, ScheduleFrequencyHour, ScheduleFrequencyMinute, ScheduleFrequencyMonth, ScheduleFrequencyOneTime, ScheduleFrequencyWeek} -} - -// SkuNameEnum enumerates the values for sku name enum. -type SkuNameEnum string - -const ( - // SkuNameEnumBasic ... - SkuNameEnumBasic SkuNameEnum = "Basic" - // SkuNameEnumFree ... - SkuNameEnumFree SkuNameEnum = "Free" -) - -// PossibleSkuNameEnumValues returns an array of possible values for the SkuNameEnum const type. -func PossibleSkuNameEnumValues() []SkuNameEnum { - return []SkuNameEnum{SkuNameEnumBasic, SkuNameEnumFree} -} - -// SourceType enumerates the values for source type. -type SourceType string - -const ( - // SourceTypeGitHub ... - SourceTypeGitHub SourceType = "GitHub" - // SourceTypeVsoGit ... - SourceTypeVsoGit SourceType = "VsoGit" - // SourceTypeVsoTfvc ... - SourceTypeVsoTfvc SourceType = "VsoTfvc" -) - -// PossibleSourceTypeValues returns an array of possible values for the SourceType const type. -func PossibleSourceTypeValues() []SourceType { - return []SourceType{SourceTypeGitHub, SourceTypeVsoGit, SourceTypeVsoTfvc} -} - -// StreamType enumerates the values for stream type. -type StreamType string - -const ( - // StreamTypeError ... - StreamTypeError StreamType = "Error" - // StreamTypeOutput ... - StreamTypeOutput StreamType = "Output" -) - -// PossibleStreamTypeValues returns an array of possible values for the StreamType const type. -func PossibleStreamTypeValues() []StreamType { - return []StreamType{StreamTypeError, StreamTypeOutput} -} - -// SyncType enumerates the values for sync type. -type SyncType string - -const ( - // SyncTypeFullSync ... - SyncTypeFullSync SyncType = "FullSync" - // SyncTypePartialSync ... - SyncTypePartialSync SyncType = "PartialSync" -) - -// PossibleSyncTypeValues returns an array of possible values for the SyncType const type. -func PossibleSyncTypeValues() []SyncType { - return []SyncType{SyncTypeFullSync, SyncTypePartialSync} -} - -// TagOperators enumerates the values for tag operators. -type TagOperators string - -const ( - // TagOperatorsAll ... - TagOperatorsAll TagOperators = "All" - // TagOperatorsAny ... - TagOperatorsAny TagOperators = "Any" -) - -// PossibleTagOperatorsValues returns an array of possible values for the TagOperators const type. -func PossibleTagOperatorsValues() []TagOperators { - return []TagOperators{TagOperatorsAll, TagOperatorsAny} -} - -// TokenType enumerates the values for token type. -type TokenType string - -const ( - // TokenTypeOauth ... - TokenTypeOauth TokenType = "Oauth" - // TokenTypePersonalAccessToken ... - TokenTypePersonalAccessToken TokenType = "PersonalAccessToken" -) - -// PossibleTokenTypeValues returns an array of possible values for the TokenType const type. -func PossibleTokenTypeValues() []TokenType { - return []TokenType{TokenTypeOauth, TokenTypePersonalAccessToken} -} - -// WindowsUpdateClasses enumerates the values for windows update classes. -type WindowsUpdateClasses string - -const ( - // WindowsUpdateClassesCritical ... - WindowsUpdateClassesCritical WindowsUpdateClasses = "Critical" - // WindowsUpdateClassesDefinition ... - WindowsUpdateClassesDefinition WindowsUpdateClasses = "Definition" - // WindowsUpdateClassesFeaturePack ... - WindowsUpdateClassesFeaturePack WindowsUpdateClasses = "FeaturePack" - // WindowsUpdateClassesSecurity ... - WindowsUpdateClassesSecurity WindowsUpdateClasses = "Security" - // WindowsUpdateClassesServicePack ... - WindowsUpdateClassesServicePack WindowsUpdateClasses = "ServicePack" - // WindowsUpdateClassesTools ... - WindowsUpdateClassesTools WindowsUpdateClasses = "Tools" - // WindowsUpdateClassesUnclassified ... - WindowsUpdateClassesUnclassified WindowsUpdateClasses = "Unclassified" - // WindowsUpdateClassesUpdateRollup ... - WindowsUpdateClassesUpdateRollup WindowsUpdateClasses = "UpdateRollup" - // WindowsUpdateClassesUpdates ... - WindowsUpdateClassesUpdates WindowsUpdateClasses = "Updates" -) - -// PossibleWindowsUpdateClassesValues returns an array of possible values for the WindowsUpdateClasses const type. -func PossibleWindowsUpdateClassesValues() []WindowsUpdateClasses { - return []WindowsUpdateClasses{WindowsUpdateClassesCritical, WindowsUpdateClassesDefinition, WindowsUpdateClassesFeaturePack, WindowsUpdateClassesSecurity, WindowsUpdateClassesServicePack, WindowsUpdateClassesTools, WindowsUpdateClassesUnclassified, WindowsUpdateClassesUpdateRollup, WindowsUpdateClassesUpdates} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/fields.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/fields.go deleted file mode 100644 index 4449cca1223a..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/fields.go +++ /dev/null @@ -1,120 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FieldsClient is the automation Client -type FieldsClient struct { - BaseClient -} - -// NewFieldsClient creates an instance of the FieldsClient client. -func NewFieldsClient(subscriptionID string) FieldsClient { - return NewFieldsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFieldsClientWithBaseURI creates an instance of the FieldsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewFieldsClientWithBaseURI(baseURI string, subscriptionID string) FieldsClient { - return FieldsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByType retrieve a list of fields of a given type identified by module name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// moduleName - the name of module. -// typeName - the name of type. -func (client FieldsClient) ListByType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FieldsClient.ListByType") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.FieldsClient", "ListByType", err.Error()) - } - - req, err := client.ListByTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", nil, "Failure preparing request") - return - } - - resp, err := client.ListByTypeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", resp, "Failure sending request") - return - } - - result, err = client.ListByTypeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", resp, "Failure responding to request") - return - } - - return -} - -// ListByTypePreparer prepares the ListByType request. -func (client FieldsClient) ListByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "typeName": autorest.Encode("path", typeName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByTypeSender sends the ListByType request. The method will close the -// http.Response Body if it receives an error. -func (client FieldsClient) ListByTypeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByTypeResponder handles the response to the ListByType request. The method always -// closes the http.Response Body. -func (client FieldsClient) ListByTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/hybridrunbookworkergroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/hybridrunbookworkergroup.go deleted file mode 100644 index 7b16755ccbc8..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/hybridrunbookworkergroup.go +++ /dev/null @@ -1,423 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// HybridRunbookWorkerGroupClient is the automation Client -type HybridRunbookWorkerGroupClient struct { - BaseClient -} - -// NewHybridRunbookWorkerGroupClient creates an instance of the HybridRunbookWorkerGroupClient client. -func NewHybridRunbookWorkerGroupClient(subscriptionID string) HybridRunbookWorkerGroupClient { - return NewHybridRunbookWorkerGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewHybridRunbookWorkerGroupClientWithBaseURI creates an instance of the HybridRunbookWorkerGroupClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID string) HybridRunbookWorkerGroupClient { - return HybridRunbookWorkerGroupClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete delete a hybrid runbook worker group. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// hybridRunbookWorkerGroupName - the hybrid runbook worker group name -func (client HybridRunbookWorkerGroupClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client HybridRunbookWorkerGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client HybridRunbookWorkerGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client HybridRunbookWorkerGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve a hybrid runbook worker group. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// hybridRunbookWorkerGroupName - the hybrid runbook worker group name -func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result HybridRunbookWorkerGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client HybridRunbookWorkerGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client HybridRunbookWorkerGroupClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client HybridRunbookWorkerGroupClient) GetResponder(resp *http.Response) (result HybridRunbookWorkerGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of hybrid runbook worker groups. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result HybridRunbookWorkerGroupsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.hrwglr.Response.Response != nil { - sc = result.hrwglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.hrwglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.hrwglr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.hrwglr.hasNextLink() && result.hrwglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountResponder(resp *http.Response) (result HybridRunbookWorkerGroupsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client HybridRunbookWorkerGroupClient) listByAutomationAccountNextResults(ctx context.Context, lastResults HybridRunbookWorkerGroupsListResult) (result HybridRunbookWorkerGroupsListResult, err error) { - req, err := lastResults.hybridRunbookWorkerGroupsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result HybridRunbookWorkerGroupsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) - return -} - -// Update update a hybrid runbook worker group. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// hybridRunbookWorkerGroupName - the hybrid runbook worker group name -// parameters - the hybrid runbook worker group -func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (result HybridRunbookWorkerGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client HybridRunbookWorkerGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client HybridRunbookWorkerGroupClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client HybridRunbookWorkerGroupClient) UpdateResponder(resp *http.Response) (result HybridRunbookWorkerGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/job.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/job.go deleted file mode 100644 index 9132caff3ff2..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/job.go +++ /dev/null @@ -1,806 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// JobClient is the automation Client -type JobClient struct { - BaseClient -} - -// NewJobClient creates an instance of the JobClient client. -func NewJobClient(subscriptionID string) JobClient { - return NewJobClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobClientWithBaseURI creates an instance of the JobClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewJobClientWithBaseURI(baseURI string, subscriptionID string) JobClient { - return JobClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create a job of the runbook. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobName - the job name. -// parameters - the parameters supplied to the create job operation. -// clientRequestID - identifies this specific client request. -func (client JobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, parameters JobCreateParameters, clientRequestID string) (result Job, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.JobCreateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobName, parameters, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client JobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, parameters JobCreateParameters, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client JobClient) CreateResponder(resp *http.Response) (result Job, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieve the job identified by job name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobName - the job name. -// clientRequestID - identifies this specific client request. -func (client JobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result Job, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client JobClient) GetResponder(resp *http.Response) (result Job, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetOutput retrieve the job output identified by job name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobName - the name of the job to be created. -// clientRequestID - identifies this specific client request. -func (client JobClient) GetOutput(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result String, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.GetOutput") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobClient", "GetOutput", err.Error()) - } - - req, err := client.GetOutputPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", nil, "Failure preparing request") - return - } - - resp, err := client.GetOutputSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", resp, "Failure sending request") - return - } - - result, err = client.GetOutputResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", resp, "Failure responding to request") - return - } - - return -} - -// GetOutputPreparer prepares the GetOutput request. -func (client JobClient) GetOutputPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/output", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOutputSender sends the GetOutput request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetOutputSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetOutputResponder handles the response to the GetOutput request. The method always -// closes the http.Response Body. -func (client JobClient) GetOutputResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRunbookContent retrieve the runbook content of the job identified by job name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobName - the job name. -// clientRequestID - identifies this specific client request. -func (client JobClient) GetRunbookContent(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result String, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.GetRunbookContent") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobClient", "GetRunbookContent", err.Error()) - } - - req, err := client.GetRunbookContentPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", nil, "Failure preparing request") - return - } - - resp, err := client.GetRunbookContentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", resp, "Failure sending request") - return - } - - result, err = client.GetRunbookContentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", resp, "Failure responding to request") - return - } - - return -} - -// GetRunbookContentPreparer prepares the GetRunbookContent request. -func (client JobClient) GetRunbookContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/runbookContent", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRunbookContentSender sends the GetRunbookContent request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) GetRunbookContentSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetRunbookContentResponder handles the response to the GetRunbookContent request. The method always -// closes the http.Response Body. -func (client JobClient) GetRunbookContentResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of jobs. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -// clientRequestID - identifies this specific client request. -func (client JobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (result JobListResultV2Page, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.jlrv.Response.Response != nil { - sc = result.jlrv.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.jlrv.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.jlrv, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.jlrv.hasNextLink() && result.jlrv.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client JobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client JobClient) ListByAutomationAccountResponder(resp *http.Response) (result JobListResultV2, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client JobClient) listByAutomationAccountNextResults(ctx context.Context, lastResults JobListResultV2) (result JobListResultV2, err error) { - req, err := lastResults.jobListResultV2Preparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (result JobListResultV2Iterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, clientRequestID) - return -} - -// Resume resume the job identified by jobName. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobName - the job name. -// clientRequestID - identifies this specific client request. -func (client JobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.Resume") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobClient", "Resume", err.Error()) - } - - req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", nil, "Failure preparing request") - return - } - - resp, err := client.ResumeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", resp, "Failure sending request") - return - } - - result, err = client.ResumeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", resp, "Failure responding to request") - return - } - - return -} - -// ResumePreparer prepares the Resume request. -func (client JobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/resume", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResumeSender sends the Resume request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) ResumeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ResumeResponder handles the response to the Resume request. The method always -// closes the http.Response Body. -func (client JobClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Stop stop the job identified by jobName. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobName - the job name. -// clientRequestID - identifies this specific client request. -func (client JobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.Stop") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobClient", "Stop", err.Error()) - } - - req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", nil, "Failure preparing request") - return - } - - resp, err := client.StopSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", resp, "Failure sending request") - return - } - - result, err = client.StopResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", resp, "Failure responding to request") - return - } - - return -} - -// StopPreparer prepares the Stop request. -func (client JobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/stop", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopSender sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) StopSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// StopResponder handles the response to the Stop request. The method always -// closes the http.Response Body. -func (client JobClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Suspend suspend the job identified by job name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobName - the job name. -// clientRequestID - identifies this specific client request. -func (client JobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.Suspend") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobClient", "Suspend", err.Error()) - } - - req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", nil, "Failure preparing request") - return - } - - resp, err := client.SuspendSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", resp, "Failure sending request") - return - } - - result, err = client.SuspendResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", resp, "Failure responding to request") - return - } - - return -} - -// SuspendPreparer prepares the Suspend request. -func (client JobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/suspend", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SuspendSender sends the Suspend request. The method will close the -// http.Response Body if it receives an error. -func (client JobClient) SuspendSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SuspendResponder handles the response to the Suspend request. The method always -// closes the http.Response Body. -func (client JobClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/jobschedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/jobschedule.go deleted file mode 100644 index 9ec4c2662a71..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/jobschedule.go +++ /dev/null @@ -1,428 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "github.com/gofrs/uuid" - "net/http" -) - -// JobScheduleClient is the automation Client -type JobScheduleClient struct { - BaseClient -} - -// NewJobScheduleClient creates an instance of the JobScheduleClient client. -func NewJobScheduleClient(subscriptionID string) JobScheduleClient { - return NewJobScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewJobScheduleClientWithBaseURI(baseURI string, subscriptionID string) JobScheduleClient { - return JobScheduleClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create a job schedule. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobScheduleID - the job schedule name. -// parameters - the parameters supplied to the create job schedule operation. -func (client JobScheduleClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (result JobSchedule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties.Schedule", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.JobScheduleCreateProperties.Runbook", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("automation.JobScheduleClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client JobScheduleClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobScheduleId": autorest.Encode("path", jobScheduleID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) CreateResponder(resp *http.Response) (result JobSchedule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the job schedule identified by job schedule name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobScheduleID - the job schedule name. -func (client JobScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobScheduleClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client JobScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobScheduleId": autorest.Encode("path", jobScheduleID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the job schedule identified by job schedule name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobScheduleID - the job schedule name. -func (client JobScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result JobSchedule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobScheduleClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobScheduleId": autorest.Encode("path", jobScheduleID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) GetResponder(resp *http.Response) (result JobSchedule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of job schedules. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobScheduleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.jslr.Response.Response != nil { - sc = result.jslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobScheduleClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.jslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.jslr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.jslr.hasNextLink() && result.jslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client JobScheduleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client JobScheduleClient) ListByAutomationAccountResponder(resp *http.Response) (result JobScheduleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client JobScheduleClient) listByAutomationAccountNextResults(ctx context.Context, lastResults JobScheduleListResult) (result JobScheduleListResult, err error) { - req, err := lastResults.jobScheduleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobScheduleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/jobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/jobstream.go deleted file mode 100644 index 5b38cc41c429..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/jobstream.go +++ /dev/null @@ -1,262 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// JobStreamClient is the automation Client -type JobStreamClient struct { - BaseClient -} - -// NewJobStreamClient creates an instance of the JobStreamClient client. -func NewJobStreamClient(subscriptionID string) JobStreamClient { - return NewJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewJobStreamClientWithBaseURI creates an instance of the JobStreamClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewJobStreamClientWithBaseURI(baseURI string, subscriptionID string) JobStreamClient { - return JobStreamClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve the job stream identified by job stream id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobName - the job name. -// jobStreamID - the job stream id. -// clientRequestID - identifies this specific client request. -func (client JobStreamClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, jobStreamID string, clientRequestID string) (result JobStream, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobStreamClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobName, jobStreamID, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client JobStreamClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, jobStreamID string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobName": autorest.Encode("path", jobName), - "jobStreamId": autorest.Encode("path", jobStreamID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams/{jobStreamId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client JobStreamClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client JobStreamClient) GetResponder(resp *http.Response) (result JobStream, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByJob retrieve a list of jobs streams identified by job name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// jobName - the job name. -// filter - the filter to apply on the operation. -// clientRequestID - identifies this specific client request. -func (client JobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (result JobStreamListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamClient.ListByJob") - defer func() { - sc := -1 - if result.jslr.Response.Response != nil { - sc = result.jslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.JobStreamClient", "ListByJob", err.Error()) - } - - result.fn = client.listByJobNextResults - req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobName, filter, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", nil, "Failure preparing request") - return - } - - resp, err := client.ListByJobSender(req) - if err != nil { - result.jslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", resp, "Failure sending request") - return - } - - result.jslr, err = client.ListByJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", resp, "Failure responding to request") - return - } - if result.jslr.hasNextLink() && result.jslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByJobPreparer prepares the ListByJob request. -func (client JobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByJobSender sends the ListByJob request. The method will close the -// http.Response Body if it receives an error. -func (client JobStreamClient) ListByJobSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByJobResponder handles the response to the ListByJob request. The method always -// closes the http.Response Body. -func (client JobStreamClient) ListByJobResponder(resp *http.Response) (result JobStreamListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByJobNextResults retrieves the next set of results, if any. -func (client JobStreamClient) listByJobNextResults(ctx context.Context, lastResults JobStreamListResult) (result JobStreamListResult, err error) { - req, err := lastResults.jobStreamListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByJobSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByJobComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobStreamClient) ListByJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (result JobStreamListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamClient.ListByJob") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByJob(ctx, resourceGroupName, automationAccountName, jobName, filter, clientRequestID) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/keys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/keys.go deleted file mode 100644 index 5a803e6fb720..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/keys.go +++ /dev/null @@ -1,116 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// KeysClient is the automation Client -type KeysClient struct { - BaseClient -} - -// NewKeysClient creates an instance of the KeysClient client. -func NewKeysClient(subscriptionID string) KeysClient { - return NewKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewKeysClientWithBaseURI creates an instance of the KeysClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewKeysClientWithBaseURI(baseURI string, subscriptionID string) KeysClient { - return KeysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByAutomationAccount retrieve the automation keys for an account. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client KeysClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result KeyListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/KeysClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.KeysClient", "ListByAutomationAccount", err.Error()) - } - - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client KeysClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client KeysClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client KeysClient) ListByAutomationAccountResponder(resp *http.Response) (result KeyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/linkedworkspace.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/linkedworkspace.go deleted file mode 100644 index ad81f93bc941..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/linkedworkspace.go +++ /dev/null @@ -1,116 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LinkedWorkspaceClient is the automation Client -type LinkedWorkspaceClient struct { - BaseClient -} - -// NewLinkedWorkspaceClient creates an instance of the LinkedWorkspaceClient client. -func NewLinkedWorkspaceClient(subscriptionID string) LinkedWorkspaceClient { - return NewLinkedWorkspaceClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLinkedWorkspaceClientWithBaseURI creates an instance of the LinkedWorkspaceClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLinkedWorkspaceClientWithBaseURI(baseURI string, subscriptionID string) LinkedWorkspaceClient { - return LinkedWorkspaceClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve the linked workspace for the account id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client LinkedWorkspaceClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result LinkedWorkspace, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LinkedWorkspaceClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.LinkedWorkspaceClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LinkedWorkspaceClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LinkedWorkspaceClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LinkedWorkspaceClient) GetResponder(resp *http.Response) (result LinkedWorkspace, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/models.go deleted file mode 100644 index c0d324c7a303..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/models.go +++ /dev/null @@ -1,11239 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "github.com/gofrs/uuid" - "io" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" - -// Account definition of the automation account type. -type Account struct { - autorest.Response `json:"-"` - // AccountProperties - Gets or sets the automation account properties. - *AccountProperties `json:"properties,omitempty"` - // Etag - Gets or sets the etag of the resource. - Etag *string `json:"etag,omitempty"` - Identity *Identity `json:"identity,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The Azure Region where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Account. -func (a Account) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.AccountProperties != nil { - objectMap["properties"] = a.AccountProperties - } - if a.Etag != nil { - objectMap["etag"] = a.Etag - } - if a.Identity != nil { - objectMap["identity"] = a.Identity - } - if a.Tags != nil { - objectMap["tags"] = a.Tags - } - if a.Location != nil { - objectMap["location"] = a.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Account struct. -func (a *Account) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var accountProperties AccountProperties - err = json.Unmarshal(*v, &accountProperties) - if err != nil { - return err - } - a.AccountProperties = &accountProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - a.Etag = &etag - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - a.Identity = &identity - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - a.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - a.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - a.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - a.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - a.Type = &typeVar - } - } - } - - return nil -} - -// AccountCreateOrUpdateParameters the parameters supplied to the create or update automation account -// operation. -type AccountCreateOrUpdateParameters struct { - // AccountCreateOrUpdateProperties - Gets or sets account create or update properties. - *AccountCreateOrUpdateProperties `json:"properties,omitempty"` - // Name - Gets or sets name of the resource. - Name *string `json:"name,omitempty"` - // Location - Gets or sets the location of the resource. - Location *string `json:"location,omitempty"` - // Identity - Sets the identity property for automation account - Identity *Identity `json:"identity,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for AccountCreateOrUpdateParameters. -func (acoup AccountCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if acoup.AccountCreateOrUpdateProperties != nil { - objectMap["properties"] = acoup.AccountCreateOrUpdateProperties - } - if acoup.Name != nil { - objectMap["name"] = acoup.Name - } - if acoup.Location != nil { - objectMap["location"] = acoup.Location - } - if acoup.Identity != nil { - objectMap["identity"] = acoup.Identity - } - if acoup.Tags != nil { - objectMap["tags"] = acoup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AccountCreateOrUpdateParameters struct. -func (acoup *AccountCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var accountCreateOrUpdateProperties AccountCreateOrUpdateProperties - err = json.Unmarshal(*v, &accountCreateOrUpdateProperties) - if err != nil { - return err - } - acoup.AccountCreateOrUpdateProperties = &accountCreateOrUpdateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - acoup.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - acoup.Location = &location - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - acoup.Identity = &identity - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - acoup.Tags = tags - } - } - } - - return nil -} - -// AccountCreateOrUpdateProperties the parameters supplied to the create or update account properties. -type AccountCreateOrUpdateProperties struct { - // Sku - Gets or sets account SKU. - Sku *Sku `json:"sku,omitempty"` - // Encryption - Set the encryption properties for the automation account - Encryption *EncryptionProperties `json:"encryption,omitempty"` - // PublicNetworkAccess - Indicates whether traffic on the non-ARM endpoint (Webhook/Agent) is allowed from the public internet - PublicNetworkAccess *bool `json:"publicNetworkAccess,omitempty"` -} - -// AccountListResult the response model for the list account operation. -type AccountListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets list of accounts. - Value *[]Account `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// AccountListResultIterator provides access to a complete listing of Account values. -type AccountListResultIterator struct { - i int - page AccountListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AccountListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AccountListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AccountListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AccountListResultIterator) Response() AccountListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AccountListResultIterator) Value() Account { - if !iter.page.NotDone() { - return Account{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AccountListResultIterator type. -func NewAccountListResultIterator(page AccountListResultPage) AccountListResultIterator { - return AccountListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr AccountListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (alr AccountListResult) hasNextLink() bool { - return alr.NextLink != nil && len(*alr.NextLink) != 0 -} - -// accountListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr AccountListResult) accountListResultPreparer(ctx context.Context) (*http.Request, error) { - if !alr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.NextLink))) -} - -// AccountListResultPage contains a page of Account values. -type AccountListResultPage struct { - fn func(context.Context, AccountListResult) (AccountListResult, error) - alr AccountListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AccountListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.alr) - if err != nil { - return err - } - page.alr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AccountListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AccountListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AccountListResultPage) Response() AccountListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AccountListResultPage) Values() []Account { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// Creates a new instance of the AccountListResultPage type. -func NewAccountListResultPage(cur AccountListResult, getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { - return AccountListResultPage{ - fn: getNextPage, - alr: cur, - } -} - -// AccountProperties definition of the account property. -type AccountProperties struct { - // Sku - Gets or sets the SKU of account. - Sku *Sku `json:"sku,omitempty"` - // LastModifiedBy - Gets or sets the last modified by. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // State - READ-ONLY; Gets status of account. Possible values include: 'AccountStateOk', 'AccountStateUnavailable', 'AccountStateSuspended' - State AccountState `json:"state,omitempty"` - // CreationTime - READ-ONLY; Gets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - READ-ONLY; Gets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` - // Encryption - Encryption properties for the automation account - Encryption *EncryptionProperties `json:"encryption,omitempty"` - // PrivateEndpointConnections - List of Automation operations supported by the Automation resource provider. - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - // PublicNetworkAccess - Indicates whether traffic on the non-ARM endpoint (Webhook/Agent) is allowed from the public internet - PublicNetworkAccess *bool `json:"publicNetworkAccess,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountProperties. -func (ap AccountProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ap.Sku != nil { - objectMap["sku"] = ap.Sku - } - if ap.LastModifiedBy != nil { - objectMap["lastModifiedBy"] = ap.LastModifiedBy - } - if ap.Description != nil { - objectMap["description"] = ap.Description - } - if ap.Encryption != nil { - objectMap["encryption"] = ap.Encryption - } - if ap.PrivateEndpointConnections != nil { - objectMap["privateEndpointConnections"] = ap.PrivateEndpointConnections - } - if ap.PublicNetworkAccess != nil { - objectMap["publicNetworkAccess"] = ap.PublicNetworkAccess - } - return json.Marshal(objectMap) -} - -// AccountUpdateParameters the parameters supplied to the update automation account operation. -type AccountUpdateParameters struct { - // AccountUpdateProperties - Gets or sets account update properties. - *AccountUpdateProperties `json:"properties,omitempty"` - // Name - Gets or sets the name of the resource. - Name *string `json:"name,omitempty"` - // Location - Gets or sets the location of the resource. - Location *string `json:"location,omitempty"` - // Identity - Sets the identity property for automation account - Identity *Identity `json:"identity,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for AccountUpdateParameters. -func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aup.AccountUpdateProperties != nil { - objectMap["properties"] = aup.AccountUpdateProperties - } - if aup.Name != nil { - objectMap["name"] = aup.Name - } - if aup.Location != nil { - objectMap["location"] = aup.Location - } - if aup.Identity != nil { - objectMap["identity"] = aup.Identity - } - if aup.Tags != nil { - objectMap["tags"] = aup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. -func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var accountUpdateProperties AccountUpdateProperties - err = json.Unmarshal(*v, &accountUpdateProperties) - if err != nil { - return err - } - aup.AccountUpdateProperties = &accountUpdateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - aup.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - aup.Location = &location - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - aup.Identity = &identity - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - aup.Tags = tags - } - } - } - - return nil -} - -// AccountUpdateProperties the parameters supplied to the update account properties. -type AccountUpdateProperties struct { - // Sku - Gets or sets account SKU. - Sku *Sku `json:"sku,omitempty"` - // Encryption - Set the encryption properties for the automation account - Encryption *EncryptionProperties `json:"encryption,omitempty"` - // PublicNetworkAccess - Indicates whether traffic on the non-ARM endpoint (Webhook/Agent) is allowed from the public internet - PublicNetworkAccess *bool `json:"publicNetworkAccess,omitempty"` -} - -// Activity definition of the activity. -type Activity struct { - autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Gets the name of the activity. - Name *string `json:"name,omitempty"` - // ActivityProperties - Gets or sets the properties of the activity. - *ActivityProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Activity. -func (a Activity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.ID != nil { - objectMap["id"] = a.ID - } - if a.ActivityProperties != nil { - objectMap["properties"] = a.ActivityProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Activity struct. -func (a *Activity) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - a.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - a.Name = &name - } - case "properties": - if v != nil { - var activityProperties ActivityProperties - err = json.Unmarshal(*v, &activityProperties) - if err != nil { - return err - } - a.ActivityProperties = &activityProperties - } - } - } - - return nil -} - -// ActivityListResult the response model for the list activity operation. -type ActivityListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of activities. - Value *[]Activity `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// ActivityListResultIterator provides access to a complete listing of Activity values. -type ActivityListResultIterator struct { - i int - page ActivityListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ActivityListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ActivityListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ActivityListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ActivityListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ActivityListResultIterator) Response() ActivityListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ActivityListResultIterator) Value() Activity { - if !iter.page.NotDone() { - return Activity{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ActivityListResultIterator type. -func NewActivityListResultIterator(page ActivityListResultPage) ActivityListResultIterator { - return ActivityListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr ActivityListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (alr ActivityListResult) hasNextLink() bool { - return alr.NextLink != nil && len(*alr.NextLink) != 0 -} - -// activityListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr ActivityListResult) activityListResultPreparer(ctx context.Context) (*http.Request, error) { - if !alr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.NextLink))) -} - -// ActivityListResultPage contains a page of Activity values. -type ActivityListResultPage struct { - fn func(context.Context, ActivityListResult) (ActivityListResult, error) - alr ActivityListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ActivityListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ActivityListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.alr) - if err != nil { - return err - } - page.alr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ActivityListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ActivityListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ActivityListResultPage) Response() ActivityListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ActivityListResultPage) Values() []Activity { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// Creates a new instance of the ActivityListResultPage type. -func NewActivityListResultPage(cur ActivityListResult, getNextPage func(context.Context, ActivityListResult) (ActivityListResult, error)) ActivityListResultPage { - return ActivityListResultPage{ - fn: getNextPage, - alr: cur, - } -} - -// ActivityOutputType definition of the activity output type. -type ActivityOutputType struct { - // Name - Gets or sets the name of the activity output type. - Name *string `json:"name,omitempty"` - // Type - Gets or sets the type of the activity output type. - Type *string `json:"type,omitempty"` -} - -// ActivityParameter definition of the activity parameter. -type ActivityParameter struct { - // Name - Gets or sets the name of the activity parameter. - Name *string `json:"name,omitempty"` - // Type - Gets or sets the type of the activity parameter. - Type *string `json:"type,omitempty"` - // IsMandatory - Gets or sets a Boolean value that indicates true if the parameter is required. If the value is false, the parameter is optional. - IsMandatory *bool `json:"isMandatory,omitempty"` - // IsDynamic - Gets or sets a Boolean value that indicates true if the parameter is dynamic. - IsDynamic *bool `json:"isDynamic,omitempty"` - // Position - Gets or sets the position of the activity parameter. - Position *int64 `json:"position,omitempty"` - // ValueFromPipeline - Gets or sets a Boolean value that indicates true if the parameter can take values from the incoming pipeline objects. This setting is used if the cmdlet must access the complete input object. false indicates that the parameter cannot take values from the complete input object. - ValueFromPipeline *bool `json:"valueFromPipeline,omitempty"` - // ValueFromPipelineByPropertyName - Gets or sets a Boolean value that indicates true if the parameter can be filled from a property of the incoming pipeline object that has the same name as this parameter. false indicates that the parameter cannot be filled from the incoming pipeline object property with the same name. - ValueFromPipelineByPropertyName *bool `json:"valueFromPipelineByPropertyName,omitempty"` - // ValueFromRemainingArguments - Gets or sets a Boolean value that indicates true if the cmdlet parameter accepts all the remaining command-line arguments that are associated with this parameter in the form of an array. false if the cmdlet parameter does not accept all the remaining argument values. - ValueFromRemainingArguments *bool `json:"valueFromRemainingArguments,omitempty"` - // Description - Gets or sets the description of the activity parameter. - Description *string `json:"description,omitempty"` - // ValidationSet - Gets or sets the validation set of activity parameter. - ValidationSet *[]ActivityParameterValidationSet `json:"validationSet,omitempty"` -} - -// ActivityParameterSet definition of the activity parameter set. -type ActivityParameterSet struct { - // Name - Gets or sets the name of the activity parameter set. - Name *string `json:"name,omitempty"` - // Parameters - Gets or sets the parameters of the activity parameter set. - Parameters *[]ActivityParameter `json:"parameters,omitempty"` -} - -// ActivityParameterValidationSet definition of the activity parameter validation set. -type ActivityParameterValidationSet struct { - // MemberValue - Gets or sets the name of the activity parameter validation set member. - MemberValue *string `json:"memberValue,omitempty"` -} - -// ActivityProperties properties of the activity. -type ActivityProperties struct { - // Definition - Gets or sets the user name of the activity. - Definition *string `json:"definition,omitempty"` - // ParameterSets - Gets or sets the parameter sets of the activity. - ParameterSets *[]ActivityParameterSet `json:"parameterSets,omitempty"` - // OutputTypes - Gets or sets the output types of the activity. - OutputTypes *[]ActivityOutputType `json:"outputTypes,omitempty"` - // CreationTime - Gets or sets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// AdvancedSchedule the properties of the create Advanced Schedule. -type AdvancedSchedule struct { - // WeekDays - Days of the week that the job should execute on. - WeekDays *[]string `json:"weekDays,omitempty"` - // MonthDays - Days of the month that the job should execute on. Must be between 1 and 31. - MonthDays *[]int32 `json:"monthDays,omitempty"` - // MonthlyOccurrences - Occurrences of days within a month. - MonthlyOccurrences *[]AdvancedScheduleMonthlyOccurrence `json:"monthlyOccurrences,omitempty"` -} - -// AdvancedScheduleMonthlyOccurrence the properties of the create advanced schedule monthly occurrence. -type AdvancedScheduleMonthlyOccurrence struct { - // Occurrence - Occurrence of the week within the month. Must be between 1 and 5 - Occurrence *int32 `json:"occurrence,omitempty"` - // Day - Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'ScheduleDayMonday', 'ScheduleDayTuesday', 'ScheduleDayWednesday', 'ScheduleDayThursday', 'ScheduleDayFriday', 'ScheduleDaySaturday', 'ScheduleDaySunday' - Day ScheduleDay `json:"day,omitempty"` -} - -// AgentRegistration definition of the agent registration information type. -type AgentRegistration struct { - autorest.Response `json:"-"` - // DscMetaConfiguration - Gets or sets the dsc meta configuration. - DscMetaConfiguration *string `json:"dscMetaConfiguration,omitempty"` - // Endpoint - Gets or sets the dsc server endpoint. - Endpoint *string `json:"endpoint,omitempty"` - // Keys - Gets or sets the agent registration keys. - Keys *AgentRegistrationKeys `json:"keys,omitempty"` - // ID - Gets or sets the id. - ID *string `json:"id,omitempty"` -} - -// AgentRegistrationKeys definition of the agent registration keys. -type AgentRegistrationKeys struct { - // Primary - Gets or sets the primary key. - Primary *string `json:"primary,omitempty"` - // Secondary - Gets or sets the secondary key. - Secondary *string `json:"secondary,omitempty"` -} - -// AgentRegistrationRegenerateKeyParameter the parameters supplied to the regenerate keys operation. -type AgentRegistrationRegenerateKeyParameter struct { - // KeyName - Gets or sets the agent registration key name - primary or secondary. Possible values include: 'AgentRegistrationKeyNamePrimary', 'AgentRegistrationKeyNameSecondary' - KeyName AgentRegistrationKeyName `json:"keyName,omitempty"` -} - -// AzureQueryProperties azure query for the update configuration. -type AzureQueryProperties struct { - // Scope - List of Subscription or Resource Group ARM Ids. - Scope *[]string `json:"scope,omitempty"` - // Locations - List of locations to scope the query to. - Locations *[]string `json:"locations,omitempty"` - // TagSettings - Tag settings for the VM. - TagSettings *TagSettingsProperties `json:"tagSettings,omitempty"` -} - -// Certificate definition of the certificate. -type Certificate struct { - autorest.Response `json:"-"` - // CertificateProperties - Gets or sets the properties of the certificate. - *CertificateProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Certificate. -func (c Certificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.CertificateProperties != nil { - objectMap["properties"] = c.CertificateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Certificate struct. -func (c *Certificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var certificateProperties CertificateProperties - err = json.Unmarshal(*v, &certificateProperties) - if err != nil { - return err - } - c.CertificateProperties = &certificateProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - c.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - c.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - c.Type = &typeVar - } - } - } - - return nil -} - -// CertificateCreateOrUpdateParameters the parameters supplied to the create or update or replace -// certificate operation. -type CertificateCreateOrUpdateParameters struct { - // Name - Gets or sets the name of the certificate. - Name *string `json:"name,omitempty"` - // CertificateCreateOrUpdateProperties - Gets or sets the properties of the certificate. - *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. -func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccoup.Name != nil { - objectMap["name"] = ccoup.Name - } - if ccoup.CertificateCreateOrUpdateProperties != nil { - objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. -func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ccoup.Name = &name - } - case "properties": - if v != nil { - var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties - err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) - if err != nil { - return err - } - ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties - } - } - } - - return nil -} - -// CertificateCreateOrUpdateProperties the properties of the create certificate operation. -type CertificateCreateOrUpdateProperties struct { - // Base64Value - Gets or sets the base64 encoded value of the certificate. - Base64Value *string `json:"base64Value,omitempty"` - // Description - Gets or sets the description of the certificate. - Description *string `json:"description,omitempty"` - // Thumbprint - Gets or sets the thumbprint of the certificate. - Thumbprint *string `json:"thumbprint,omitempty"` - // IsExportable - Gets or sets the is exportable flag of the certificate. - IsExportable *bool `json:"isExportable,omitempty"` -} - -// CertificateListResult the response model for the list certificate operation. -type CertificateListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of certificates. - Value *[]Certificate `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// CertificateListResultIterator provides access to a complete listing of Certificate values. -type CertificateListResultIterator struct { - i int - page CertificateListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CertificateListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CertificateListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CertificateListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CertificateListResultIterator) Response() CertificateListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CertificateListResultIterator) Value() Certificate { - if !iter.page.NotDone() { - return Certificate{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CertificateListResultIterator type. -func NewCertificateListResultIterator(page CertificateListResultPage) CertificateListResultIterator { - return CertificateListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (clr CertificateListResult) IsEmpty() bool { - return clr.Value == nil || len(*clr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (clr CertificateListResult) hasNextLink() bool { - return clr.NextLink != nil && len(*clr.NextLink) != 0 -} - -// certificateListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (clr CertificateListResult) certificateListResultPreparer(ctx context.Context) (*http.Request, error) { - if !clr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(clr.NextLink))) -} - -// CertificateListResultPage contains a page of Certificate values. -type CertificateListResultPage struct { - fn func(context.Context, CertificateListResult) (CertificateListResult, error) - clr CertificateListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CertificateListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.clr) - if err != nil { - return err - } - page.clr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CertificateListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CertificateListResultPage) NotDone() bool { - return !page.clr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CertificateListResultPage) Response() CertificateListResult { - return page.clr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CertificateListResultPage) Values() []Certificate { - if page.clr.IsEmpty() { - return nil - } - return *page.clr.Value -} - -// Creates a new instance of the CertificateListResultPage type. -func NewCertificateListResultPage(cur CertificateListResult, getNextPage func(context.Context, CertificateListResult) (CertificateListResult, error)) CertificateListResultPage { - return CertificateListResultPage{ - fn: getNextPage, - clr: cur, - } -} - -// CertificateProperties properties of the certificate. -type CertificateProperties struct { - // Thumbprint - READ-ONLY; Gets the thumbprint of the certificate. - Thumbprint *string `json:"thumbprint,omitempty"` - // ExpiryTime - READ-ONLY; Gets the expiry time of the certificate. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // IsExportable - READ-ONLY; Gets the is exportable flag of the certificate. - IsExportable *bool `json:"isExportable,omitempty"` - // CreationTime - READ-ONLY; Gets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - READ-ONLY; Gets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for CertificateProperties. -func (cp CertificateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cp.Description != nil { - objectMap["description"] = cp.Description - } - return json.Marshal(objectMap) -} - -// CertificateUpdateParameters the parameters supplied to the update certificate operation. -type CertificateUpdateParameters struct { - // Name - Gets or sets the name of the certificate. - Name *string `json:"name,omitempty"` - // CertificateUpdateProperties - Gets or sets the properties of the certificate. - *CertificateUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for CertificateUpdateParameters. -func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Name != nil { - objectMap["name"] = cup.Name - } - if cup.CertificateUpdateProperties != nil { - objectMap["properties"] = cup.CertificateUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CertificateUpdateParameters struct. -func (cup *CertificateUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cup.Name = &name - } - case "properties": - if v != nil { - var certificateUpdateProperties CertificateUpdateProperties - err = json.Unmarshal(*v, &certificateUpdateProperties) - if err != nil { - return err - } - cup.CertificateUpdateProperties = &certificateUpdateProperties - } - } - } - - return nil -} - -// CertificateUpdateProperties the properties of the update certificate operation -type CertificateUpdateProperties struct { - // Description - Gets or sets the description of the certificate. - Description *string `json:"description,omitempty"` -} - -// Connection definition of the connection. -type Connection struct { - autorest.Response `json:"-"` - // ConnectionProperties - Gets or sets the properties of the connection. - *ConnectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Connection. -func (c Connection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ConnectionProperties != nil { - objectMap["properties"] = c.ConnectionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Connection struct. -func (c *Connection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var connectionProperties ConnectionProperties - err = json.Unmarshal(*v, &connectionProperties) - if err != nil { - return err - } - c.ConnectionProperties = &connectionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - c.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - c.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - c.Type = &typeVar - } - } - } - - return nil -} - -// ConnectionCreateOrUpdateParameters the parameters supplied to the create or update connection operation. -type ConnectionCreateOrUpdateParameters struct { - // Name - Gets or sets the name of the connection. - Name *string `json:"name,omitempty"` - // ConnectionCreateOrUpdateProperties - Gets or sets the properties of the connection. - *ConnectionCreateOrUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateParameters. -func (ccoup ConnectionCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccoup.Name != nil { - objectMap["name"] = ccoup.Name - } - if ccoup.ConnectionCreateOrUpdateProperties != nil { - objectMap["properties"] = ccoup.ConnectionCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ConnectionCreateOrUpdateParameters struct. -func (ccoup *ConnectionCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ccoup.Name = &name - } - case "properties": - if v != nil { - var connectionCreateOrUpdateProperties ConnectionCreateOrUpdateProperties - err = json.Unmarshal(*v, &connectionCreateOrUpdateProperties) - if err != nil { - return err - } - ccoup.ConnectionCreateOrUpdateProperties = &connectionCreateOrUpdateProperties - } - } - } - - return nil -} - -// ConnectionCreateOrUpdateProperties the properties of the create connection properties -type ConnectionCreateOrUpdateProperties struct { - // Description - Gets or sets the description of the connection. - Description *string `json:"description,omitempty"` - // ConnectionType - Gets or sets the connectionType of the connection. - ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` - // FieldDefinitionValues - Gets or sets the field definition properties of the connection. - FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` -} - -// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateProperties. -func (ccoup ConnectionCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccoup.Description != nil { - objectMap["description"] = ccoup.Description - } - if ccoup.ConnectionType != nil { - objectMap["connectionType"] = ccoup.ConnectionType - } - if ccoup.FieldDefinitionValues != nil { - objectMap["fieldDefinitionValues"] = ccoup.FieldDefinitionValues - } - return json.Marshal(objectMap) -} - -// ConnectionListResult the response model for the list connection operation. -type ConnectionListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of connection. - Value *[]Connection `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// ConnectionListResultIterator provides access to a complete listing of Connection values. -type ConnectionListResultIterator struct { - i int - page ConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ConnectionListResultIterator) Response() ConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ConnectionListResultIterator) Value() Connection { - if !iter.page.NotDone() { - return Connection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ConnectionListResultIterator type. -func NewConnectionListResultIterator(page ConnectionListResultPage) ConnectionListResultIterator { - return ConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (clr ConnectionListResult) IsEmpty() bool { - return clr.Value == nil || len(*clr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (clr ConnectionListResult) hasNextLink() bool { - return clr.NextLink != nil && len(*clr.NextLink) != 0 -} - -// connectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (clr ConnectionListResult) connectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !clr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(clr.NextLink))) -} - -// ConnectionListResultPage contains a page of Connection values. -type ConnectionListResultPage struct { - fn func(context.Context, ConnectionListResult) (ConnectionListResult, error) - clr ConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.clr) - if err != nil { - return err - } - page.clr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ConnectionListResultPage) NotDone() bool { - return !page.clr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ConnectionListResultPage) Response() ConnectionListResult { - return page.clr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ConnectionListResultPage) Values() []Connection { - if page.clr.IsEmpty() { - return nil - } - return *page.clr.Value -} - -// Creates a new instance of the ConnectionListResultPage type. -func NewConnectionListResultPage(cur ConnectionListResult, getNextPage func(context.Context, ConnectionListResult) (ConnectionListResult, error)) ConnectionListResultPage { - return ConnectionListResultPage{ - fn: getNextPage, - clr: cur, - } -} - -// ConnectionProperties definition of the connection properties. -type ConnectionProperties struct { - // ConnectionType - Gets or sets the connectionType of the connection. - ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` - // FieldDefinitionValues - READ-ONLY; Gets the field definition values of the connection. - FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` - // CreationTime - READ-ONLY; Gets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - READ-ONLY; Gets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionProperties. -func (cp ConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cp.ConnectionType != nil { - objectMap["connectionType"] = cp.ConnectionType - } - if cp.Description != nil { - objectMap["description"] = cp.Description - } - return json.Marshal(objectMap) -} - -// ConnectionType definition of the connection type. -type ConnectionType struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Gets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Gets the name of the connection type. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // ConnectionTypeProperties - Gets or sets the properties of the connection type. - *ConnectionTypeProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionType. -func (ct ConnectionType) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ct.ConnectionTypeProperties != nil { - objectMap["properties"] = ct.ConnectionTypeProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ConnectionType struct. -func (ct *ConnectionType) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ct.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ct.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ct.Type = &typeVar - } - case "properties": - if v != nil { - var connectionTypeProperties ConnectionTypeProperties - err = json.Unmarshal(*v, &connectionTypeProperties) - if err != nil { - return err - } - ct.ConnectionTypeProperties = &connectionTypeProperties - } - } - } - - return nil -} - -// ConnectionTypeAssociationProperty the connection type property associated with the entity. -type ConnectionTypeAssociationProperty struct { - // Name - Gets or sets the name of the connection type. - Name *string `json:"name,omitempty"` -} - -// ConnectionTypeCreateOrUpdateParameters the parameters supplied to the create or update connection type -// operation. -type ConnectionTypeCreateOrUpdateParameters struct { - // Name - Gets or sets the name of the connection type. - Name *string `json:"name,omitempty"` - // ConnectionTypeCreateOrUpdateProperties - Gets or sets the value of the connection type. - *ConnectionTypeCreateOrUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateParameters. -func (ctcoup ConnectionTypeCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ctcoup.Name != nil { - objectMap["name"] = ctcoup.Name - } - if ctcoup.ConnectionTypeCreateOrUpdateProperties != nil { - objectMap["properties"] = ctcoup.ConnectionTypeCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ConnectionTypeCreateOrUpdateParameters struct. -func (ctcoup *ConnectionTypeCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ctcoup.Name = &name - } - case "properties": - if v != nil { - var connectionTypeCreateOrUpdateProperties ConnectionTypeCreateOrUpdateProperties - err = json.Unmarshal(*v, &connectionTypeCreateOrUpdateProperties) - if err != nil { - return err - } - ctcoup.ConnectionTypeCreateOrUpdateProperties = &connectionTypeCreateOrUpdateProperties - } - } - } - - return nil -} - -// ConnectionTypeCreateOrUpdateProperties the properties of the create connection type. -type ConnectionTypeCreateOrUpdateProperties struct { - // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. - IsGlobal *bool `json:"isGlobal,omitempty"` - // FieldDefinitions - Gets or sets the field definitions of the connection type. - FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` -} - -// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateProperties. -func (ctcoup ConnectionTypeCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ctcoup.IsGlobal != nil { - objectMap["isGlobal"] = ctcoup.IsGlobal - } - if ctcoup.FieldDefinitions != nil { - objectMap["fieldDefinitions"] = ctcoup.FieldDefinitions - } - return json.Marshal(objectMap) -} - -// ConnectionTypeListResult the response model for the list connection type operation. -type ConnectionTypeListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of connection types. - Value *[]ConnectionType `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// ConnectionTypeListResultIterator provides access to a complete listing of ConnectionType values. -type ConnectionTypeListResultIterator struct { - i int - page ConnectionTypeListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ConnectionTypeListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ConnectionTypeListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ConnectionTypeListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ConnectionTypeListResultIterator) Response() ConnectionTypeListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ConnectionTypeListResultIterator) Value() ConnectionType { - if !iter.page.NotDone() { - return ConnectionType{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ConnectionTypeListResultIterator type. -func NewConnectionTypeListResultIterator(page ConnectionTypeListResultPage) ConnectionTypeListResultIterator { - return ConnectionTypeListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ctlr ConnectionTypeListResult) IsEmpty() bool { - return ctlr.Value == nil || len(*ctlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ctlr ConnectionTypeListResult) hasNextLink() bool { - return ctlr.NextLink != nil && len(*ctlr.NextLink) != 0 -} - -// connectionTypeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ctlr ConnectionTypeListResult) connectionTypeListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ctlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ctlr.NextLink))) -} - -// ConnectionTypeListResultPage contains a page of ConnectionType values. -type ConnectionTypeListResultPage struct { - fn func(context.Context, ConnectionTypeListResult) (ConnectionTypeListResult, error) - ctlr ConnectionTypeListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ConnectionTypeListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ctlr) - if err != nil { - return err - } - page.ctlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ConnectionTypeListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ConnectionTypeListResultPage) NotDone() bool { - return !page.ctlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ConnectionTypeListResultPage) Response() ConnectionTypeListResult { - return page.ctlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ConnectionTypeListResultPage) Values() []ConnectionType { - if page.ctlr.IsEmpty() { - return nil - } - return *page.ctlr.Value -} - -// Creates a new instance of the ConnectionTypeListResultPage type. -func NewConnectionTypeListResultPage(cur ConnectionTypeListResult, getNextPage func(context.Context, ConnectionTypeListResult) (ConnectionTypeListResult, error)) ConnectionTypeListResultPage { - return ConnectionTypeListResultPage{ - fn: getNextPage, - ctlr: cur, - } -} - -// ConnectionTypeProperties properties of the connection type. -type ConnectionTypeProperties struct { - // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. - IsGlobal *bool `json:"isGlobal,omitempty"` - // FieldDefinitions - READ-ONLY; Gets the field definitions of the connection type. - FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` - // CreationTime - READ-ONLY; Gets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionTypeProperties. -func (ctp ConnectionTypeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ctp.IsGlobal != nil { - objectMap["isGlobal"] = ctp.IsGlobal - } - if ctp.LastModifiedTime != nil { - objectMap["lastModifiedTime"] = ctp.LastModifiedTime - } - if ctp.Description != nil { - objectMap["description"] = ctp.Description - } - return json.Marshal(objectMap) -} - -// ConnectionUpdateParameters the parameters supplied to the update connection operation. -type ConnectionUpdateParameters struct { - // Name - Gets or sets the name of the connection. - Name *string `json:"name,omitempty"` - // ConnectionUpdateProperties - Gets or sets the properties of the connection. - *ConnectionUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionUpdateParameters. -func (cup ConnectionUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Name != nil { - objectMap["name"] = cup.Name - } - if cup.ConnectionUpdateProperties != nil { - objectMap["properties"] = cup.ConnectionUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ConnectionUpdateParameters struct. -func (cup *ConnectionUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cup.Name = &name - } - case "properties": - if v != nil { - var connectionUpdateProperties ConnectionUpdateProperties - err = json.Unmarshal(*v, &connectionUpdateProperties) - if err != nil { - return err - } - cup.ConnectionUpdateProperties = &connectionUpdateProperties - } - } - } - - return nil -} - -// ConnectionUpdateProperties the properties of the update connection operation. -type ConnectionUpdateProperties struct { - // Description - Gets or sets the description of the connection. - Description *string `json:"description,omitempty"` - // FieldDefinitionValues - Gets or sets the field definition values of the connection. - FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` -} - -// MarshalJSON is the custom marshaler for ConnectionUpdateProperties. -func (cup ConnectionUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Description != nil { - objectMap["description"] = cup.Description - } - if cup.FieldDefinitionValues != nil { - objectMap["fieldDefinitionValues"] = cup.FieldDefinitionValues - } - return json.Marshal(objectMap) -} - -// ContentHash definition of the runbook property type. -type ContentHash struct { - // Algorithm - Gets or sets the content hash algorithm used to hash the content. - Algorithm *string `json:"algorithm,omitempty"` - // Value - Gets or sets expected hash value of the content. - Value *string `json:"value,omitempty"` -} - -// ContentLink definition of the content link. -type ContentLink struct { - // URI - Gets or sets the uri of the runbook content. - URI *string `json:"uri,omitempty"` - // ContentHash - Gets or sets the hash. - ContentHash *ContentHash `json:"contentHash,omitempty"` - // Version - Gets or sets the version of the content. - Version *string `json:"version,omitempty"` -} - -// ContentSource definition of the content source. -type ContentSource struct { - // Hash - Gets or sets the hash. - Hash *ContentHash `json:"hash,omitempty"` - // Type - Gets or sets the content source type. Possible values include: 'ContentSourceTypeEmbeddedContent', 'ContentSourceTypeURI' - Type ContentSourceType `json:"type,omitempty"` - // Value - Gets or sets the value of the content. This is based on the content source type. - Value *string `json:"value,omitempty"` - // Version - Gets or sets the version of the content. - Version *string `json:"version,omitempty"` -} - -// Credential definition of the credential. -type Credential struct { - autorest.Response `json:"-"` - // CredentialProperties - Gets or sets the properties of the credential. - *CredentialProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Credential. -func (c Credential) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.CredentialProperties != nil { - objectMap["properties"] = c.CredentialProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Credential struct. -func (c *Credential) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var credentialProperties CredentialProperties - err = json.Unmarshal(*v, &credentialProperties) - if err != nil { - return err - } - c.CredentialProperties = &credentialProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - c.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - c.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - c.Type = &typeVar - } - } - } - - return nil -} - -// CredentialCreateOrUpdateParameters the parameters supplied to the create or update credential operation. -type CredentialCreateOrUpdateParameters struct { - // Name - Gets or sets the name of the credential. - Name *string `json:"name,omitempty"` - // CredentialCreateOrUpdateProperties - Gets or sets the properties of the credential. - *CredentialCreateOrUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for CredentialCreateOrUpdateParameters. -func (ccoup CredentialCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccoup.Name != nil { - objectMap["name"] = ccoup.Name - } - if ccoup.CredentialCreateOrUpdateProperties != nil { - objectMap["properties"] = ccoup.CredentialCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CredentialCreateOrUpdateParameters struct. -func (ccoup *CredentialCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ccoup.Name = &name - } - case "properties": - if v != nil { - var credentialCreateOrUpdateProperties CredentialCreateOrUpdateProperties - err = json.Unmarshal(*v, &credentialCreateOrUpdateProperties) - if err != nil { - return err - } - ccoup.CredentialCreateOrUpdateProperties = &credentialCreateOrUpdateProperties - } - } - } - - return nil -} - -// CredentialCreateOrUpdateProperties the properties of the create credential operation. -type CredentialCreateOrUpdateProperties struct { - // UserName - Gets or sets the user name of the credential. - UserName *string `json:"userName,omitempty"` - // Password - Gets or sets the password of the credential. - Password *string `json:"password,omitempty"` - // Description - Gets or sets the description of the credential. - Description *string `json:"description,omitempty"` -} - -// CredentialListResult the response model for the list credential operation. -type CredentialListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of credentials. - Value *[]Credential `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// CredentialListResultIterator provides access to a complete listing of Credential values. -type CredentialListResultIterator struct { - i int - page CredentialListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CredentialListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CredentialListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CredentialListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CredentialListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CredentialListResultIterator) Response() CredentialListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CredentialListResultIterator) Value() Credential { - if !iter.page.NotDone() { - return Credential{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CredentialListResultIterator type. -func NewCredentialListResultIterator(page CredentialListResultPage) CredentialListResultIterator { - return CredentialListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (clr CredentialListResult) IsEmpty() bool { - return clr.Value == nil || len(*clr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (clr CredentialListResult) hasNextLink() bool { - return clr.NextLink != nil && len(*clr.NextLink) != 0 -} - -// credentialListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (clr CredentialListResult) credentialListResultPreparer(ctx context.Context) (*http.Request, error) { - if !clr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(clr.NextLink))) -} - -// CredentialListResultPage contains a page of Credential values. -type CredentialListResultPage struct { - fn func(context.Context, CredentialListResult) (CredentialListResult, error) - clr CredentialListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CredentialListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CredentialListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.clr) - if err != nil { - return err - } - page.clr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CredentialListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CredentialListResultPage) NotDone() bool { - return !page.clr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CredentialListResultPage) Response() CredentialListResult { - return page.clr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CredentialListResultPage) Values() []Credential { - if page.clr.IsEmpty() { - return nil - } - return *page.clr.Value -} - -// Creates a new instance of the CredentialListResultPage type. -func NewCredentialListResultPage(cur CredentialListResult, getNextPage func(context.Context, CredentialListResult) (CredentialListResult, error)) CredentialListResultPage { - return CredentialListResultPage{ - fn: getNextPage, - clr: cur, - } -} - -// CredentialProperties definition of the credential properties -type CredentialProperties struct { - // UserName - READ-ONLY; Gets the user name of the credential. - UserName *string `json:"userName,omitempty"` - // CreationTime - READ-ONLY; Gets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - READ-ONLY; Gets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for CredentialProperties. -func (cp CredentialProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cp.Description != nil { - objectMap["description"] = cp.Description - } - return json.Marshal(objectMap) -} - -// CredentialUpdateParameters the parameters supplied to the Update credential operation. -type CredentialUpdateParameters struct { - // Name - Gets or sets the name of the credential. - Name *string `json:"name,omitempty"` - // CredentialUpdateProperties - Gets or sets the properties of the variable. - *CredentialUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for CredentialUpdateParameters. -func (cup CredentialUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Name != nil { - objectMap["name"] = cup.Name - } - if cup.CredentialUpdateProperties != nil { - objectMap["properties"] = cup.CredentialUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CredentialUpdateParameters struct. -func (cup *CredentialUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cup.Name = &name - } - case "properties": - if v != nil { - var credentialUpdateProperties CredentialUpdateProperties - err = json.Unmarshal(*v, &credentialUpdateProperties) - if err != nil { - return err - } - cup.CredentialUpdateProperties = &credentialUpdateProperties - } - } - } - - return nil -} - -// CredentialUpdateProperties the properties of the Update credential -type CredentialUpdateProperties struct { - // UserName - Gets or sets the user name of the credential. - UserName *string `json:"userName,omitempty"` - // Password - Gets or sets the password of the credential. - Password *string `json:"password,omitempty"` - // Description - Gets or sets the description of the credential. - Description *string `json:"description,omitempty"` -} - -// DscCompilationJob definition of the Dsc Compilation job. -type DscCompilationJob struct { - autorest.Response `json:"-"` - // DscCompilationJobProperties - Gets or sets the properties of the Dsc Compilation job. - *DscCompilationJobProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscCompilationJob. -func (dcj DscCompilationJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcj.DscCompilationJobProperties != nil { - objectMap["properties"] = dcj.DscCompilationJobProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscCompilationJob struct. -func (dcj *DscCompilationJob) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dscCompilationJobProperties DscCompilationJobProperties - err = json.Unmarshal(*v, &dscCompilationJobProperties) - if err != nil { - return err - } - dcj.DscCompilationJobProperties = &dscCompilationJobProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dcj.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dcj.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dcj.Type = &typeVar - } - } - } - - return nil -} - -// DscCompilationJobCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DscCompilationJobCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DscCompilationJobClient) (DscCompilationJob, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DscCompilationJobCreateFuture) 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 DscCompilationJobCreateFuture.Result. -func (future *DscCompilationJobCreateFuture) result(client DscCompilationJobClient) (dcj DscCompilationJob, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dcj.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("automation.DscCompilationJobCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dcj.Response.Response, err = future.GetResult(sender); err == nil && dcj.Response.Response.StatusCode != http.StatusNoContent { - dcj, err = client.CreateResponder(dcj.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobCreateFuture", "Result", dcj.Response.Response, "Failure responding to request") - } - } - return -} - -// DscCompilationJobCreateParameters the parameters supplied to the create compilation job operation. -type DscCompilationJobCreateParameters struct { - // DscCompilationJobCreateProperties - Gets or sets the list of compilation job properties. - *DscCompilationJobCreateProperties `json:"properties,omitempty"` - // Name - Gets or sets name of the resource. - Name *string `json:"name,omitempty"` - // Location - Gets or sets the location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DscCompilationJobCreateParameters. -func (dcjcp DscCompilationJobCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcjcp.DscCompilationJobCreateProperties != nil { - objectMap["properties"] = dcjcp.DscCompilationJobCreateProperties - } - if dcjcp.Name != nil { - objectMap["name"] = dcjcp.Name - } - if dcjcp.Location != nil { - objectMap["location"] = dcjcp.Location - } - if dcjcp.Tags != nil { - objectMap["tags"] = dcjcp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscCompilationJobCreateParameters struct. -func (dcjcp *DscCompilationJobCreateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dscCompilationJobCreateProperties DscCompilationJobCreateProperties - err = json.Unmarshal(*v, &dscCompilationJobCreateProperties) - if err != nil { - return err - } - dcjcp.DscCompilationJobCreateProperties = &dscCompilationJobCreateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dcjcp.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dcjcp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dcjcp.Tags = tags - } - } - } - - return nil -} - -// DscCompilationJobCreateProperties the parameters supplied to the create compilation job operation. -type DscCompilationJobCreateProperties struct { - // Configuration - Gets or sets the configuration. - Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` - // Parameters - Gets or sets the parameters of the job. - Parameters map[string]*string `json:"parameters"` - // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. - IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscCompilationJobCreateProperties. -func (dcjcp DscCompilationJobCreateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcjcp.Configuration != nil { - objectMap["configuration"] = dcjcp.Configuration - } - if dcjcp.Parameters != nil { - objectMap["parameters"] = dcjcp.Parameters - } - if dcjcp.IncrementNodeConfigurationBuild != nil { - objectMap["incrementNodeConfigurationBuild"] = dcjcp.IncrementNodeConfigurationBuild - } - return json.Marshal(objectMap) -} - -// DscCompilationJobListResult the response model for the list job operation. -type DscCompilationJobListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of Dsc Compilation jobs. - Value *[]DscCompilationJob `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// DscCompilationJobListResultIterator provides access to a complete listing of DscCompilationJob values. -type DscCompilationJobListResultIterator struct { - i int - page DscCompilationJobListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DscCompilationJobListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DscCompilationJobListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DscCompilationJobListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DscCompilationJobListResultIterator) Response() DscCompilationJobListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DscCompilationJobListResultIterator) Value() DscCompilationJob { - if !iter.page.NotDone() { - return DscCompilationJob{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DscCompilationJobListResultIterator type. -func NewDscCompilationJobListResultIterator(page DscCompilationJobListResultPage) DscCompilationJobListResultIterator { - return DscCompilationJobListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dcjlr DscCompilationJobListResult) IsEmpty() bool { - return dcjlr.Value == nil || len(*dcjlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dcjlr DscCompilationJobListResult) hasNextLink() bool { - return dcjlr.NextLink != nil && len(*dcjlr.NextLink) != 0 -} - -// dscCompilationJobListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dcjlr DscCompilationJobListResult) dscCompilationJobListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dcjlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dcjlr.NextLink))) -} - -// DscCompilationJobListResultPage contains a page of DscCompilationJob values. -type DscCompilationJobListResultPage struct { - fn func(context.Context, DscCompilationJobListResult) (DscCompilationJobListResult, error) - dcjlr DscCompilationJobListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DscCompilationJobListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dcjlr) - if err != nil { - return err - } - page.dcjlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DscCompilationJobListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DscCompilationJobListResultPage) NotDone() bool { - return !page.dcjlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DscCompilationJobListResultPage) Response() DscCompilationJobListResult { - return page.dcjlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DscCompilationJobListResultPage) Values() []DscCompilationJob { - if page.dcjlr.IsEmpty() { - return nil - } - return *page.dcjlr.Value -} - -// Creates a new instance of the DscCompilationJobListResultPage type. -func NewDscCompilationJobListResultPage(cur DscCompilationJobListResult, getNextPage func(context.Context, DscCompilationJobListResult) (DscCompilationJobListResult, error)) DscCompilationJobListResultPage { - return DscCompilationJobListResultPage{ - fn: getNextPage, - dcjlr: cur, - } -} - -// DscCompilationJobProperties definition of Dsc Compilation job properties. -type DscCompilationJobProperties struct { - // Configuration - Gets or sets the configuration. - Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` - // StartedBy - READ-ONLY; Gets the compilation job started by. - StartedBy *string `json:"startedBy,omitempty"` - // JobID - READ-ONLY; Gets the id of the job. - JobID *uuid.UUID `json:"jobId,omitempty"` - // CreationTime - READ-ONLY; Gets the creation time of the job. - CreationTime *date.Time `json:"creationTime,omitempty"` - // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' - ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` - // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. - RunOn *string `json:"runOn,omitempty"` - // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' - Status JobStatus `json:"status,omitempty"` - // StatusDetails - Gets or sets the status details of the job. - StatusDetails *string `json:"statusDetails,omitempty"` - // StartTime - READ-ONLY; Gets the start time of the job. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; Gets the end time of the job. - EndTime *date.Time `json:"endTime,omitempty"` - // Exception - READ-ONLY; Gets the exception of the job. - Exception *string `json:"exception,omitempty"` - // LastModifiedTime - READ-ONLY; Gets the last modified time of the job. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // LastStatusModifiedTime - READ-ONLY; Gets the last status modified time of the job. - LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` - // Parameters - Gets or sets the parameters of the job. - Parameters map[string]*string `json:"parameters"` -} - -// MarshalJSON is the custom marshaler for DscCompilationJobProperties. -func (dcjp DscCompilationJobProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcjp.Configuration != nil { - objectMap["configuration"] = dcjp.Configuration - } - if dcjp.ProvisioningState != "" { - objectMap["provisioningState"] = dcjp.ProvisioningState - } - if dcjp.RunOn != nil { - objectMap["runOn"] = dcjp.RunOn - } - if dcjp.Status != "" { - objectMap["status"] = dcjp.Status - } - if dcjp.StatusDetails != nil { - objectMap["statusDetails"] = dcjp.StatusDetails - } - if dcjp.Parameters != nil { - objectMap["parameters"] = dcjp.Parameters - } - return json.Marshal(objectMap) -} - -// DscConfiguration definition of the configuration type. -type DscConfiguration struct { - autorest.Response `json:"-"` - // DscConfigurationProperties - Gets or sets the configuration properties. - *DscConfigurationProperties `json:"properties,omitempty"` - // Etag - Gets or sets the etag of the resource. - Etag *string `json:"etag,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The Azure Region where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscConfiguration. -func (dc DscConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dc.DscConfigurationProperties != nil { - objectMap["properties"] = dc.DscConfigurationProperties - } - if dc.Etag != nil { - objectMap["etag"] = dc.Etag - } - if dc.Tags != nil { - objectMap["tags"] = dc.Tags - } - if dc.Location != nil { - objectMap["location"] = dc.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscConfiguration struct. -func (dc *DscConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dscConfigurationProperties DscConfigurationProperties - err = json.Unmarshal(*v, &dscConfigurationProperties) - if err != nil { - return err - } - dc.DscConfigurationProperties = &dscConfigurationProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - dc.Etag = &etag - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dc.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dc.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dc.Type = &typeVar - } - } - } - - return nil -} - -// DscConfigurationAssociationProperty the Dsc configuration property associated with the entity. -type DscConfigurationAssociationProperty struct { - // Name - Gets or sets the name of the Dsc configuration. - Name *string `json:"name,omitempty"` -} - -// DscConfigurationCreateOrUpdateParameters the parameters supplied to the create or update configuration -// operation. -type DscConfigurationCreateOrUpdateParameters struct { - // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. - *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` - // Name - Gets or sets name of the resource. - Name *string `json:"name,omitempty"` - // Location - Gets or sets the location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateParameters. -func (dccoup DscConfigurationCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dccoup.DscConfigurationCreateOrUpdateProperties != nil { - objectMap["properties"] = dccoup.DscConfigurationCreateOrUpdateProperties - } - if dccoup.Name != nil { - objectMap["name"] = dccoup.Name - } - if dccoup.Location != nil { - objectMap["location"] = dccoup.Location - } - if dccoup.Tags != nil { - objectMap["tags"] = dccoup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscConfigurationCreateOrUpdateParameters struct. -func (dccoup *DscConfigurationCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties - err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) - if err != nil { - return err - } - dccoup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dccoup.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dccoup.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dccoup.Tags = tags - } - } - } - - return nil -} - -// DscConfigurationCreateOrUpdateProperties the properties to create or update configuration. -type DscConfigurationCreateOrUpdateProperties struct { - // LogVerbose - Gets or sets verbose log option. - LogVerbose *bool `json:"logVerbose,omitempty"` - // LogProgress - Gets or sets progress log option. - LogProgress *bool `json:"logProgress,omitempty"` - // Source - Gets or sets the source. - Source *ContentSource `json:"source,omitempty"` - // Parameters - Gets or sets the configuration parameters. - Parameters map[string]*DscConfigurationParameter `json:"parameters"` - // Description - Gets or sets the description of the configuration. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateProperties. -func (dccoup DscConfigurationCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dccoup.LogVerbose != nil { - objectMap["logVerbose"] = dccoup.LogVerbose - } - if dccoup.LogProgress != nil { - objectMap["logProgress"] = dccoup.LogProgress - } - if dccoup.Source != nil { - objectMap["source"] = dccoup.Source - } - if dccoup.Parameters != nil { - objectMap["parameters"] = dccoup.Parameters - } - if dccoup.Description != nil { - objectMap["description"] = dccoup.Description - } - return json.Marshal(objectMap) -} - -// DscConfigurationListResult the response model for the list configuration operation. -type DscConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of configurations. - Value *[]DscConfiguration `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` - // TotalCount - Gets the total number of configurations matching filter criteria. - TotalCount *int32 `json:"totalCount,omitempty"` -} - -// DscConfigurationListResultIterator provides access to a complete listing of DscConfiguration values. -type DscConfigurationListResultIterator struct { - i int - page DscConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DscConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DscConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DscConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DscConfigurationListResultIterator) Response() DscConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DscConfigurationListResultIterator) Value() DscConfiguration { - if !iter.page.NotDone() { - return DscConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DscConfigurationListResultIterator type. -func NewDscConfigurationListResultIterator(page DscConfigurationListResultPage) DscConfigurationListResultIterator { - return DscConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dclr DscConfigurationListResult) IsEmpty() bool { - return dclr.Value == nil || len(*dclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dclr DscConfigurationListResult) hasNextLink() bool { - return dclr.NextLink != nil && len(*dclr.NextLink) != 0 -} - -// dscConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dclr DscConfigurationListResult) dscConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dclr.NextLink))) -} - -// DscConfigurationListResultPage contains a page of DscConfiguration values. -type DscConfigurationListResultPage struct { - fn func(context.Context, DscConfigurationListResult) (DscConfigurationListResult, error) - dclr DscConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DscConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dclr) - if err != nil { - return err - } - page.dclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DscConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DscConfigurationListResultPage) NotDone() bool { - return !page.dclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DscConfigurationListResultPage) Response() DscConfigurationListResult { - return page.dclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DscConfigurationListResultPage) Values() []DscConfiguration { - if page.dclr.IsEmpty() { - return nil - } - return *page.dclr.Value -} - -// Creates a new instance of the DscConfigurationListResultPage type. -func NewDscConfigurationListResultPage(cur DscConfigurationListResult, getNextPage func(context.Context, DscConfigurationListResult) (DscConfigurationListResult, error)) DscConfigurationListResultPage { - return DscConfigurationListResultPage{ - fn: getNextPage, - dclr: cur, - } -} - -// DscConfigurationParameter definition of the configuration parameter type. -type DscConfigurationParameter struct { - // Type - Gets or sets the type of the parameter. - Type *string `json:"type,omitempty"` - // IsMandatory - Gets or sets a Boolean value to indicate whether the parameter is mandatory or not. - IsMandatory *bool `json:"isMandatory,omitempty"` - // Position - Get or sets the position of the parameter. - Position *int32 `json:"position,omitempty"` - // DefaultValue - Gets or sets the default value of parameter. - DefaultValue *string `json:"defaultValue,omitempty"` -} - -// DscConfigurationProperties definition of the configuration property type. -type DscConfigurationProperties struct { - // ProvisioningState - Gets or sets the provisioning state of the configuration. Possible values include: 'DscConfigurationProvisioningStateSucceeded' - ProvisioningState DscConfigurationProvisioningState `json:"provisioningState,omitempty"` - // JobCount - Gets or sets the job count of the configuration. - JobCount *int32 `json:"jobCount,omitempty"` - // Parameters - Gets or sets the configuration parameters. - Parameters map[string]*DscConfigurationParameter `json:"parameters"` - // Source - Gets or sets the source. - Source *ContentSource `json:"source,omitempty"` - // State - Gets or sets the state of the configuration. Possible values include: 'DscConfigurationStateNew', 'DscConfigurationStateEdit', 'DscConfigurationStatePublished' - State DscConfigurationState `json:"state,omitempty"` - // LogVerbose - Gets or sets verbose log option. - LogVerbose *bool `json:"logVerbose,omitempty"` - // CreationTime - Gets or sets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // NodeConfigurationCount - Gets the number of compiled node configurations. - NodeConfigurationCount *int32 `json:"nodeConfigurationCount,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscConfigurationProperties. -func (dcp DscConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcp.ProvisioningState != "" { - objectMap["provisioningState"] = dcp.ProvisioningState - } - if dcp.JobCount != nil { - objectMap["jobCount"] = dcp.JobCount - } - if dcp.Parameters != nil { - objectMap["parameters"] = dcp.Parameters - } - if dcp.Source != nil { - objectMap["source"] = dcp.Source - } - if dcp.State != "" { - objectMap["state"] = dcp.State - } - if dcp.LogVerbose != nil { - objectMap["logVerbose"] = dcp.LogVerbose - } - if dcp.CreationTime != nil { - objectMap["creationTime"] = dcp.CreationTime - } - if dcp.LastModifiedTime != nil { - objectMap["lastModifiedTime"] = dcp.LastModifiedTime - } - if dcp.NodeConfigurationCount != nil { - objectMap["nodeConfigurationCount"] = dcp.NodeConfigurationCount - } - if dcp.Description != nil { - objectMap["description"] = dcp.Description - } - return json.Marshal(objectMap) -} - -// DscConfigurationUpdateParameters the parameters supplied to the create or update configuration -// operation. -type DscConfigurationUpdateParameters struct { - // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. - *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` - // Name - Gets or sets name of the resource. - Name *string `json:"name,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DscConfigurationUpdateParameters. -func (dcup DscConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcup.DscConfigurationCreateOrUpdateProperties != nil { - objectMap["properties"] = dcup.DscConfigurationCreateOrUpdateProperties - } - if dcup.Name != nil { - objectMap["name"] = dcup.Name - } - if dcup.Tags != nil { - objectMap["tags"] = dcup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscConfigurationUpdateParameters struct. -func (dcup *DscConfigurationUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties - err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) - if err != nil { - return err - } - dcup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dcup.Name = &name - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dcup.Tags = tags - } - } - } - - return nil -} - -// DscMetaConfiguration definition of the DSC Meta Configuration. -type DscMetaConfiguration struct { - // ConfigurationModeFrequencyMins - Gets or sets the ConfigurationModeFrequencyMins value of the meta configuration. - ConfigurationModeFrequencyMins *int32 `json:"configurationModeFrequencyMins,omitempty"` - // RebootNodeIfNeeded - Gets or sets the RebootNodeIfNeeded value of the meta configuration. - RebootNodeIfNeeded *bool `json:"rebootNodeIfNeeded,omitempty"` - // ConfigurationMode - Gets or sets the ConfigurationMode value of the meta configuration. - ConfigurationMode *string `json:"configurationMode,omitempty"` - // ActionAfterReboot - Gets or sets the ActionAfterReboot value of the meta configuration. - ActionAfterReboot *string `json:"actionAfterReboot,omitempty"` - // CertificateID - Gets or sets the CertificateId value of the meta configuration. - CertificateID *string `json:"certificateId,omitempty"` - // RefreshFrequencyMins - Gets or sets the RefreshFrequencyMins value of the meta configuration. - RefreshFrequencyMins *int32 `json:"refreshFrequencyMins,omitempty"` - // AllowModuleOverwrite - Gets or sets the AllowModuleOverwrite value of the meta configuration. - AllowModuleOverwrite *bool `json:"allowModuleOverwrite,omitempty"` -} - -// DscNode definition of a DscNode -type DscNode struct { - autorest.Response `json:"-"` - // DscNodeProperties - The properties of a DscNode. - *DscNodeProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscNode. -func (dn DscNode) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dn.DscNodeProperties != nil { - objectMap["properties"] = dn.DscNodeProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscNode struct. -func (dn *DscNode) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dscNodeProperties DscNodeProperties - err = json.Unmarshal(*v, &dscNodeProperties) - if err != nil { - return err - } - dn.DscNodeProperties = &dscNodeProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dn.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dn.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dn.Type = &typeVar - } - } - } - - return nil -} - -// DscNodeConfiguration definition of the dsc node configuration. -type DscNodeConfiguration struct { - autorest.Response `json:"-"` - // DscNodeConfigurationProperties - Gets or sets the configuration properties. - *DscNodeConfigurationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscNodeConfiguration. -func (dnc DscNodeConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dnc.DscNodeConfigurationProperties != nil { - objectMap["properties"] = dnc.DscNodeConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscNodeConfiguration struct. -func (dnc *DscNodeConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dscNodeConfigurationProperties DscNodeConfigurationProperties - err = json.Unmarshal(*v, &dscNodeConfigurationProperties) - if err != nil { - return err - } - dnc.DscNodeConfigurationProperties = &dscNodeConfigurationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dnc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dnc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dnc.Type = &typeVar - } - } - } - - return nil -} - -// DscNodeConfigurationAssociationProperty the dsc node configuration property associated with the entity. -type DscNodeConfigurationAssociationProperty struct { - // Name - Gets or sets the name of the dsc node configuration. - Name *string `json:"name,omitempty"` -} - -// DscNodeConfigurationCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DscNodeConfigurationCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DscNodeConfigurationClient) (DscNodeConfiguration, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DscNodeConfigurationCreateOrUpdateFuture) 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 DscNodeConfigurationCreateOrUpdateFuture.Result. -func (future *DscNodeConfigurationCreateOrUpdateFuture) result(client DscNodeConfigurationClient) (dnc DscNodeConfiguration, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dnc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("automation.DscNodeConfigurationCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dnc.Response.Response, err = future.GetResult(sender); err == nil && dnc.Response.Response.StatusCode != http.StatusNoContent { - dnc, err = client.CreateOrUpdateResponder(dnc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationCreateOrUpdateFuture", "Result", dnc.Response.Response, "Failure responding to request") - } - } - return -} - -// DscNodeConfigurationCreateOrUpdateParameters the parameters supplied to the create or update node -// configuration operation. -type DscNodeConfigurationCreateOrUpdateParameters struct { - // DscNodeConfigurationCreateOrUpdateParametersProperties - Node configuration properties - *DscNodeConfigurationCreateOrUpdateParametersProperties `json:"properties,omitempty"` - // Name - Name of the node configuration. - Name *string `json:"name,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DscNodeConfigurationCreateOrUpdateParameters. -func (dnccoup DscNodeConfigurationCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dnccoup.DscNodeConfigurationCreateOrUpdateParametersProperties != nil { - objectMap["properties"] = dnccoup.DscNodeConfigurationCreateOrUpdateParametersProperties - } - if dnccoup.Name != nil { - objectMap["name"] = dnccoup.Name - } - if dnccoup.Tags != nil { - objectMap["tags"] = dnccoup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscNodeConfigurationCreateOrUpdateParameters struct. -func (dnccoup *DscNodeConfigurationCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dscNodeConfigurationCreateOrUpdateParametersProperties DscNodeConfigurationCreateOrUpdateParametersProperties - err = json.Unmarshal(*v, &dscNodeConfigurationCreateOrUpdateParametersProperties) - if err != nil { - return err - } - dnccoup.DscNodeConfigurationCreateOrUpdateParametersProperties = &dscNodeConfigurationCreateOrUpdateParametersProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dnccoup.Name = &name - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dnccoup.Tags = tags - } - } - } - - return nil -} - -// DscNodeConfigurationCreateOrUpdateParametersProperties the parameter properties supplied to the create -// or update node configuration operation. -type DscNodeConfigurationCreateOrUpdateParametersProperties struct { - // Source - Gets or sets the source. - Source *ContentSource `json:"source,omitempty"` - // Configuration - Gets or sets the configuration of the node. - Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` - // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. - IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` -} - -// DscNodeConfigurationListResult the response model for the list job operation. -type DscNodeConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of Dsc node configurations. - Value *[]DscNodeConfiguration `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` - // TotalCount - Gets or sets the total rows in query. - TotalCount *int32 `json:"totalCount,omitempty"` -} - -// DscNodeConfigurationListResultIterator provides access to a complete listing of DscNodeConfiguration -// values. -type DscNodeConfigurationListResultIterator struct { - i int - page DscNodeConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DscNodeConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DscNodeConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DscNodeConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DscNodeConfigurationListResultIterator) Response() DscNodeConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DscNodeConfigurationListResultIterator) Value() DscNodeConfiguration { - if !iter.page.NotDone() { - return DscNodeConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DscNodeConfigurationListResultIterator type. -func NewDscNodeConfigurationListResultIterator(page DscNodeConfigurationListResultPage) DscNodeConfigurationListResultIterator { - return DscNodeConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dnclr DscNodeConfigurationListResult) IsEmpty() bool { - return dnclr.Value == nil || len(*dnclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dnclr DscNodeConfigurationListResult) hasNextLink() bool { - return dnclr.NextLink != nil && len(*dnclr.NextLink) != 0 -} - -// dscNodeConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dnclr DscNodeConfigurationListResult) dscNodeConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dnclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dnclr.NextLink))) -} - -// DscNodeConfigurationListResultPage contains a page of DscNodeConfiguration values. -type DscNodeConfigurationListResultPage struct { - fn func(context.Context, DscNodeConfigurationListResult) (DscNodeConfigurationListResult, error) - dnclr DscNodeConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DscNodeConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dnclr) - if err != nil { - return err - } - page.dnclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DscNodeConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DscNodeConfigurationListResultPage) NotDone() bool { - return !page.dnclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DscNodeConfigurationListResultPage) Response() DscNodeConfigurationListResult { - return page.dnclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DscNodeConfigurationListResultPage) Values() []DscNodeConfiguration { - if page.dnclr.IsEmpty() { - return nil - } - return *page.dnclr.Value -} - -// Creates a new instance of the DscNodeConfigurationListResultPage type. -func NewDscNodeConfigurationListResultPage(cur DscNodeConfigurationListResult, getNextPage func(context.Context, DscNodeConfigurationListResult) (DscNodeConfigurationListResult, error)) DscNodeConfigurationListResultPage { - return DscNodeConfigurationListResultPage{ - fn: getNextPage, - dnclr: cur, - } -} - -// DscNodeConfigurationProperties properties for the DscNodeConfiguration -type DscNodeConfigurationProperties struct { - // LastModifiedTime - Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // CreationTime - Gets or sets creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // Configuration - Gets or sets the configuration of the node. - Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` - // Source - Source of node configuration. - Source *string `json:"source,omitempty"` - // NodeCount - Number of nodes with this node configuration assigned - NodeCount *int64 `json:"nodeCount,omitempty"` - // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. - IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` -} - -// DscNodeExtensionHandlerAssociationProperty the dsc extensionHandler property associated with the node -type DscNodeExtensionHandlerAssociationProperty struct { - // Name - Gets or sets the name of the extension handler. - Name *string `json:"name,omitempty"` - // Version - Gets or sets the version of the extension handler. - Version *string `json:"version,omitempty"` -} - -// DscNodeListResult the response model for the list dsc nodes operation. -type DscNodeListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of dsc nodes. - Value *[]DscNode `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` - // TotalCount - Gets the total number of nodes matching filter criteria. - TotalCount *int32 `json:"totalCount,omitempty"` -} - -// DscNodeListResultIterator provides access to a complete listing of DscNode values. -type DscNodeListResultIterator struct { - i int - page DscNodeListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DscNodeListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DscNodeListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DscNodeListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DscNodeListResultIterator) Response() DscNodeListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DscNodeListResultIterator) Value() DscNode { - if !iter.page.NotDone() { - return DscNode{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DscNodeListResultIterator type. -func NewDscNodeListResultIterator(page DscNodeListResultPage) DscNodeListResultIterator { - return DscNodeListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dnlr DscNodeListResult) IsEmpty() bool { - return dnlr.Value == nil || len(*dnlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dnlr DscNodeListResult) hasNextLink() bool { - return dnlr.NextLink != nil && len(*dnlr.NextLink) != 0 -} - -// dscNodeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dnlr DscNodeListResult) dscNodeListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dnlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dnlr.NextLink))) -} - -// DscNodeListResultPage contains a page of DscNode values. -type DscNodeListResultPage struct { - fn func(context.Context, DscNodeListResult) (DscNodeListResult, error) - dnlr DscNodeListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DscNodeListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dnlr) - if err != nil { - return err - } - page.dnlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DscNodeListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DscNodeListResultPage) NotDone() bool { - return !page.dnlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DscNodeListResultPage) Response() DscNodeListResult { - return page.dnlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DscNodeListResultPage) Values() []DscNode { - if page.dnlr.IsEmpty() { - return nil - } - return *page.dnlr.Value -} - -// Creates a new instance of the DscNodeListResultPage type. -func NewDscNodeListResultPage(cur DscNodeListResult, getNextPage func(context.Context, DscNodeListResult) (DscNodeListResult, error)) DscNodeListResultPage { - return DscNodeListResultPage{ - fn: getNextPage, - dnlr: cur, - } -} - -// DscNodeProperties the properties of a DscNode -type DscNodeProperties struct { - // LastSeen - Gets or sets the last seen time of the node. - LastSeen *date.Time `json:"lastSeen,omitempty"` - // RegistrationTime - Gets or sets the registration time of the node. - RegistrationTime *date.Time `json:"registrationTime,omitempty"` - // IP - Gets or sets the ip of the node. - IP *string `json:"ip,omitempty"` - // AccountID - Gets or sets the account id of the node. - AccountID *string `json:"accountId,omitempty"` - // DscNodeConfigurationAssociationProperty - Gets or sets the configuration of the node. - *DscNodeConfigurationAssociationProperty `json:"nodeConfiguration,omitempty"` - // Status - Gets or sets the status of the node. - Status *string `json:"status,omitempty"` - // NodeID - Gets or sets the node id. - NodeID *string `json:"nodeId,omitempty"` - // Etag - Gets or sets the etag of the resource. - Etag *string `json:"etag,omitempty"` - // TotalCount - Gets the total number of records matching filter criteria. - TotalCount *int32 `json:"totalCount,omitempty"` - // ExtensionHandler - Gets or sets the list of extensionHandler properties for a Node. - ExtensionHandler *[]DscNodeExtensionHandlerAssociationProperty `json:"extensionHandler,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscNodeProperties. -func (dnp DscNodeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dnp.LastSeen != nil { - objectMap["lastSeen"] = dnp.LastSeen - } - if dnp.RegistrationTime != nil { - objectMap["registrationTime"] = dnp.RegistrationTime - } - if dnp.IP != nil { - objectMap["ip"] = dnp.IP - } - if dnp.AccountID != nil { - objectMap["accountId"] = dnp.AccountID - } - if dnp.DscNodeConfigurationAssociationProperty != nil { - objectMap["nodeConfiguration"] = dnp.DscNodeConfigurationAssociationProperty - } - if dnp.Status != nil { - objectMap["status"] = dnp.Status - } - if dnp.NodeID != nil { - objectMap["nodeId"] = dnp.NodeID - } - if dnp.Etag != nil { - objectMap["etag"] = dnp.Etag - } - if dnp.TotalCount != nil { - objectMap["totalCount"] = dnp.TotalCount - } - if dnp.ExtensionHandler != nil { - objectMap["extensionHandler"] = dnp.ExtensionHandler - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscNodeProperties struct. -func (dnp *DscNodeProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "lastSeen": - if v != nil { - var lastSeen date.Time - err = json.Unmarshal(*v, &lastSeen) - if err != nil { - return err - } - dnp.LastSeen = &lastSeen - } - case "registrationTime": - if v != nil { - var registrationTime date.Time - err = json.Unmarshal(*v, ®istrationTime) - if err != nil { - return err - } - dnp.RegistrationTime = ®istrationTime - } - case "ip": - if v != nil { - var IP string - err = json.Unmarshal(*v, &IP) - if err != nil { - return err - } - dnp.IP = &IP - } - case "accountId": - if v != nil { - var accountID string - err = json.Unmarshal(*v, &accountID) - if err != nil { - return err - } - dnp.AccountID = &accountID - } - case "nodeConfiguration": - if v != nil { - var dscNodeConfigurationAssociationProperty DscNodeConfigurationAssociationProperty - err = json.Unmarshal(*v, &dscNodeConfigurationAssociationProperty) - if err != nil { - return err - } - dnp.DscNodeConfigurationAssociationProperty = &dscNodeConfigurationAssociationProperty - } - case "status": - if v != nil { - var status string - err = json.Unmarshal(*v, &status) - if err != nil { - return err - } - dnp.Status = &status - } - case "nodeId": - if v != nil { - var nodeID string - err = json.Unmarshal(*v, &nodeID) - if err != nil { - return err - } - dnp.NodeID = &nodeID - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - dnp.Etag = &etag - } - case "totalCount": - if v != nil { - var totalCount int32 - err = json.Unmarshal(*v, &totalCount) - if err != nil { - return err - } - dnp.TotalCount = &totalCount - } - case "extensionHandler": - if v != nil { - var extensionHandler []DscNodeExtensionHandlerAssociationProperty - err = json.Unmarshal(*v, &extensionHandler) - if err != nil { - return err - } - dnp.ExtensionHandler = &extensionHandler - } - } - } - - return nil -} - -// DscNodeReport definition of the dsc node report type. -type DscNodeReport struct { - autorest.Response `json:"-"` - // EndTime - Gets or sets the end time of the node report. - EndTime *date.Time `json:"endTime,omitempty"` - // LastModifiedTime - Gets or sets the lastModifiedTime of the node report. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // StartTime - Gets or sets the start time of the node report. - StartTime *date.Time `json:"startTime,omitempty"` - // Type - Gets or sets the type of the node report. - Type *string `json:"type,omitempty"` - // ReportID - Gets or sets the id of the node report. - ReportID *string `json:"reportId,omitempty"` - // Status - Gets or sets the status of the node report. - Status *string `json:"status,omitempty"` - // RefreshMode - Gets or sets the refreshMode of the node report. - RefreshMode *string `json:"refreshMode,omitempty"` - // RebootRequested - Gets or sets the rebootRequested of the node report. - RebootRequested *string `json:"rebootRequested,omitempty"` - // ReportFormatVersion - Gets or sets the reportFormatVersion of the node report. - ReportFormatVersion *string `json:"reportFormatVersion,omitempty"` - // ConfigurationVersion - Gets or sets the configurationVersion of the node report. - ConfigurationVersion *string `json:"configurationVersion,omitempty"` - // ID - Gets or sets the id. - ID *string `json:"id,omitempty"` - // Errors - Gets or sets the errors for the node report. - Errors *[]DscReportError `json:"errors,omitempty"` - // Resources - Gets or sets the resource for the node report. - Resources *[]DscReportResource `json:"resources,omitempty"` - // MetaConfiguration - Gets or sets the metaConfiguration of the node at the time of the report. - MetaConfiguration *DscMetaConfiguration `json:"metaConfiguration,omitempty"` - // HostName - Gets or sets the hostname of the node that sent the report. - HostName *string `json:"hostName,omitempty"` - // IPV4Addresses - Gets or sets the IPv4 address of the node that sent the report. - IPV4Addresses *[]string `json:"iPV4Addresses,omitempty"` - // IPV6Addresses - Gets or sets the IPv6 address of the node that sent the report. - IPV6Addresses *[]string `json:"iPV6Addresses,omitempty"` - // NumberOfResources - Gets or sets the number of resource in the node report. - NumberOfResources *int32 `json:"numberOfResources,omitempty"` - // RawErrors - Gets or sets the unparsed errors for the node report. - RawErrors *string `json:"rawErrors,omitempty"` -} - -// DscNodeReportListResult the response model for the list dsc nodes operation. -type DscNodeReportListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of dsc node reports. - Value *[]DscNodeReport `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// DscNodeReportListResultIterator provides access to a complete listing of DscNodeReport values. -type DscNodeReportListResultIterator struct { - i int - page DscNodeReportListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DscNodeReportListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeReportListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DscNodeReportListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DscNodeReportListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DscNodeReportListResultIterator) Response() DscNodeReportListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DscNodeReportListResultIterator) Value() DscNodeReport { - if !iter.page.NotDone() { - return DscNodeReport{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DscNodeReportListResultIterator type. -func NewDscNodeReportListResultIterator(page DscNodeReportListResultPage) DscNodeReportListResultIterator { - return DscNodeReportListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dnrlr DscNodeReportListResult) IsEmpty() bool { - return dnrlr.Value == nil || len(*dnrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dnrlr DscNodeReportListResult) hasNextLink() bool { - return dnrlr.NextLink != nil && len(*dnrlr.NextLink) != 0 -} - -// dscNodeReportListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dnrlr DscNodeReportListResult) dscNodeReportListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dnrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dnrlr.NextLink))) -} - -// DscNodeReportListResultPage contains a page of DscNodeReport values. -type DscNodeReportListResultPage struct { - fn func(context.Context, DscNodeReportListResult) (DscNodeReportListResult, error) - dnrlr DscNodeReportListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DscNodeReportListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeReportListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dnrlr) - if err != nil { - return err - } - page.dnrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DscNodeReportListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DscNodeReportListResultPage) NotDone() bool { - return !page.dnrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DscNodeReportListResultPage) Response() DscNodeReportListResult { - return page.dnrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DscNodeReportListResultPage) Values() []DscNodeReport { - if page.dnrlr.IsEmpty() { - return nil - } - return *page.dnrlr.Value -} - -// Creates a new instance of the DscNodeReportListResultPage type. -func NewDscNodeReportListResultPage(cur DscNodeReportListResult, getNextPage func(context.Context, DscNodeReportListResult) (DscNodeReportListResult, error)) DscNodeReportListResultPage { - return DscNodeReportListResultPage{ - fn: getNextPage, - dnrlr: cur, - } -} - -// DscNodeUpdateParameters the parameters supplied to the update dsc node operation. -type DscNodeUpdateParameters struct { - // NodeID - Gets or sets the id of the dsc node. - NodeID *string `json:"nodeId,omitempty"` - Properties *DscNodeUpdateParametersProperties `json:"properties,omitempty"` -} - -// DscNodeUpdateParametersProperties ... -type DscNodeUpdateParametersProperties struct { - // DscNodeConfigurationAssociationProperty - Gets or sets the configuration of the node. - *DscNodeConfigurationAssociationProperty `json:"nodeConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscNodeUpdateParametersProperties. -func (dnup DscNodeUpdateParametersProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dnup.DscNodeConfigurationAssociationProperty != nil { - objectMap["nodeConfiguration"] = dnup.DscNodeConfigurationAssociationProperty - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscNodeUpdateParametersProperties struct. -func (dnup *DscNodeUpdateParametersProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "nodeConfiguration": - if v != nil { - var dscNodeConfigurationAssociationProperty DscNodeConfigurationAssociationProperty - err = json.Unmarshal(*v, &dscNodeConfigurationAssociationProperty) - if err != nil { - return err - } - dnup.DscNodeConfigurationAssociationProperty = &dscNodeConfigurationAssociationProperty - } - } - } - - return nil -} - -// DscReportError definition of the dsc node report error type. -type DscReportError struct { - // ErrorSource - Gets or sets the source of the error. - ErrorSource *string `json:"errorSource,omitempty"` - // ResourceID - Gets or sets the resource ID which generated the error. - ResourceID *string `json:"resourceId,omitempty"` - // ErrorCode - Gets or sets the error code. - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - Gets or sets the error message. - ErrorMessage *string `json:"errorMessage,omitempty"` - // Locale - Gets or sets the locale of the error. - Locale *string `json:"locale,omitempty"` - // ErrorDetails - Gets or sets the error details. - ErrorDetails *string `json:"errorDetails,omitempty"` -} - -// DscReportResource definition of the DSC Report Resource. -type DscReportResource struct { - // ResourceID - Gets or sets the ID of the resource. - ResourceID *string `json:"resourceId,omitempty"` - // SourceInfo - Gets or sets the source info of the resource. - SourceInfo *string `json:"sourceInfo,omitempty"` - // DependsOn - Gets or sets the Resource Navigation values for resources the resource depends on. - DependsOn *[]DscReportResourceNavigation `json:"dependsOn,omitempty"` - // ModuleName - Gets or sets the module name of the resource. - ModuleName *string `json:"moduleName,omitempty"` - // ModuleVersion - Gets or sets the module version of the resource. - ModuleVersion *string `json:"moduleVersion,omitempty"` - // ResourceName - Gets or sets the name of the resource. - ResourceName *string `json:"resourceName,omitempty"` - // Error - Gets or sets the error of the resource. - Error *string `json:"error,omitempty"` - // Status - Gets or sets the status of the resource. - Status *string `json:"status,omitempty"` - // DurationInSeconds - Gets or sets the duration in seconds for the resource. - DurationInSeconds *float64 `json:"durationInSeconds,omitempty"` - // StartDate - Gets or sets the start date of the resource. - StartDate *date.Time `json:"startDate,omitempty"` -} - -// DscReportResourceNavigation navigation for DSC Report Resource. -type DscReportResourceNavigation struct { - // ResourceID - Gets or sets the ID of the resource to navigate to. - ResourceID *string `json:"resourceId,omitempty"` -} - -// EncryptionProperties the encryption settings for automation account -type EncryptionProperties struct { - // KeyVaultProperties - Key vault properties. - KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` - // KeySource - Encryption Key Source. Possible values include: 'EncryptionKeySourceTypeMicrosoftAutomation', 'EncryptionKeySourceTypeMicrosoftKeyvault' - KeySource EncryptionKeySourceType `json:"keySource,omitempty"` - // Identity - User identity used for CMK. - Identity *EncryptionPropertiesIdentity `json:"identity,omitempty"` -} - -// EncryptionPropertiesIdentity user identity used for CMK. -type EncryptionPropertiesIdentity struct { - // UserAssignedIdentity - The user identity used for CMK. It will be an ARM resource id in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentity interface{} `json:"userAssignedIdentity,omitempty"` -} - -// ErrorResponse error response of an operation failure -type ErrorResponse struct { - // Code - Error code - Code *string `json:"code,omitempty"` - // Message - Error message indicating why the operation failed. - Message *string `json:"message,omitempty"` -} - -// FieldDefinition definition of the connection fields. -type FieldDefinition struct { - // IsEncrypted - Gets or sets the isEncrypted flag of the connection field definition. - IsEncrypted *bool `json:"isEncrypted,omitempty"` - // IsOptional - Gets or sets the isOptional flag of the connection field definition. - IsOptional *bool `json:"isOptional,omitempty"` - // Type - Gets or sets the type of the connection field definition. - Type *string `json:"type,omitempty"` -} - -// HybridRunbookWorker definition of hybrid runbook worker. -type HybridRunbookWorker struct { - // Name - Gets or sets the worker machine name. - Name *string `json:"name,omitempty"` - // IP - Gets or sets the assigned machine IP address. - IP *string `json:"ip,omitempty"` - // RegistrationTime - Gets or sets the registration time of the worker machine. - RegistrationTime *date.Time `json:"registrationTime,omitempty"` - // LastSeenDateTime - Last Heartbeat from the Worker - LastSeenDateTime *date.Time `json:"lastSeenDateTime,omitempty"` -} - -// HybridRunbookWorkerGroup definition of hybrid runbook worker group. -type HybridRunbookWorkerGroup struct { - autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - Gets or sets the name of the group. - Name *string `json:"name,omitempty"` - // HybridRunbookWorkers - Gets or sets the list of hybrid runbook workers. - HybridRunbookWorkers *[]HybridRunbookWorker `json:"hybridRunbookWorkers,omitempty"` - // Credential - Sets the credential of a worker group. - Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` - // GroupType - Type of the HybridWorkerGroup. Possible values include: 'GroupTypeEnumUser', 'GroupTypeEnumSystem' - GroupType GroupTypeEnum `json:"groupType,omitempty"` -} - -// HybridRunbookWorkerGroupsListResult the response model for the list hybrid runbook worker groups. -type HybridRunbookWorkerGroupsListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of hybrid runbook worker groups. - Value *[]HybridRunbookWorkerGroup `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// HybridRunbookWorkerGroupsListResultIterator provides access to a complete listing of -// HybridRunbookWorkerGroup values. -type HybridRunbookWorkerGroupsListResultIterator struct { - i int - page HybridRunbookWorkerGroupsListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *HybridRunbookWorkerGroupsListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupsListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *HybridRunbookWorkerGroupsListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter HybridRunbookWorkerGroupsListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter HybridRunbookWorkerGroupsListResultIterator) Response() HybridRunbookWorkerGroupsListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter HybridRunbookWorkerGroupsListResultIterator) Value() HybridRunbookWorkerGroup { - if !iter.page.NotDone() { - return HybridRunbookWorkerGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the HybridRunbookWorkerGroupsListResultIterator type. -func NewHybridRunbookWorkerGroupsListResultIterator(page HybridRunbookWorkerGroupsListResultPage) HybridRunbookWorkerGroupsListResultIterator { - return HybridRunbookWorkerGroupsListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (hrwglr HybridRunbookWorkerGroupsListResult) IsEmpty() bool { - return hrwglr.Value == nil || len(*hrwglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (hrwglr HybridRunbookWorkerGroupsListResult) hasNextLink() bool { - return hrwglr.NextLink != nil && len(*hrwglr.NextLink) != 0 -} - -// hybridRunbookWorkerGroupsListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (hrwglr HybridRunbookWorkerGroupsListResult) hybridRunbookWorkerGroupsListResultPreparer(ctx context.Context) (*http.Request, error) { - if !hrwglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(hrwglr.NextLink))) -} - -// HybridRunbookWorkerGroupsListResultPage contains a page of HybridRunbookWorkerGroup values. -type HybridRunbookWorkerGroupsListResultPage struct { - fn func(context.Context, HybridRunbookWorkerGroupsListResult) (HybridRunbookWorkerGroupsListResult, error) - hrwglr HybridRunbookWorkerGroupsListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *HybridRunbookWorkerGroupsListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupsListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.hrwglr) - if err != nil { - return err - } - page.hrwglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *HybridRunbookWorkerGroupsListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page HybridRunbookWorkerGroupsListResultPage) NotDone() bool { - return !page.hrwglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page HybridRunbookWorkerGroupsListResultPage) Response() HybridRunbookWorkerGroupsListResult { - return page.hrwglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page HybridRunbookWorkerGroupsListResultPage) Values() []HybridRunbookWorkerGroup { - if page.hrwglr.IsEmpty() { - return nil - } - return *page.hrwglr.Value -} - -// Creates a new instance of the HybridRunbookWorkerGroupsListResultPage type. -func NewHybridRunbookWorkerGroupsListResultPage(cur HybridRunbookWorkerGroupsListResult, getNextPage func(context.Context, HybridRunbookWorkerGroupsListResult) (HybridRunbookWorkerGroupsListResult, error)) HybridRunbookWorkerGroupsListResultPage { - return HybridRunbookWorkerGroupsListResultPage{ - fn: getNextPage, - hrwglr: cur, - } -} - -// HybridRunbookWorkerGroupUpdateParameters parameters supplied to the update operation. -type HybridRunbookWorkerGroupUpdateParameters struct { - // Credential - Sets the credential of a worker group. - Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` -} - -// Identity identity for the resource. -type Identity struct { - // PrincipalID - READ-ONLY; The principal ID of resource identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant ID of resource. - TenantID *string `json:"tenantId,omitempty"` - // Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for Identity. -func (i Identity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if i.Type != "" { - objectMap["type"] = i.Type - } - if i.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = i.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// IdentityUserAssignedIdentitiesValue ... -type IdentityUserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for IdentityUserAssignedIdentitiesValue. -func (iAiv IdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Job definition of the job. -type Job struct { - autorest.Response `json:"-"` - // JobProperties - The properties of the job. - *JobProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Job. -func (j Job) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if j.JobProperties != nil { - objectMap["properties"] = j.JobProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Job struct. -func (j *Job) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var jobProperties JobProperties - err = json.Unmarshal(*v, &jobProperties) - if err != nil { - return err - } - j.JobProperties = &jobProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - j.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - j.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - j.Type = &typeVar - } - } - } - - return nil -} - -// JobCollectionItem job collection item properties. -type JobCollectionItem struct { - // JobCollectionItemProperties - Job properties. - *JobCollectionItemProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobCollectionItem. -func (jci JobCollectionItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jci.JobCollectionItemProperties != nil { - objectMap["properties"] = jci.JobCollectionItemProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobCollectionItem struct. -func (jci *JobCollectionItem) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var jobCollectionItemProperties JobCollectionItemProperties - err = json.Unmarshal(*v, &jobCollectionItemProperties) - if err != nil { - return err - } - jci.JobCollectionItemProperties = &jobCollectionItemProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - jci.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - jci.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - jci.Type = &typeVar - } - } - } - - return nil -} - -// JobCollectionItemProperties job collection item properties. -type JobCollectionItemProperties struct { - // Runbook - READ-ONLY; The runbook association. - Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` - // JobID - READ-ONLY; The id of the job. - JobID *uuid.UUID `json:"jobId,omitempty"` - // CreationTime - READ-ONLY; The creation time of the job. - CreationTime *date.Time `json:"creationTime,omitempty"` - // Status - READ-ONLY; The status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' - Status JobStatus `json:"status,omitempty"` - // StartTime - READ-ONLY; The start time of the job. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; The end time of the job. - EndTime *date.Time `json:"endTime,omitempty"` - // LastModifiedTime - READ-ONLY; The last modified time of the job. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of a resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // RunOn - Specifies the runOn group name where the job was executed. - RunOn *string `json:"runOn,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobCollectionItemProperties. -func (jcip JobCollectionItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jcip.RunOn != nil { - objectMap["runOn"] = jcip.RunOn - } - return json.Marshal(objectMap) -} - -// JobCreateParameters the parameters supplied to the create job operation. -type JobCreateParameters struct { - // JobCreateProperties - Gets or sets the list of job properties. - *JobCreateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobCreateParameters. -func (jcp JobCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jcp.JobCreateProperties != nil { - objectMap["properties"] = jcp.JobCreateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobCreateParameters struct. -func (jcp *JobCreateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var jobCreateProperties JobCreateProperties - err = json.Unmarshal(*v, &jobCreateProperties) - if err != nil { - return err - } - jcp.JobCreateProperties = &jobCreateProperties - } - } - } - - return nil -} - -// JobCreateProperties ... -type JobCreateProperties struct { - // Runbook - Gets or sets the runbook. - Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` - // Parameters - Gets or sets the parameters of the job. - Parameters map[string]*string `json:"parameters"` - // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. - RunOn *string `json:"runOn,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobCreateProperties. -func (jcp JobCreateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jcp.Runbook != nil { - objectMap["runbook"] = jcp.Runbook - } - if jcp.Parameters != nil { - objectMap["parameters"] = jcp.Parameters - } - if jcp.RunOn != nil { - objectMap["runOn"] = jcp.RunOn - } - return json.Marshal(objectMap) -} - -// JobListResultV2 the response model for the list job operation. -type JobListResultV2 struct { - autorest.Response `json:"-"` - // Value - List of jobs. - Value *[]JobCollectionItem `json:"value,omitempty"` - // NextLink - READ-ONLY; The link to the next page. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobListResultV2. -func (jlrv JobListResultV2) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jlrv.Value != nil { - objectMap["value"] = jlrv.Value - } - return json.Marshal(objectMap) -} - -// JobListResultV2Iterator provides access to a complete listing of JobCollectionItem values. -type JobListResultV2Iterator struct { - i int - page JobListResultV2Page -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JobListResultV2Iterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultV2Iterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobListResultV2Iterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobListResultV2Iterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter JobListResultV2Iterator) Response() JobListResultV2 { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JobListResultV2Iterator) Value() JobCollectionItem { - if !iter.page.NotDone() { - return JobCollectionItem{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobListResultV2Iterator type. -func NewJobListResultV2Iterator(page JobListResultV2Page) JobListResultV2Iterator { - return JobListResultV2Iterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jlrv JobListResultV2) IsEmpty() bool { - return jlrv.Value == nil || len(*jlrv.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (jlrv JobListResultV2) hasNextLink() bool { - return jlrv.NextLink != nil && len(*jlrv.NextLink) != 0 -} - -// jobListResultV2Preparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jlrv JobListResultV2) jobListResultV2Preparer(ctx context.Context) (*http.Request, error) { - if !jlrv.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jlrv.NextLink))) -} - -// JobListResultV2Page contains a page of JobCollectionItem values. -type JobListResultV2Page struct { - fn func(context.Context, JobListResultV2) (JobListResultV2, error) - jlrv JobListResultV2 -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JobListResultV2Page) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultV2Page.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.jlrv) - if err != nil { - return err - } - page.jlrv = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *JobListResultV2Page) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobListResultV2Page) NotDone() bool { - return !page.jlrv.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobListResultV2Page) Response() JobListResultV2 { - return page.jlrv -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobListResultV2Page) Values() []JobCollectionItem { - if page.jlrv.IsEmpty() { - return nil - } - return *page.jlrv.Value -} - -// Creates a new instance of the JobListResultV2Page type. -func NewJobListResultV2Page(cur JobListResultV2, getNextPage func(context.Context, JobListResultV2) (JobListResultV2, error)) JobListResultV2Page { - return JobListResultV2Page{ - fn: getNextPage, - jlrv: cur, - } -} - -// JobNavigation software update configuration machine run job navigation properties. -type JobNavigation struct { - // ID - READ-ONLY; Id of the job associated with the software update configuration run - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobNavigation. -func (jn JobNavigation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// JobProperties definition of job properties. -type JobProperties struct { - // Runbook - Gets or sets the runbook. - Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` - // StartedBy - Gets or sets the job started by. - StartedBy *string `json:"startedBy,omitempty"` - // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. - RunOn *string `json:"runOn,omitempty"` - // JobID - Gets or sets the id of the job. - JobID *uuid.UUID `json:"jobId,omitempty"` - // CreationTime - Gets or sets the creation time of the job. - CreationTime *date.Time `json:"creationTime,omitempty"` - // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' - Status JobStatus `json:"status,omitempty"` - // StatusDetails - Gets or sets the status details of the job. - StatusDetails *string `json:"statusDetails,omitempty"` - // StartTime - Gets or sets the start time of the job. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Gets or sets the end time of the job. - EndTime *date.Time `json:"endTime,omitempty"` - // Exception - Gets or sets the exception of the job. - Exception *string `json:"exception,omitempty"` - // LastModifiedTime - Gets or sets the last modified time of the job. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // LastStatusModifiedTime - Gets or sets the last status modified time of the job. - LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` - // Parameters - Gets or sets the parameters of the job. - Parameters map[string]*string `json:"parameters"` - // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' - ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobProperties. -func (jp JobProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jp.Runbook != nil { - objectMap["runbook"] = jp.Runbook - } - if jp.StartedBy != nil { - objectMap["startedBy"] = jp.StartedBy - } - if jp.RunOn != nil { - objectMap["runOn"] = jp.RunOn - } - if jp.JobID != nil { - objectMap["jobId"] = jp.JobID - } - if jp.CreationTime != nil { - objectMap["creationTime"] = jp.CreationTime - } - if jp.Status != "" { - objectMap["status"] = jp.Status - } - if jp.StatusDetails != nil { - objectMap["statusDetails"] = jp.StatusDetails - } - if jp.StartTime != nil { - objectMap["startTime"] = jp.StartTime - } - if jp.EndTime != nil { - objectMap["endTime"] = jp.EndTime - } - if jp.Exception != nil { - objectMap["exception"] = jp.Exception - } - if jp.LastModifiedTime != nil { - objectMap["lastModifiedTime"] = jp.LastModifiedTime - } - if jp.LastStatusModifiedTime != nil { - objectMap["lastStatusModifiedTime"] = jp.LastStatusModifiedTime - } - if jp.Parameters != nil { - objectMap["parameters"] = jp.Parameters - } - if jp.ProvisioningState != "" { - objectMap["provisioningState"] = jp.ProvisioningState - } - return json.Marshal(objectMap) -} - -// JobSchedule definition of the job schedule. -type JobSchedule struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Gets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Gets the name of the variable. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // JobScheduleProperties - Gets or sets the properties of the job schedule. - *JobScheduleProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobSchedule. -func (js JobSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if js.JobScheduleProperties != nil { - objectMap["properties"] = js.JobScheduleProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobSchedule struct. -func (js *JobSchedule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - js.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - js.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - js.Type = &typeVar - } - case "properties": - if v != nil { - var jobScheduleProperties JobScheduleProperties - err = json.Unmarshal(*v, &jobScheduleProperties) - if err != nil { - return err - } - js.JobScheduleProperties = &jobScheduleProperties - } - } - } - - return nil -} - -// JobScheduleCreateParameters the parameters supplied to the create job schedule operation. -type JobScheduleCreateParameters struct { - // JobScheduleCreateProperties - Gets or sets the list of job schedule properties. - *JobScheduleCreateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobScheduleCreateParameters. -func (jscp JobScheduleCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jscp.JobScheduleCreateProperties != nil { - objectMap["properties"] = jscp.JobScheduleCreateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobScheduleCreateParameters struct. -func (jscp *JobScheduleCreateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var jobScheduleCreateProperties JobScheduleCreateProperties - err = json.Unmarshal(*v, &jobScheduleCreateProperties) - if err != nil { - return err - } - jscp.JobScheduleCreateProperties = &jobScheduleCreateProperties - } - } - } - - return nil -} - -// JobScheduleCreateProperties the parameters supplied to the create job schedule operation. -type JobScheduleCreateProperties struct { - // Schedule - Gets or sets the schedule. - Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` - // Runbook - Gets or sets the runbook. - Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` - // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. - RunOn *string `json:"runOn,omitempty"` - // Parameters - Gets or sets a list of job properties. - Parameters map[string]*string `json:"parameters"` -} - -// MarshalJSON is the custom marshaler for JobScheduleCreateProperties. -func (jscp JobScheduleCreateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jscp.Schedule != nil { - objectMap["schedule"] = jscp.Schedule - } - if jscp.Runbook != nil { - objectMap["runbook"] = jscp.Runbook - } - if jscp.RunOn != nil { - objectMap["runOn"] = jscp.RunOn - } - if jscp.Parameters != nil { - objectMap["parameters"] = jscp.Parameters - } - return json.Marshal(objectMap) -} - -// JobScheduleListResult the response model for the list job schedule operation. -type JobScheduleListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of job schedules. - Value *[]JobSchedule `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// JobScheduleListResultIterator provides access to a complete listing of JobSchedule values. -type JobScheduleListResultIterator struct { - i int - page JobScheduleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JobScheduleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobScheduleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobScheduleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter JobScheduleListResultIterator) Response() JobScheduleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JobScheduleListResultIterator) Value() JobSchedule { - if !iter.page.NotDone() { - return JobSchedule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobScheduleListResultIterator type. -func NewJobScheduleListResultIterator(page JobScheduleListResultPage) JobScheduleListResultIterator { - return JobScheduleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jslr JobScheduleListResult) IsEmpty() bool { - return jslr.Value == nil || len(*jslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (jslr JobScheduleListResult) hasNextLink() bool { - return jslr.NextLink != nil && len(*jslr.NextLink) != 0 -} - -// jobScheduleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jslr JobScheduleListResult) jobScheduleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !jslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jslr.NextLink))) -} - -// JobScheduleListResultPage contains a page of JobSchedule values. -type JobScheduleListResultPage struct { - fn func(context.Context, JobScheduleListResult) (JobScheduleListResult, error) - jslr JobScheduleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JobScheduleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.jslr) - if err != nil { - return err - } - page.jslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *JobScheduleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobScheduleListResultPage) NotDone() bool { - return !page.jslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobScheduleListResultPage) Response() JobScheduleListResult { - return page.jslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobScheduleListResultPage) Values() []JobSchedule { - if page.jslr.IsEmpty() { - return nil - } - return *page.jslr.Value -} - -// Creates a new instance of the JobScheduleListResultPage type. -func NewJobScheduleListResultPage(cur JobScheduleListResult, getNextPage func(context.Context, JobScheduleListResult) (JobScheduleListResult, error)) JobScheduleListResultPage { - return JobScheduleListResultPage{ - fn: getNextPage, - jslr: cur, - } -} - -// JobScheduleProperties definition of job schedule parameters. -type JobScheduleProperties struct { - // JobScheduleID - Gets or sets the id of job schedule. - JobScheduleID *string `json:"jobScheduleId,omitempty"` - // Schedule - Gets or sets the schedule. - Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` - // Runbook - Gets or sets the runbook. - Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` - // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. - RunOn *string `json:"runOn,omitempty"` - // Parameters - Gets or sets the parameters of the job schedule. - Parameters map[string]*string `json:"parameters"` -} - -// MarshalJSON is the custom marshaler for JobScheduleProperties. -func (jsp JobScheduleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jsp.JobScheduleID != nil { - objectMap["jobScheduleId"] = jsp.JobScheduleID - } - if jsp.Schedule != nil { - objectMap["schedule"] = jsp.Schedule - } - if jsp.Runbook != nil { - objectMap["runbook"] = jsp.Runbook - } - if jsp.RunOn != nil { - objectMap["runOn"] = jsp.RunOn - } - if jsp.Parameters != nil { - objectMap["parameters"] = jsp.Parameters - } - return json.Marshal(objectMap) -} - -// JobStream definition of the job stream. -type JobStream struct { - autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. - ID *string `json:"id,omitempty"` - // JobStreamProperties - Gets or sets the id of the job stream. - *JobStreamProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobStream. -func (js JobStream) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if js.ID != nil { - objectMap["id"] = js.ID - } - if js.JobStreamProperties != nil { - objectMap["properties"] = js.JobStreamProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobStream struct. -func (js *JobStream) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - js.ID = &ID - } - case "properties": - if v != nil { - var jobStreamProperties JobStreamProperties - err = json.Unmarshal(*v, &jobStreamProperties) - if err != nil { - return err - } - js.JobStreamProperties = &jobStreamProperties - } - } - } - - return nil -} - -// JobStreamListResult the response model for the list job stream operation. -type JobStreamListResult struct { - autorest.Response `json:"-"` - // Value - A list of job streams. - Value *[]JobStream `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// JobStreamListResultIterator provides access to a complete listing of JobStream values. -type JobStreamListResultIterator struct { - i int - page JobStreamListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JobStreamListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobStreamListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobStreamListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter JobStreamListResultIterator) Response() JobStreamListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JobStreamListResultIterator) Value() JobStream { - if !iter.page.NotDone() { - return JobStream{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobStreamListResultIterator type. -func NewJobStreamListResultIterator(page JobStreamListResultPage) JobStreamListResultIterator { - return JobStreamListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jslr JobStreamListResult) IsEmpty() bool { - return jslr.Value == nil || len(*jslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (jslr JobStreamListResult) hasNextLink() bool { - return jslr.NextLink != nil && len(*jslr.NextLink) != 0 -} - -// jobStreamListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jslr JobStreamListResult) jobStreamListResultPreparer(ctx context.Context) (*http.Request, error) { - if !jslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jslr.NextLink))) -} - -// JobStreamListResultPage contains a page of JobStream values. -type JobStreamListResultPage struct { - fn func(context.Context, JobStreamListResult) (JobStreamListResult, error) - jslr JobStreamListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JobStreamListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.jslr) - if err != nil { - return err - } - page.jslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *JobStreamListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobStreamListResultPage) NotDone() bool { - return !page.jslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobStreamListResultPage) Response() JobStreamListResult { - return page.jslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobStreamListResultPage) Values() []JobStream { - if page.jslr.IsEmpty() { - return nil - } - return *page.jslr.Value -} - -// Creates a new instance of the JobStreamListResultPage type. -func NewJobStreamListResultPage(cur JobStreamListResult, getNextPage func(context.Context, JobStreamListResult) (JobStreamListResult, error)) JobStreamListResultPage { - return JobStreamListResultPage{ - fn: getNextPage, - jslr: cur, - } -} - -// JobStreamProperties definition of the job stream. -type JobStreamProperties struct { - // JobStreamID - Gets or sets the id of the job stream. - JobStreamID *string `json:"jobStreamId,omitempty"` - // Time - Gets or sets the creation time of the job. - Time *date.Time `json:"time,omitempty"` - // StreamType - Gets or sets the stream type. Possible values include: 'JobStreamTypeProgress', 'JobStreamTypeOutput', 'JobStreamTypeWarning', 'JobStreamTypeError', 'JobStreamTypeDebug', 'JobStreamTypeVerbose', 'JobStreamTypeAny' - StreamType JobStreamType `json:"streamType,omitempty"` - // StreamText - Gets or sets the stream text. - StreamText *string `json:"streamText,omitempty"` - // Summary - Gets or sets the summary. - Summary *string `json:"summary,omitempty"` - // Value - Gets or sets the values of the job stream. - Value map[string]interface{} `json:"value"` -} - -// MarshalJSON is the custom marshaler for JobStreamProperties. -func (jsp JobStreamProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jsp.JobStreamID != nil { - objectMap["jobStreamId"] = jsp.JobStreamID - } - if jsp.Time != nil { - objectMap["time"] = jsp.Time - } - if jsp.StreamType != "" { - objectMap["streamType"] = jsp.StreamType - } - if jsp.StreamText != nil { - objectMap["streamText"] = jsp.StreamText - } - if jsp.Summary != nil { - objectMap["summary"] = jsp.Summary - } - if jsp.Value != nil { - objectMap["value"] = jsp.Value - } - return json.Marshal(objectMap) -} - -// Key automation key which is used to register a DSC Node -type Key struct { - // KeyName - READ-ONLY; Automation key name. Possible values include: 'KeyNamePrimary', 'KeyNameSecondary' - KeyName KeyName `json:"KeyName,omitempty"` - // Permissions - READ-ONLY; Automation key permissions. Possible values include: 'KeyPermissionsRead', 'KeyPermissionsFull' - Permissions KeyPermissions `json:"Permissions,omitempty"` - // Value - READ-ONLY; Value of the Automation Key used for registration. - Value *string `json:"Value,omitempty"` -} - -// MarshalJSON is the custom marshaler for Key. -func (kVar Key) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// KeyListResult ... -type KeyListResult struct { - autorest.Response `json:"-"` - // Keys - Lists the automation keys. - Keys *[]Key `json:"keys,omitempty"` -} - -// KeyVaultProperties settings concerning key vault encryption for a configuration store. -type KeyVaultProperties struct { - // KeyvaultURI - The URI of the key vault key used to encrypt data. - KeyvaultURI *string `json:"keyvaultUri,omitempty"` - // KeyName - The name of key used to encrypt data. - KeyName *string `json:"keyName,omitempty"` - // KeyVersion - The key version of the key used to encrypt data. - KeyVersion *string `json:"keyVersion,omitempty"` -} - -// LinkedWorkspace definition of the linked workspace. -type LinkedWorkspace struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Gets the id of the linked workspace. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for LinkedWorkspace. -func (lw LinkedWorkspace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// LinuxProperties linux specific update configuration. -type LinuxProperties struct { - // IncludedPackageClassifications - Update classifications included in the software update configuration. Possible values include: 'LinuxUpdateClassesUnclassified', 'LinuxUpdateClassesCritical', 'LinuxUpdateClassesSecurity', 'LinuxUpdateClassesOther' - IncludedPackageClassifications LinuxUpdateClasses `json:"includedPackageClassifications,omitempty"` - // ExcludedPackageNameMasks - packages excluded from the software update configuration. - ExcludedPackageNameMasks *[]string `json:"excludedPackageNameMasks,omitempty"` - // IncludedPackageNameMasks - packages included from the software update configuration. - IncludedPackageNameMasks *[]string `json:"includedPackageNameMasks,omitempty"` - // RebootSetting - Reboot setting for the software update configuration. - RebootSetting *string `json:"rebootSetting,omitempty"` -} - -// Module definition of the module type. -type Module struct { - autorest.Response `json:"-"` - // ModuleProperties - Gets or sets the module properties. - *ModuleProperties `json:"properties,omitempty"` - // Etag - Gets or sets the etag of the resource. - Etag *string `json:"etag,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The Azure Region where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Module. -func (mVar Module) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mVar.ModuleProperties != nil { - objectMap["properties"] = mVar.ModuleProperties - } - if mVar.Etag != nil { - objectMap["etag"] = mVar.Etag - } - if mVar.Tags != nil { - objectMap["tags"] = mVar.Tags - } - if mVar.Location != nil { - objectMap["location"] = mVar.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Module struct. -func (mVar *Module) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var moduleProperties ModuleProperties - err = json.Unmarshal(*v, &moduleProperties) - if err != nil { - return err - } - mVar.ModuleProperties = &moduleProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - mVar.Etag = &etag - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - mVar.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - mVar.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mVar.Type = &typeVar - } - } - } - - return nil -} - -// ModuleCreateOrUpdateParameters the parameters supplied to the create or update module operation. -type ModuleCreateOrUpdateParameters struct { - // ModuleCreateOrUpdateProperties - Gets or sets the module create properties. - *ModuleCreateOrUpdateProperties `json:"properties,omitempty"` - // Name - Gets or sets name of the resource. - Name *string `json:"name,omitempty"` - // Location - Gets or sets the location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ModuleCreateOrUpdateParameters. -func (mcoup ModuleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mcoup.ModuleCreateOrUpdateProperties != nil { - objectMap["properties"] = mcoup.ModuleCreateOrUpdateProperties - } - if mcoup.Name != nil { - objectMap["name"] = mcoup.Name - } - if mcoup.Location != nil { - objectMap["location"] = mcoup.Location - } - if mcoup.Tags != nil { - objectMap["tags"] = mcoup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ModuleCreateOrUpdateParameters struct. -func (mcoup *ModuleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var moduleCreateOrUpdateProperties ModuleCreateOrUpdateProperties - err = json.Unmarshal(*v, &moduleCreateOrUpdateProperties) - if err != nil { - return err - } - mcoup.ModuleCreateOrUpdateProperties = &moduleCreateOrUpdateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mcoup.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - mcoup.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - mcoup.Tags = tags - } - } - } - - return nil -} - -// ModuleCreateOrUpdateProperties the parameters supplied to the create or update module properties. -type ModuleCreateOrUpdateProperties struct { - // ContentLink - Gets or sets the module content link. - ContentLink *ContentLink `json:"contentLink,omitempty"` -} - -// ModuleErrorInfo definition of the module error info type. -type ModuleErrorInfo struct { - // Code - Gets or sets the error code. - Code *string `json:"code,omitempty"` - // Message - Gets or sets the error message. - Message *string `json:"message,omitempty"` -} - -// ModuleListResult the response model for the list module operation. -type ModuleListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of modules. - Value *[]Module `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// ModuleListResultIterator provides access to a complete listing of Module values. -type ModuleListResultIterator struct { - i int - page ModuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ModuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ModuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ModuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ModuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ModuleListResultIterator) Response() ModuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ModuleListResultIterator) Value() Module { - if !iter.page.NotDone() { - return Module{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ModuleListResultIterator type. -func NewModuleListResultIterator(page ModuleListResultPage) ModuleListResultIterator { - return ModuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (mlr ModuleListResult) IsEmpty() bool { - return mlr.Value == nil || len(*mlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (mlr ModuleListResult) hasNextLink() bool { - return mlr.NextLink != nil && len(*mlr.NextLink) != 0 -} - -// moduleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mlr ModuleListResult) moduleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !mlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mlr.NextLink))) -} - -// ModuleListResultPage contains a page of Module values. -type ModuleListResultPage struct { - fn func(context.Context, ModuleListResult) (ModuleListResult, error) - mlr ModuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ModuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ModuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.mlr) - if err != nil { - return err - } - page.mlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ModuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ModuleListResultPage) NotDone() bool { - return !page.mlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ModuleListResultPage) Response() ModuleListResult { - return page.mlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ModuleListResultPage) Values() []Module { - if page.mlr.IsEmpty() { - return nil - } - return *page.mlr.Value -} - -// Creates a new instance of the ModuleListResultPage type. -func NewModuleListResultPage(cur ModuleListResult, getNextPage func(context.Context, ModuleListResult) (ModuleListResult, error)) ModuleListResultPage { - return ModuleListResultPage{ - fn: getNextPage, - mlr: cur, - } -} - -// ModuleProperties definition of the module property type. -type ModuleProperties struct { - // IsGlobal - Gets or sets the isGlobal flag of the module. - IsGlobal *bool `json:"isGlobal,omitempty"` - // Version - Gets or sets the version of the module. - Version *string `json:"version,omitempty"` - // SizeInBytes - Gets or sets the size in bytes of the module. - SizeInBytes *int64 `json:"sizeInBytes,omitempty"` - // ActivityCount - Gets or sets the activity count of the module. - ActivityCount *int32 `json:"activityCount,omitempty"` - // ProvisioningState - Gets or sets the provisioning state of the module. Possible values include: 'ModuleProvisioningStateCreated', 'ModuleProvisioningStateCreating', 'ModuleProvisioningStateStartingImportModuleRunbook', 'ModuleProvisioningStateRunningImportModuleRunbook', 'ModuleProvisioningStateContentRetrieved', 'ModuleProvisioningStateContentDownloaded', 'ModuleProvisioningStateContentValidated', 'ModuleProvisioningStateConnectionTypeImported', 'ModuleProvisioningStateContentStored', 'ModuleProvisioningStateModuleDataStored', 'ModuleProvisioningStateActivitiesStored', 'ModuleProvisioningStateModuleImportRunbookComplete', 'ModuleProvisioningStateSucceeded', 'ModuleProvisioningStateFailed', 'ModuleProvisioningStateCancelled', 'ModuleProvisioningStateUpdating' - ProvisioningState ModuleProvisioningState `json:"provisioningState,omitempty"` - // ContentLink - Gets or sets the contentLink of the module. - ContentLink *ContentLink `json:"contentLink,omitempty"` - // Error - Gets or sets the error info of the module. - Error *ModuleErrorInfo `json:"error,omitempty"` - // CreationTime - Gets or sets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` - // IsComposite - Gets or sets type of module, if its composite or not. - IsComposite *bool `json:"isComposite,omitempty"` -} - -// ModuleUpdateParameters the parameters supplied to the update module operation. -type ModuleUpdateParameters struct { - // ModuleUpdateProperties - Gets or sets the module update properties. - *ModuleUpdateProperties `json:"properties,omitempty"` - // Name - Gets or sets name of the resource. - Name *string `json:"name,omitempty"` - // Location - Gets or sets the location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ModuleUpdateParameters. -func (mup ModuleUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mup.ModuleUpdateProperties != nil { - objectMap["properties"] = mup.ModuleUpdateProperties - } - if mup.Name != nil { - objectMap["name"] = mup.Name - } - if mup.Location != nil { - objectMap["location"] = mup.Location - } - if mup.Tags != nil { - objectMap["tags"] = mup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ModuleUpdateParameters struct. -func (mup *ModuleUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var moduleUpdateProperties ModuleUpdateProperties - err = json.Unmarshal(*v, &moduleUpdateProperties) - if err != nil { - return err - } - mup.ModuleUpdateProperties = &moduleUpdateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mup.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - mup.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - mup.Tags = tags - } - } - } - - return nil -} - -// ModuleUpdateProperties the parameters supplied to the update properties. -type ModuleUpdateProperties struct { - // ContentLink - Gets or sets the module content link. - ContentLink *ContentLink `json:"contentLink,omitempty"` -} - -// NodeCount number of nodes based on the Filter -type NodeCount struct { - // Name - Gets the name of a count type - Name *string `json:"name,omitempty"` - Properties *NodeCountProperties `json:"properties,omitempty"` -} - -// NodeCountProperties ... -type NodeCountProperties struct { - // Count - Gets the count for the name - Count *int32 `json:"count,omitempty"` -} - -// NodeCounts gets the count of nodes by count type -type NodeCounts struct { - autorest.Response `json:"-"` - // Value - Gets an array of counts - Value *[]NodeCount `json:"value,omitempty"` - // TotalCount - Gets the total number of records matching countType criteria. - TotalCount *int32 `json:"totalCount,omitempty"` -} - -// NonAzureQueryProperties non Azure query for the update configuration. -type NonAzureQueryProperties struct { - // FunctionAlias - Log Analytics Saved Search name. - FunctionAlias *string `json:"functionAlias,omitempty"` - // WorkspaceID - Workspace Id for Log Analytics in which the saved Search is resided. - WorkspaceID *string `json:"workspaceId,omitempty"` -} - -// Operation automation REST API operation -type Operation struct { - // Name - Operation name: {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` - // Display - Provider, Resource and Operation values - Display *OperationDisplay `json:"display,omitempty"` -} - -// OperationDisplay provider, Resource and Operation values -type OperationDisplay struct { - // Provider - Service provider: Microsoft.Automation - Provider *string `json:"provider,omitempty"` - // Resource - Resource on which the operation is performed: Runbooks, Jobs etc. - Resource *string `json:"resource,omitempty"` - // Operation - Operation type: Read, write, delete, etc. - Operation *string `json:"operation,omitempty"` -} - -// OperationListResult the response model for the list of Automation operations -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - List of Automation operations supported by the Automation resource provider. - Value *[]Operation `json:"value,omitempty"` -} - -// PrivateEndpointConnection a private endpoint connection -type PrivateEndpointConnection struct { - autorest.Response `json:"-"` - // PrivateEndpointConnectionProperties - Resource properties. - *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnection. -func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pec.PrivateEndpointConnectionProperties != nil { - objectMap["properties"] = pec.PrivateEndpointConnectionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. -func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateEndpointConnectionProperties PrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &privateEndpointConnectionProperties) - if err != nil { - return err - } - pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pec.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pec.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pec.Type = &typeVar - } - } - } - - return nil -} - -// PrivateEndpointConnectionListResult a list of private endpoint connections -type PrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - Array of private endpoint connections - Value *[]PrivateEndpointConnection `json:"value,omitempty"` -} - -// PrivateEndpointConnectionProperties properties of a private endpoint connection. -type PrivateEndpointConnectionProperties struct { - // PrivateEndpoint - Private endpoint which the connection belongs to. - PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` -} - -// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type PrivateEndpointConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) 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 PrivateEndpointConnectionsCreateOrUpdateFuture.Result. -func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pec.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("automation.PrivateEndpointConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { - pec, err = client.CreateOrUpdateResponder(pec.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. -func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("automation.PrivateEndpointConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateEndpointProperty private endpoint which the connection belongs to. -type PrivateEndpointProperty struct { - // ID - Resource id of the private endpoint. - ID *string `json:"id,omitempty"` -} - -// PrivateLinkResource a private link resource -type PrivateLinkResource struct { - // PrivateLinkResourceProperties - Resource properties. - *PrivateLinkResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResource. -func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plr.PrivateLinkResourceProperties != nil { - objectMap["properties"] = plr.PrivateLinkResourceProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. -func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateLinkResourceProperties PrivateLinkResourceProperties - err = json.Unmarshal(*v, &privateLinkResourceProperties) - if err != nil { - return err - } - plr.PrivateLinkResourceProperties = &privateLinkResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - plr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - plr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - plr.Type = &typeVar - } - } - } - - return nil -} - -// PrivateLinkResourceListResult a list of private link resources -type PrivateLinkResourceListResult struct { - autorest.Response `json:"-"` - // Value - Array of private link resources - Value *[]PrivateLinkResource `json:"value,omitempty"` -} - -// PrivateLinkResourceProperties properties of a private link resource. -type PrivateLinkResourceProperties struct { - // GroupID - READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty"` - // RequiredMembers - READ-ONLY; The private link resource required member names. - RequiredMembers *[]string `json:"requiredMembers,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. -func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PrivateLinkServiceConnectionStateProperty connection State of the Private Endpoint Connection. -type PrivateLinkServiceConnectionStateProperty struct { - // Status - The private link service connection status. - Status *string `json:"status,omitempty"` - // Description - The private link service connection description. - Description *string `json:"description,omitempty"` - // ActionsRequired - READ-ONLY; Any action that is required beyond basic workflow (approve/ reject/ disconnect) - ActionsRequired *string `json:"actionsRequired,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty. -func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plscsp.Status != nil { - objectMap["status"] = plscsp.Status - } - if plscsp.Description != nil { - objectMap["description"] = plscsp.Description - } - return json.Marshal(objectMap) -} - -// ProxyResource ARM proxy resource. -type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PythonPackageCreateParameters the parameters supplied to the create or update module operation. -type PythonPackageCreateParameters struct { - // PythonPackageCreateProperties - Gets or sets the module create properties. - *PythonPackageCreateProperties `json:"properties,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PythonPackageCreateParameters. -func (ppcp PythonPackageCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppcp.PythonPackageCreateProperties != nil { - objectMap["properties"] = ppcp.PythonPackageCreateProperties - } - if ppcp.Tags != nil { - objectMap["tags"] = ppcp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PythonPackageCreateParameters struct. -func (ppcp *PythonPackageCreateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var pythonPackageCreateProperties PythonPackageCreateProperties - err = json.Unmarshal(*v, &pythonPackageCreateProperties) - if err != nil { - return err - } - ppcp.PythonPackageCreateProperties = &pythonPackageCreateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ppcp.Tags = tags - } - } - } - - return nil -} - -// PythonPackageCreateProperties the parameters supplied to the create or update module properties. -type PythonPackageCreateProperties struct { - // ContentLink - Gets or sets the module content link. - ContentLink *ContentLink `json:"contentLink,omitempty"` -} - -// PythonPackageUpdateParameters the parameters supplied to the update module operation. -type PythonPackageUpdateParameters struct { - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PythonPackageUpdateParameters. -func (ppup PythonPackageUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppup.Tags != nil { - objectMap["tags"] = ppup.Tags - } - return json.Marshal(objectMap) -} - -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - -// Resource the core properties of ARM resources -type Resource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RunAsCredentialAssociationProperty definition of RunAs credential to use for hybrid worker. -type RunAsCredentialAssociationProperty struct { - // Name - Gets or sets the name of the credential. - Name *string `json:"name,omitempty"` -} - -// Runbook definition of the runbook type. -type Runbook struct { - autorest.Response `json:"-"` - // RunbookProperties - Gets or sets the runbook properties. - *RunbookProperties `json:"properties,omitempty"` - // Etag - Gets or sets the etag of the resource. - Etag *string `json:"etag,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The Azure Region where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Runbook. -func (r Runbook) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.RunbookProperties != nil { - objectMap["properties"] = r.RunbookProperties - } - if r.Etag != nil { - objectMap["etag"] = r.Etag - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - if r.Location != nil { - objectMap["location"] = r.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Runbook struct. -func (r *Runbook) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var runbookProperties RunbookProperties - err = json.Unmarshal(*v, &runbookProperties) - if err != nil { - return err - } - r.RunbookProperties = &runbookProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - r.Etag = &etag - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - r.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - r.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - r.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - r.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - r.Type = &typeVar - } - } - } - - return nil -} - -// RunbookAssociationProperty the runbook property associated with the entity. -type RunbookAssociationProperty struct { - // Name - Gets or sets the name of the runbook. - Name *string `json:"name,omitempty"` -} - -// RunbookCreateOrUpdateDraftParameters the parameters supplied to the create or update runbook operation. -type RunbookCreateOrUpdateDraftParameters struct { - // RunbookContent - Content of the Runbook. - RunbookContent *string `json:"runbookContent,omitempty"` -} - -// RunbookCreateOrUpdateDraftProperties the parameters supplied to the create or update draft runbook -// properties. -type RunbookCreateOrUpdateDraftProperties struct { - // LogVerbose - Gets or sets verbose log option. - LogVerbose *bool `json:"logVerbose,omitempty"` - // LogProgress - Gets or sets progress log option. - LogProgress *bool `json:"logProgress,omitempty"` - // RunbookType - Gets or sets the type of the runbook. Possible values include: 'RunbookTypeEnumScript', 'RunbookTypeEnumGraph', 'RunbookTypeEnumPowerShellWorkflow', 'RunbookTypeEnumPowerShell', 'RunbookTypeEnumGraphPowerShellWorkflow', 'RunbookTypeEnumGraphPowerShell' - RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` - // Draft - Gets or sets the draft runbook properties. - Draft *RunbookDraft `json:"draft,omitempty"` - // Description - Gets or sets the description of the runbook. - Description *string `json:"description,omitempty"` - // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. - LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` -} - -// RunbookCreateOrUpdateParameters the parameters supplied to the create or update runbook operation. -type RunbookCreateOrUpdateParameters struct { - // RunbookCreateOrUpdateProperties - Gets or sets runbook create or update properties. - *RunbookCreateOrUpdateProperties `json:"properties,omitempty"` - // Name - Gets or sets the name of the resource. - Name *string `json:"name,omitempty"` - // Location - Gets or sets the location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RunbookCreateOrUpdateParameters. -func (rcoup RunbookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rcoup.RunbookCreateOrUpdateProperties != nil { - objectMap["properties"] = rcoup.RunbookCreateOrUpdateProperties - } - if rcoup.Name != nil { - objectMap["name"] = rcoup.Name - } - if rcoup.Location != nil { - objectMap["location"] = rcoup.Location - } - if rcoup.Tags != nil { - objectMap["tags"] = rcoup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RunbookCreateOrUpdateParameters struct. -func (rcoup *RunbookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var runbookCreateOrUpdateProperties RunbookCreateOrUpdateProperties - err = json.Unmarshal(*v, &runbookCreateOrUpdateProperties) - if err != nil { - return err - } - rcoup.RunbookCreateOrUpdateProperties = &runbookCreateOrUpdateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rcoup.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rcoup.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rcoup.Tags = tags - } - } - } - - return nil -} - -// RunbookCreateOrUpdateProperties the parameters supplied to the create or update runbook properties. -type RunbookCreateOrUpdateProperties struct { - // LogVerbose - Gets or sets verbose log option. - LogVerbose *bool `json:"logVerbose,omitempty"` - // LogProgress - Gets or sets progress log option. - LogProgress *bool `json:"logProgress,omitempty"` - // RunbookType - Gets or sets the type of the runbook. Possible values include: 'RunbookTypeEnumScript', 'RunbookTypeEnumGraph', 'RunbookTypeEnumPowerShellWorkflow', 'RunbookTypeEnumPowerShell', 'RunbookTypeEnumGraphPowerShellWorkflow', 'RunbookTypeEnumGraphPowerShell' - RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` - // Draft - Gets or sets the draft runbook properties. - Draft *RunbookDraft `json:"draft,omitempty"` - // PublishContentLink - Gets or sets the published runbook content link. - PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` - // Description - Gets or sets the description of the runbook. - Description *string `json:"description,omitempty"` - // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. - LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` -} - -// RunbookDraft ... -type RunbookDraft struct { - autorest.Response `json:"-"` - // InEdit - Gets or sets whether runbook is in edit mode. - InEdit *bool `json:"inEdit,omitempty"` - // DraftContentLink - Gets or sets the draft runbook content link. - DraftContentLink *ContentLink `json:"draftContentLink,omitempty"` - // CreationTime - Gets or sets the creation time of the runbook draft. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - Gets or sets the last modified time of the runbook draft. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Parameters - Gets or sets the runbook draft parameters. - Parameters map[string]*RunbookParameter `json:"parameters"` - // OutputTypes - Gets or sets the runbook output types. - OutputTypes *[]string `json:"outputTypes,omitempty"` -} - -// MarshalJSON is the custom marshaler for RunbookDraft. -func (rd RunbookDraft) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rd.InEdit != nil { - objectMap["inEdit"] = rd.InEdit - } - if rd.DraftContentLink != nil { - objectMap["draftContentLink"] = rd.DraftContentLink - } - if rd.CreationTime != nil { - objectMap["creationTime"] = rd.CreationTime - } - if rd.LastModifiedTime != nil { - objectMap["lastModifiedTime"] = rd.LastModifiedTime - } - if rd.Parameters != nil { - objectMap["parameters"] = rd.Parameters - } - if rd.OutputTypes != nil { - objectMap["outputTypes"] = rd.OutputTypes - } - return json.Marshal(objectMap) -} - -// RunbookDraftReplaceContentFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RunbookDraftReplaceContentFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RunbookDraftClient) (ReadCloser, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RunbookDraftReplaceContentFuture) 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 RunbookDraftReplaceContentFuture.Result. -func (future *RunbookDraftReplaceContentFuture) result(client RunbookDraftClient) (rc ReadCloser, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("automation.RunbookDraftReplaceContentFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rc.Response.Response, err = future.GetResult(sender); err == nil && rc.Response.Response.StatusCode != http.StatusNoContent { - rc, err = client.ReplaceContentResponder(rc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", rc.Response.Response, "Failure responding to request") - } - } - return -} - -// RunbookDraftUndoEditResult the response model for the undo edit runbook operation. -type RunbookDraftUndoEditResult struct { - autorest.Response `json:"-"` - // StatusCode - Possible values include: 'HTTPStatusCodeContinue', 'HTTPStatusCodeSwitchingProtocols', 'HTTPStatusCodeOK', 'HTTPStatusCodeCreated', 'HTTPStatusCodeAccepted', 'HTTPStatusCodeNonAuthoritativeInformation', 'HTTPStatusCodeNoContent', 'HTTPStatusCodeResetContent', 'HTTPStatusCodePartialContent', 'HTTPStatusCodeMultipleChoices', 'HTTPStatusCodeAmbiguous', 'HTTPStatusCodeMovedPermanently', 'HTTPStatusCodeMoved', 'HTTPStatusCodeFound', 'HTTPStatusCodeRedirect', 'HTTPStatusCodeSeeOther', 'HTTPStatusCodeRedirectMethod', 'HTTPStatusCodeNotModified', 'HTTPStatusCodeUseProxy', 'HTTPStatusCodeUnused', 'HTTPStatusCodeTemporaryRedirect', 'HTTPStatusCodeRedirectKeepVerb', 'HTTPStatusCodeBadRequest', 'HTTPStatusCodeUnauthorized', 'HTTPStatusCodePaymentRequired', 'HTTPStatusCodeForbidden', 'HTTPStatusCodeNotFound', 'HTTPStatusCodeMethodNotAllowed', 'HTTPStatusCodeNotAcceptable', 'HTTPStatusCodeProxyAuthenticationRequired', 'HTTPStatusCodeRequestTimeout', 'HTTPStatusCodeConflict', 'HTTPStatusCodeGone', 'HTTPStatusCodeLengthRequired', 'HTTPStatusCodePreconditionFailed', 'HTTPStatusCodeRequestEntityTooLarge', 'HTTPStatusCodeRequestURITooLong', 'HTTPStatusCodeUnsupportedMediaType', 'HTTPStatusCodeRequestedRangeNotSatisfiable', 'HTTPStatusCodeExpectationFailed', 'HTTPStatusCodeUpgradeRequired', 'HTTPStatusCodeInternalServerError', 'HTTPStatusCodeNotImplemented', 'HTTPStatusCodeBadGateway', 'HTTPStatusCodeServiceUnavailable', 'HTTPStatusCodeGatewayTimeout', 'HTTPStatusCodeHTTPVersionNotSupported' - StatusCode HTTPStatusCode `json:"statusCode,omitempty"` - RequestID *string `json:"requestId,omitempty"` -} - -// RunbookListResult the response model for the list runbook operation. -type RunbookListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of runbooks. - Value *[]Runbook `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// RunbookListResultIterator provides access to a complete listing of Runbook values. -type RunbookListResultIterator struct { - i int - page RunbookListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RunbookListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RunbookListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RunbookListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RunbookListResultIterator) Response() RunbookListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RunbookListResultIterator) Value() Runbook { - if !iter.page.NotDone() { - return Runbook{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RunbookListResultIterator type. -func NewRunbookListResultIterator(page RunbookListResultPage) RunbookListResultIterator { - return RunbookListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rlr RunbookListResult) IsEmpty() bool { - return rlr.Value == nil || len(*rlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rlr RunbookListResult) hasNextLink() bool { - return rlr.NextLink != nil && len(*rlr.NextLink) != 0 -} - -// runbookListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rlr RunbookListResult) runbookListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rlr.NextLink))) -} - -// RunbookListResultPage contains a page of Runbook values. -type RunbookListResultPage struct { - fn func(context.Context, RunbookListResult) (RunbookListResult, error) - rlr RunbookListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RunbookListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err - } - page.rlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RunbookListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RunbookListResultPage) NotDone() bool { - return !page.rlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RunbookListResultPage) Response() RunbookListResult { - return page.rlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RunbookListResultPage) Values() []Runbook { - if page.rlr.IsEmpty() { - return nil - } - return *page.rlr.Value -} - -// Creates a new instance of the RunbookListResultPage type. -func NewRunbookListResultPage(cur RunbookListResult, getNextPage func(context.Context, RunbookListResult) (RunbookListResult, error)) RunbookListResultPage { - return RunbookListResultPage{ - fn: getNextPage, - rlr: cur, - } -} - -// RunbookParameter definition of the runbook parameter type. -type RunbookParameter struct { - // Type - Gets or sets the type of the parameter. - Type *string `json:"type,omitempty"` - // IsMandatory - Gets or sets a Boolean value to indicate whether the parameter is mandatory or not. - IsMandatory *bool `json:"isMandatory,omitempty"` - // Position - Get or sets the position of the parameter. - Position *int32 `json:"position,omitempty"` - // DefaultValue - Gets or sets the default value of parameter. - DefaultValue *string `json:"defaultValue,omitempty"` -} - -// RunbookProperties definition of the runbook property type. -type RunbookProperties struct { - // RunbookType - Gets or sets the type of the runbook. Possible values include: 'RunbookTypeEnumScript', 'RunbookTypeEnumGraph', 'RunbookTypeEnumPowerShellWorkflow', 'RunbookTypeEnumPowerShell', 'RunbookTypeEnumGraphPowerShellWorkflow', 'RunbookTypeEnumGraphPowerShell' - RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` - // PublishContentLink - Gets or sets the published runbook content link. - PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` - // State - Gets or sets the state of the runbook. Possible values include: 'RunbookStateNew', 'RunbookStateEdit', 'RunbookStatePublished' - State RunbookState `json:"state,omitempty"` - // LogVerbose - Gets or sets verbose log option. - LogVerbose *bool `json:"logVerbose,omitempty"` - // LogProgress - Gets or sets progress log option. - LogProgress *bool `json:"logProgress,omitempty"` - // LogActivityTrace - Gets or sets the option to log activity trace of the runbook. - LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` - // JobCount - Gets or sets the job count of the runbook. - JobCount *int32 `json:"jobCount,omitempty"` - // Parameters - Gets or sets the runbook parameters. - Parameters map[string]*RunbookParameter `json:"parameters"` - // OutputTypes - Gets or sets the runbook output types. - OutputTypes *[]string `json:"outputTypes,omitempty"` - // Draft - Gets or sets the draft runbook properties. - Draft *RunbookDraft `json:"draft,omitempty"` - // ProvisioningState - Gets or sets the provisioning state of the runbook. Possible values include: 'RunbookProvisioningStateSucceeded' - ProvisioningState RunbookProvisioningState `json:"provisioningState,omitempty"` - // LastModifiedBy - Gets or sets the last modified by. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // CreationTime - Gets or sets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for RunbookProperties. -func (rp RunbookProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rp.RunbookType != "" { - objectMap["runbookType"] = rp.RunbookType - } - if rp.PublishContentLink != nil { - objectMap["publishContentLink"] = rp.PublishContentLink - } - if rp.State != "" { - objectMap["state"] = rp.State - } - if rp.LogVerbose != nil { - objectMap["logVerbose"] = rp.LogVerbose - } - if rp.LogProgress != nil { - objectMap["logProgress"] = rp.LogProgress - } - if rp.LogActivityTrace != nil { - objectMap["logActivityTrace"] = rp.LogActivityTrace - } - if rp.JobCount != nil { - objectMap["jobCount"] = rp.JobCount - } - if rp.Parameters != nil { - objectMap["parameters"] = rp.Parameters - } - if rp.OutputTypes != nil { - objectMap["outputTypes"] = rp.OutputTypes - } - if rp.Draft != nil { - objectMap["draft"] = rp.Draft - } - if rp.ProvisioningState != "" { - objectMap["provisioningState"] = rp.ProvisioningState - } - if rp.LastModifiedBy != nil { - objectMap["lastModifiedBy"] = rp.LastModifiedBy - } - if rp.CreationTime != nil { - objectMap["creationTime"] = rp.CreationTime - } - if rp.LastModifiedTime != nil { - objectMap["lastModifiedTime"] = rp.LastModifiedTime - } - if rp.Description != nil { - objectMap["description"] = rp.Description - } - return json.Marshal(objectMap) -} - -// RunbookPublishFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RunbookPublishFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RunbookClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RunbookPublishFuture) 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 RunbookPublishFuture.Result. -func (future *RunbookPublishFuture) result(client RunbookClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookPublishFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("automation.RunbookPublishFuture") - return - } - ar.Response = future.Response() - return -} - -// RunbookUpdateParameters the parameters supplied to the update runbook operation. -type RunbookUpdateParameters struct { - // RunbookUpdateProperties - Gets or sets the runbook update properties. - *RunbookUpdateProperties `json:"properties,omitempty"` - // Name - Gets or sets the name of the resource. - Name *string `json:"name,omitempty"` - // Location - Gets or sets the location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RunbookUpdateParameters. -func (rup RunbookUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rup.RunbookUpdateProperties != nil { - objectMap["properties"] = rup.RunbookUpdateProperties - } - if rup.Name != nil { - objectMap["name"] = rup.Name - } - if rup.Location != nil { - objectMap["location"] = rup.Location - } - if rup.Tags != nil { - objectMap["tags"] = rup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RunbookUpdateParameters struct. -func (rup *RunbookUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var runbookUpdateProperties RunbookUpdateProperties - err = json.Unmarshal(*v, &runbookUpdateProperties) - if err != nil { - return err - } - rup.RunbookUpdateProperties = &runbookUpdateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rup.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rup.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rup.Tags = tags - } - } - } - - return nil -} - -// RunbookUpdateProperties the parameters supplied to the update runbook properties. -type RunbookUpdateProperties struct { - // Description - Gets or sets the description of the runbook. - Description *string `json:"description,omitempty"` - // LogVerbose - Gets or sets verbose log option. - LogVerbose *bool `json:"logVerbose,omitempty"` - // LogProgress - Gets or sets progress log option. - LogProgress *bool `json:"logProgress,omitempty"` - // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. - LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` -} - -// Schedule definition of the schedule. -type Schedule struct { - autorest.Response `json:"-"` - // ScheduleProperties - Gets or sets the properties of the schedule. - *ScheduleProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Schedule. -func (s Schedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.ScheduleProperties != nil { - objectMap["properties"] = s.ScheduleProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Schedule struct. -func (s *Schedule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var scheduleProperties ScheduleProperties - err = json.Unmarshal(*v, &scheduleProperties) - if err != nil { - return err - } - s.ScheduleProperties = &scheduleProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - s.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - s.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - s.Type = &typeVar - } - } - } - - return nil -} - -// ScheduleAssociationProperty the schedule property associated with the entity. -type ScheduleAssociationProperty struct { - // Name - Gets or sets the name of the Schedule. - Name *string `json:"name,omitempty"` -} - -// ScheduleCreateOrUpdateParameters the parameters supplied to the create or update schedule operation. -type ScheduleCreateOrUpdateParameters struct { - // Name - Gets or sets the name of the Schedule. - Name *string `json:"name,omitempty"` - // ScheduleCreateOrUpdateProperties - Gets or sets the list of schedule properties. - *ScheduleCreateOrUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ScheduleCreateOrUpdateParameters. -func (scoup ScheduleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scoup.Name != nil { - objectMap["name"] = scoup.Name - } - if scoup.ScheduleCreateOrUpdateProperties != nil { - objectMap["properties"] = scoup.ScheduleCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ScheduleCreateOrUpdateParameters struct. -func (scoup *ScheduleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - scoup.Name = &name - } - case "properties": - if v != nil { - var scheduleCreateOrUpdateProperties ScheduleCreateOrUpdateProperties - err = json.Unmarshal(*v, &scheduleCreateOrUpdateProperties) - if err != nil { - return err - } - scoup.ScheduleCreateOrUpdateProperties = &scheduleCreateOrUpdateProperties - } - } - } - - return nil -} - -// ScheduleCreateOrUpdateProperties the parameters supplied to the create or update schedule operation. -type ScheduleCreateOrUpdateProperties struct { - // Description - Gets or sets the description of the schedule. - Description *string `json:"description,omitempty"` - // StartTime - Gets or sets the start time of the schedule. - StartTime *date.Time `json:"startTime,omitempty"` - // ExpiryTime - Gets or sets the end time of the schedule. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // Interval - Gets or sets the interval of the schedule. - Interval interface{} `json:"interval,omitempty"` - // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'ScheduleFrequencyOneTime', 'ScheduleFrequencyDay', 'ScheduleFrequencyHour', 'ScheduleFrequencyWeek', 'ScheduleFrequencyMonth', 'ScheduleFrequencyMinute' - Frequency ScheduleFrequency `json:"frequency,omitempty"` - // TimeZone - Gets or sets the time zone of the schedule. - TimeZone *string `json:"timeZone,omitempty"` - // AdvancedSchedule - Gets or sets the AdvancedSchedule. - AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` -} - -// ScheduleListResult the response model for the list schedule operation. -type ScheduleListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of schedules. - Value *[]Schedule `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// ScheduleListResultIterator provides access to a complete listing of Schedule values. -type ScheduleListResultIterator struct { - i int - page ScheduleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ScheduleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ScheduleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ScheduleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ScheduleListResultIterator) Response() ScheduleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ScheduleListResultIterator) Value() Schedule { - if !iter.page.NotDone() { - return Schedule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ScheduleListResultIterator type. -func NewScheduleListResultIterator(page ScheduleListResultPage) ScheduleListResultIterator { - return ScheduleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (slr ScheduleListResult) IsEmpty() bool { - return slr.Value == nil || len(*slr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (slr ScheduleListResult) hasNextLink() bool { - return slr.NextLink != nil && len(*slr.NextLink) != 0 -} - -// scheduleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (slr ScheduleListResult) scheduleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !slr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(slr.NextLink))) -} - -// ScheduleListResultPage contains a page of Schedule values. -type ScheduleListResultPage struct { - fn func(context.Context, ScheduleListResult) (ScheduleListResult, error) - slr ScheduleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ScheduleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.slr) - if err != nil { - return err - } - page.slr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ScheduleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ScheduleListResultPage) NotDone() bool { - return !page.slr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ScheduleListResultPage) Response() ScheduleListResult { - return page.slr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ScheduleListResultPage) Values() []Schedule { - if page.slr.IsEmpty() { - return nil - } - return *page.slr.Value -} - -// Creates a new instance of the ScheduleListResultPage type. -func NewScheduleListResultPage(cur ScheduleListResult, getNextPage func(context.Context, ScheduleListResult) (ScheduleListResult, error)) ScheduleListResultPage { - return ScheduleListResultPage{ - fn: getNextPage, - slr: cur, - } -} - -// ScheduleProperties definition of schedule parameters. -type ScheduleProperties struct { - // StartTime - Gets or sets the start time of the schedule. - StartTime *date.Time `json:"startTime,omitempty"` - // StartTimeOffsetMinutes - READ-ONLY; Gets the start time's offset in minutes. - StartTimeOffsetMinutes *float64 `json:"startTimeOffsetMinutes,omitempty"` - // ExpiryTime - Gets or sets the end time of the schedule. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // ExpiryTimeOffsetMinutes - Gets or sets the expiry time's offset in minutes. - ExpiryTimeOffsetMinutes *float64 `json:"expiryTimeOffsetMinutes,omitempty"` - // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. - IsEnabled *bool `json:"isEnabled,omitempty"` - // NextRun - Gets or sets the next run time of the schedule. - NextRun *date.Time `json:"nextRun,omitempty"` - // NextRunOffsetMinutes - Gets or sets the next run time's offset in minutes. - NextRunOffsetMinutes *float64 `json:"nextRunOffsetMinutes,omitempty"` - // Interval - Gets or sets the interval of the schedule. - Interval interface{} `json:"interval,omitempty"` - // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'ScheduleFrequencyOneTime', 'ScheduleFrequencyDay', 'ScheduleFrequencyHour', 'ScheduleFrequencyWeek', 'ScheduleFrequencyMonth', 'ScheduleFrequencyMinute' - Frequency ScheduleFrequency `json:"frequency,omitempty"` - // TimeZone - Gets or sets the time zone of the schedule. - TimeZone *string `json:"timeZone,omitempty"` - // AdvancedSchedule - Gets or sets the advanced schedule. - AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` - // CreationTime - Gets or sets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for ScheduleProperties. -func (sp ScheduleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.StartTime != nil { - objectMap["startTime"] = sp.StartTime - } - if sp.ExpiryTime != nil { - objectMap["expiryTime"] = sp.ExpiryTime - } - if sp.ExpiryTimeOffsetMinutes != nil { - objectMap["expiryTimeOffsetMinutes"] = sp.ExpiryTimeOffsetMinutes - } - if sp.IsEnabled != nil { - objectMap["isEnabled"] = sp.IsEnabled - } - if sp.NextRun != nil { - objectMap["nextRun"] = sp.NextRun - } - if sp.NextRunOffsetMinutes != nil { - objectMap["nextRunOffsetMinutes"] = sp.NextRunOffsetMinutes - } - if sp.Interval != nil { - objectMap["interval"] = sp.Interval - } - if sp.Frequency != "" { - objectMap["frequency"] = sp.Frequency - } - if sp.TimeZone != nil { - objectMap["timeZone"] = sp.TimeZone - } - if sp.AdvancedSchedule != nil { - objectMap["advancedSchedule"] = sp.AdvancedSchedule - } - if sp.CreationTime != nil { - objectMap["creationTime"] = sp.CreationTime - } - if sp.LastModifiedTime != nil { - objectMap["lastModifiedTime"] = sp.LastModifiedTime - } - if sp.Description != nil { - objectMap["description"] = sp.Description - } - return json.Marshal(objectMap) -} - -// ScheduleUpdateParameters the parameters supplied to the update schedule operation. -type ScheduleUpdateParameters struct { - // Name - Gets or sets the name of the Schedule. - Name *string `json:"name,omitempty"` - // ScheduleUpdateProperties - Gets or sets the list of schedule properties. - *ScheduleUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ScheduleUpdateParameters. -func (sup ScheduleUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sup.Name != nil { - objectMap["name"] = sup.Name - } - if sup.ScheduleUpdateProperties != nil { - objectMap["properties"] = sup.ScheduleUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ScheduleUpdateParameters struct. -func (sup *ScheduleUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sup.Name = &name - } - case "properties": - if v != nil { - var scheduleUpdateProperties ScheduleUpdateProperties - err = json.Unmarshal(*v, &scheduleUpdateProperties) - if err != nil { - return err - } - sup.ScheduleUpdateProperties = &scheduleUpdateProperties - } - } - } - - return nil -} - -// ScheduleUpdateProperties the parameters supplied to the update schedule operation. -type ScheduleUpdateProperties struct { - // Description - Gets or sets the description of the schedule. - Description *string `json:"description,omitempty"` - // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. - IsEnabled *bool `json:"isEnabled,omitempty"` -} - -// SetObject ... -type SetObject struct { - autorest.Response `json:"-"` - Value interface{} `json:"value,omitempty"` -} - -// Sku the account SKU. -type Sku struct { - // Name - Gets or sets the SKU name of the account. Possible values include: 'SkuNameEnumFree', 'SkuNameEnumBasic' - Name SkuNameEnum `json:"name,omitempty"` - // Family - Gets or sets the SKU family. - Family *string `json:"family,omitempty"` - // Capacity - Gets or sets the SKU capacity. - Capacity *int32 `json:"capacity,omitempty"` -} - -// SoftwareUpdateConfiguration software update configuration properties. -type SoftwareUpdateConfiguration struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // SoftwareUpdateConfigurationProperties - Software update configuration properties. - *SoftwareUpdateConfigurationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SoftwareUpdateConfiguration. -func (suc SoftwareUpdateConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if suc.SoftwareUpdateConfigurationProperties != nil { - objectMap["properties"] = suc.SoftwareUpdateConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfiguration struct. -func (suc *SoftwareUpdateConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - suc.Name = &name - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - suc.ID = &ID - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - suc.Type = &typeVar - } - case "properties": - if v != nil { - var softwareUpdateConfigurationProperties SoftwareUpdateConfigurationProperties - err = json.Unmarshal(*v, &softwareUpdateConfigurationProperties) - if err != nil { - return err - } - suc.SoftwareUpdateConfigurationProperties = &softwareUpdateConfigurationProperties - } - } - } - - return nil -} - -// SoftwareUpdateConfigurationCollectionItem software update configuration collection item properties. -type SoftwareUpdateConfigurationCollectionItem struct { - // Name - READ-ONLY; Name of the software update configuration. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; Resource Id of the software update configuration - ID *string `json:"id,omitempty"` - // SoftwareUpdateConfigurationCollectionItemProperties - Software update configuration properties. - *SoftwareUpdateConfigurationCollectionItemProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationCollectionItem. -func (succi SoftwareUpdateConfigurationCollectionItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if succi.SoftwareUpdateConfigurationCollectionItemProperties != nil { - objectMap["properties"] = succi.SoftwareUpdateConfigurationCollectionItemProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationCollectionItem struct. -func (succi *SoftwareUpdateConfigurationCollectionItem) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - succi.Name = &name - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - succi.ID = &ID - } - case "properties": - if v != nil { - var softwareUpdateConfigurationCollectionItemProperties SoftwareUpdateConfigurationCollectionItemProperties - err = json.Unmarshal(*v, &softwareUpdateConfigurationCollectionItemProperties) - if err != nil { - return err - } - succi.SoftwareUpdateConfigurationCollectionItemProperties = &softwareUpdateConfigurationCollectionItemProperties - } - } - } - - return nil -} - -// SoftwareUpdateConfigurationCollectionItemProperties software update configuration collection item -// properties. -type SoftwareUpdateConfigurationCollectionItemProperties struct { - // UpdateConfiguration - Update specific properties of the software update configuration. - UpdateConfiguration *UpdateConfiguration `json:"updateConfiguration,omitempty"` - // Tasks - Pre and Post Tasks defined - Tasks *SoftwareUpdateConfigurationTasks `json:"tasks,omitempty"` - // Frequency - execution frequency of the schedule associated with the software update configuration. Possible values include: 'ScheduleFrequencyOneTime', 'ScheduleFrequencyDay', 'ScheduleFrequencyHour', 'ScheduleFrequencyWeek', 'ScheduleFrequencyMonth', 'ScheduleFrequencyMinute' - Frequency ScheduleFrequency `json:"frequency,omitempty"` - // StartTime - the start time of the update. - StartTime *date.Time `json:"startTime,omitempty"` - // CreationTime - READ-ONLY; Creation time of the software update configuration, which only appears in the response. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - READ-ONLY; Last time software update configuration was modified, which only appears in the response. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // ProvisioningState - READ-ONLY; Provisioning state for the software update configuration, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // NextRun - ext run time of the update. - NextRun *date.Time `json:"nextRun,omitempty"` -} - -// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationCollectionItemProperties. -func (succip SoftwareUpdateConfigurationCollectionItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if succip.UpdateConfiguration != nil { - objectMap["updateConfiguration"] = succip.UpdateConfiguration - } - if succip.Tasks != nil { - objectMap["tasks"] = succip.Tasks - } - if succip.Frequency != "" { - objectMap["frequency"] = succip.Frequency - } - if succip.StartTime != nil { - objectMap["startTime"] = succip.StartTime - } - if succip.NextRun != nil { - objectMap["nextRun"] = succip.NextRun - } - return json.Marshal(objectMap) -} - -// SoftwareUpdateConfigurationListResult result of listing all software update configuration -type SoftwareUpdateConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - outer object returned when listing all software update configurations - Value *[]SoftwareUpdateConfigurationCollectionItem `json:"value,omitempty"` -} - -// SoftwareUpdateConfigurationMachineRun software update configuration machine run model. -type SoftwareUpdateConfigurationMachineRun struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; Name of the software update configuration machine run - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; Resource Id of the software update configuration machine run - ID *string `json:"id,omitempty"` - // UpdateConfigurationMachineRunProperties - Software update configuration machine run properties. - *UpdateConfigurationMachineRunProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationMachineRun. -func (sucmr SoftwareUpdateConfigurationMachineRun) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sucmr.UpdateConfigurationMachineRunProperties != nil { - objectMap["properties"] = sucmr.UpdateConfigurationMachineRunProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationMachineRun struct. -func (sucmr *SoftwareUpdateConfigurationMachineRun) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sucmr.Name = &name - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sucmr.ID = &ID - } - case "properties": - if v != nil { - var updateConfigurationMachineRunProperties UpdateConfigurationMachineRunProperties - err = json.Unmarshal(*v, &updateConfigurationMachineRunProperties) - if err != nil { - return err - } - sucmr.UpdateConfigurationMachineRunProperties = &updateConfigurationMachineRunProperties - } - } - } - - return nil -} - -// SoftwareUpdateConfigurationMachineRunListResult result of listing all software update configuration -// machine runs -type SoftwareUpdateConfigurationMachineRunListResult struct { - autorest.Response `json:"-"` - // Value - outer object returned when listing all software update configuration machine runs - Value *[]SoftwareUpdateConfigurationMachineRun `json:"value,omitempty"` - // NextLink - link to next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SoftwareUpdateConfigurationProperties software update configuration properties. -type SoftwareUpdateConfigurationProperties struct { - // UpdateConfiguration - update specific properties for the Software update configuration - UpdateConfiguration *UpdateConfiguration `json:"updateConfiguration,omitempty"` - // ScheduleInfo - Schedule information for the Software update configuration - ScheduleInfo *SUCScheduleProperties `json:"scheduleInfo,omitempty"` - // ProvisioningState - READ-ONLY; Provisioning state for the software update configuration, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Error - Details of provisioning error - Error *ErrorResponse `json:"error,omitempty"` - // CreationTime - READ-ONLY; Creation time of the resource, which only appears in the response. - CreationTime *date.Time `json:"creationTime,omitempty"` - // CreatedBy - READ-ONLY; CreatedBy property, which only appears in the response. - CreatedBy *string `json:"createdBy,omitempty"` - // LastModifiedTime - READ-ONLY; Last time resource was modified, which only appears in the response. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // LastModifiedBy - READ-ONLY; LastModifiedBy property, which only appears in the response. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // Tasks - Tasks information for the Software update configuration. - Tasks *SoftwareUpdateConfigurationTasks `json:"tasks,omitempty"` -} - -// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationProperties. -func (sucp SoftwareUpdateConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sucp.UpdateConfiguration != nil { - objectMap["updateConfiguration"] = sucp.UpdateConfiguration - } - if sucp.ScheduleInfo != nil { - objectMap["scheduleInfo"] = sucp.ScheduleInfo - } - if sucp.Error != nil { - objectMap["error"] = sucp.Error - } - if sucp.Tasks != nil { - objectMap["tasks"] = sucp.Tasks - } - return json.Marshal(objectMap) -} - -// SoftwareUpdateConfigurationRun software update configuration Run properties. -type SoftwareUpdateConfigurationRun struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; Name of the software update configuration run. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; Resource Id of the software update configuration run - ID *string `json:"id,omitempty"` - // SoftwareUpdateConfigurationRunProperties - Software update configuration Run properties. - *SoftwareUpdateConfigurationRunProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationRun. -func (sucr SoftwareUpdateConfigurationRun) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sucr.SoftwareUpdateConfigurationRunProperties != nil { - objectMap["properties"] = sucr.SoftwareUpdateConfigurationRunProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationRun struct. -func (sucr *SoftwareUpdateConfigurationRun) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sucr.Name = &name - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sucr.ID = &ID - } - case "properties": - if v != nil { - var softwareUpdateConfigurationRunProperties SoftwareUpdateConfigurationRunProperties - err = json.Unmarshal(*v, &softwareUpdateConfigurationRunProperties) - if err != nil { - return err - } - sucr.SoftwareUpdateConfigurationRunProperties = &softwareUpdateConfigurationRunProperties - } - } - } - - return nil -} - -// SoftwareUpdateConfigurationRunListResult result of listing all software update configuration runs -type SoftwareUpdateConfigurationRunListResult struct { - autorest.Response `json:"-"` - // Value - outer object returned when listing all software update configuration runs - Value *[]SoftwareUpdateConfigurationRun `json:"value,omitempty"` - // NextLink - link to next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SoftwareUpdateConfigurationRunProperties software update configuration properties. -type SoftwareUpdateConfigurationRunProperties struct { - // SoftwareUpdateConfiguration - software update configuration triggered this run - SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` - // Status - READ-ONLY; Status of the software update configuration run. - Status *string `json:"status,omitempty"` - // ConfiguredDuration - READ-ONLY; Configured duration for the software update configuration run. - ConfiguredDuration *string `json:"configuredDuration,omitempty"` - // OsType - READ-ONLY; Operating system target of the software update configuration triggered this run - OsType *string `json:"osType,omitempty"` - // StartTime - READ-ONLY; Start time of the software update configuration run. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; End time of the software update configuration run. - EndTime *date.Time `json:"endTime,omitempty"` - // ComputerCount - READ-ONLY; Number of computers in the software update configuration run. - ComputerCount *int32 `json:"computerCount,omitempty"` - // FailedCount - READ-ONLY; Number of computers with failed status. - FailedCount *int32 `json:"failedCount,omitempty"` - // CreationTime - READ-ONLY; Creation time of the resource, which only appears in the response. - CreationTime *date.Time `json:"creationTime,omitempty"` - // CreatedBy - READ-ONLY; CreatedBy property, which only appears in the response. - CreatedBy *string `json:"createdBy,omitempty"` - // LastModifiedTime - READ-ONLY; Last time resource was modified, which only appears in the response. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // LastModifiedBy - READ-ONLY; LastModifiedBy property, which only appears in the response. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // Tasks - Software update configuration tasks triggered in this run - Tasks *SoftwareUpdateConfigurationRunTasks `json:"tasks,omitempty"` -} - -// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationRunProperties. -func (sucrp SoftwareUpdateConfigurationRunProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sucrp.SoftwareUpdateConfiguration != nil { - objectMap["softwareUpdateConfiguration"] = sucrp.SoftwareUpdateConfiguration - } - if sucrp.Tasks != nil { - objectMap["tasks"] = sucrp.Tasks - } - return json.Marshal(objectMap) -} - -// SoftwareUpdateConfigurationRunTaskProperties task properties of the software update configuration. -type SoftwareUpdateConfigurationRunTaskProperties struct { - // Status - The status of the task. - Status *string `json:"status,omitempty"` - // Source - The name of the source of the task. - Source *string `json:"source,omitempty"` - // JobID - The job id of the task. - JobID *string `json:"jobId,omitempty"` -} - -// SoftwareUpdateConfigurationRunTasks software update configuration run tasks model. -type SoftwareUpdateConfigurationRunTasks struct { - // PreTask - Pre task properties. - PreTask *SoftwareUpdateConfigurationRunTaskProperties `json:"preTask,omitempty"` - // PostTask - Post task properties. - PostTask *SoftwareUpdateConfigurationRunTaskProperties `json:"postTask,omitempty"` -} - -// SoftwareUpdateConfigurationTasks task properties of the software update configuration. -type SoftwareUpdateConfigurationTasks struct { - // PreTask - Pre task properties. - PreTask *TaskProperties `json:"preTask,omitempty"` - // PostTask - Post task properties. - PostTask *TaskProperties `json:"postTask,omitempty"` -} - -// SourceControl definition of the source control. -type SourceControl struct { - autorest.Response `json:"-"` - // SourceControlProperties - The properties of the source control. - *SourceControlProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControl. -func (sc SourceControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sc.SourceControlProperties != nil { - objectMap["properties"] = sc.SourceControlProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SourceControl struct. -func (sc *SourceControl) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var sourceControlProperties SourceControlProperties - err = json.Unmarshal(*v, &sourceControlProperties) - if err != nil { - return err - } - sc.SourceControlProperties = &sourceControlProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sc.Type = &typeVar - } - } - } - - return nil -} - -// SourceControlCreateOrUpdateParameters the parameters supplied to the create or update source control -// operation. -type SourceControlCreateOrUpdateParameters struct { - // SourceControlCreateOrUpdateProperties - The properties of the source control. - *SourceControlCreateOrUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlCreateOrUpdateParameters. -func (sccoup SourceControlCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sccoup.SourceControlCreateOrUpdateProperties != nil { - objectMap["properties"] = sccoup.SourceControlCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SourceControlCreateOrUpdateParameters struct. -func (sccoup *SourceControlCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var sourceControlCreateOrUpdateProperties SourceControlCreateOrUpdateProperties - err = json.Unmarshal(*v, &sourceControlCreateOrUpdateProperties) - if err != nil { - return err - } - sccoup.SourceControlCreateOrUpdateProperties = &sourceControlCreateOrUpdateProperties - } - } - } - - return nil -} - -// SourceControlCreateOrUpdateProperties the properties of the create source control operation. -type SourceControlCreateOrUpdateProperties struct { - // RepoURL - The repo url of the source control. - RepoURL *string `json:"repoUrl,omitempty"` - // Branch - The repo branch of the source control. Include branch as empty string for VsoTfvc. - Branch *string `json:"branch,omitempty"` - // FolderPath - The folder path of the source control. Path must be relative. - FolderPath *string `json:"folderPath,omitempty"` - // AutoSync - The auto async of the source control. Default is false. - AutoSync *bool `json:"autoSync,omitempty"` - // PublishRunbook - The auto publish of the source control. Default is true. - PublishRunbook *bool `json:"publishRunbook,omitempty"` - // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'SourceTypeVsoGit', 'SourceTypeVsoTfvc', 'SourceTypeGitHub' - SourceType SourceType `json:"sourceType,omitempty"` - // SecurityToken - The authorization token for the repo of the source control. - SecurityToken *SourceControlSecurityTokenProperties `json:"securityToken,omitempty"` - // Description - The user description of the source control. - Description *string `json:"description,omitempty"` -} - -// SourceControlListResult the response model for the list source controls operation. -type SourceControlListResult struct { - autorest.Response `json:"-"` - // Value - The list of source controls. - Value *[]SourceControl `json:"value,omitempty"` - // NextLink - The next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// SourceControlListResultIterator provides access to a complete listing of SourceControl values. -type SourceControlListResultIterator struct { - i int - page SourceControlListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SourceControlListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SourceControlListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SourceControlListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SourceControlListResultIterator) Response() SourceControlListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SourceControlListResultIterator) Value() SourceControl { - if !iter.page.NotDone() { - return SourceControl{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SourceControlListResultIterator type. -func NewSourceControlListResultIterator(page SourceControlListResultPage) SourceControlListResultIterator { - return SourceControlListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sclr SourceControlListResult) IsEmpty() bool { - return sclr.Value == nil || len(*sclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sclr SourceControlListResult) hasNextLink() bool { - return sclr.NextLink != nil && len(*sclr.NextLink) != 0 -} - -// sourceControlListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sclr SourceControlListResult) sourceControlListResultPreparer(ctx context.Context) (*http.Request, error) { - if !sclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sclr.NextLink))) -} - -// SourceControlListResultPage contains a page of SourceControl values. -type SourceControlListResultPage struct { - fn func(context.Context, SourceControlListResult) (SourceControlListResult, error) - sclr SourceControlListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SourceControlListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sclr) - if err != nil { - return err - } - page.sclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SourceControlListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SourceControlListResultPage) NotDone() bool { - return !page.sclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SourceControlListResultPage) Response() SourceControlListResult { - return page.sclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SourceControlListResultPage) Values() []SourceControl { - if page.sclr.IsEmpty() { - return nil - } - return *page.sclr.Value -} - -// Creates a new instance of the SourceControlListResultPage type. -func NewSourceControlListResultPage(cur SourceControlListResult, getNextPage func(context.Context, SourceControlListResult) (SourceControlListResult, error)) SourceControlListResultPage { - return SourceControlListResultPage{ - fn: getNextPage, - sclr: cur, - } -} - -// SourceControlProperties definition of the source control properties -type SourceControlProperties struct { - // RepoURL - The repo url of the source control. - RepoURL *string `json:"repoUrl,omitempty"` - // Branch - The repo branch of the source control. Include branch as empty string for VsoTfvc. - Branch *string `json:"branch,omitempty"` - // FolderPath - The folder path of the source control. - FolderPath *string `json:"folderPath,omitempty"` - // AutoSync - The auto sync of the source control. Default is false. - AutoSync *bool `json:"autoSync,omitempty"` - // PublishRunbook - The auto publish of the source control. Default is true. - PublishRunbook *bool `json:"publishRunbook,omitempty"` - // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub. Possible values include: 'SourceTypeVsoGit', 'SourceTypeVsoTfvc', 'SourceTypeGitHub' - SourceType SourceType `json:"sourceType,omitempty"` - // Description - The description. - Description *string `json:"description,omitempty"` - // CreationTime - The creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - The last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` -} - -// SourceControlSecurityTokenProperties ... -type SourceControlSecurityTokenProperties struct { - // AccessToken - The access token. - AccessToken *string `json:"accessToken,omitempty"` - // RefreshToken - The refresh token. - RefreshToken *string `json:"refreshToken,omitempty"` - // TokenType - The token type. Must be either PersonalAccessToken or Oauth. Possible values include: 'TokenTypePersonalAccessToken', 'TokenTypeOauth' - TokenType TokenType `json:"tokenType,omitempty"` -} - -// SourceControlSyncJob definition of the source control sync job. -type SourceControlSyncJob struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - READ-ONLY; Resource id. - ID *string `json:"id,omitempty"` - // SourceControlSyncJobProperties - The properties of the source control sync job. - *SourceControlSyncJobProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlSyncJob. -func (scsj SourceControlSyncJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scsj.SourceControlSyncJobProperties != nil { - objectMap["properties"] = scsj.SourceControlSyncJobProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJob struct. -func (scsj *SourceControlSyncJob) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - scsj.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - scsj.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - scsj.ID = &ID - } - case "properties": - if v != nil { - var sourceControlSyncJobProperties SourceControlSyncJobProperties - err = json.Unmarshal(*v, &sourceControlSyncJobProperties) - if err != nil { - return err - } - scsj.SourceControlSyncJobProperties = &sourceControlSyncJobProperties - } - } - } - - return nil -} - -// SourceControlSyncJobByID definition of the source control sync job. -type SourceControlSyncJobByID struct { - autorest.Response `json:"-"` - // ID - The id of the job. - ID *string `json:"id,omitempty"` - // SourceControlSyncJobByIDProperties - The properties of the source control sync job. - *SourceControlSyncJobByIDProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlSyncJobByID. -func (scsjbi SourceControlSyncJobByID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scsjbi.ID != nil { - objectMap["id"] = scsjbi.ID - } - if scsjbi.SourceControlSyncJobByIDProperties != nil { - objectMap["properties"] = scsjbi.SourceControlSyncJobByIDProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobByID struct. -func (scsjbi *SourceControlSyncJobByID) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - scsjbi.ID = &ID - } - case "properties": - if v != nil { - var sourceControlSyncJobByIDProperties SourceControlSyncJobByIDProperties - err = json.Unmarshal(*v, &sourceControlSyncJobByIDProperties) - if err != nil { - return err - } - scsjbi.SourceControlSyncJobByIDProperties = &sourceControlSyncJobByIDProperties - } - } - } - - return nil -} - -// SourceControlSyncJobByIDProperties definition of source control sync job properties. -type SourceControlSyncJobByIDProperties struct { - // SourceControlSyncJobID - The source control sync job id. - SourceControlSyncJobID *string `json:"sourceControlSyncJobId,omitempty"` - // CreationTime - READ-ONLY; The creation time of the job. - CreationTime *date.Time `json:"creationTime,omitempty"` - // ProvisioningState - The provisioning state of the job. Possible values include: 'ProvisioningStateCompleted', 'ProvisioningStateFailed', 'ProvisioningStateRunning' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // StartTime - READ-ONLY; The start time of the job. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; The end time of the job. - EndTime *date.Time `json:"endTime,omitempty"` - // SyncType - The sync type. Possible values include: 'SyncTypePartialSync', 'SyncTypeFullSync' - SyncType SyncType `json:"syncType,omitempty"` - // Exception - The exceptions that occurred while running the sync job. - Exception *string `json:"exception,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlSyncJobByIDProperties. -func (scsjbip SourceControlSyncJobByIDProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scsjbip.SourceControlSyncJobID != nil { - objectMap["sourceControlSyncJobId"] = scsjbip.SourceControlSyncJobID - } - if scsjbip.ProvisioningState != "" { - objectMap["provisioningState"] = scsjbip.ProvisioningState - } - if scsjbip.SyncType != "" { - objectMap["syncType"] = scsjbip.SyncType - } - if scsjbip.Exception != nil { - objectMap["exception"] = scsjbip.Exception - } - return json.Marshal(objectMap) -} - -// SourceControlSyncJobCreateParameters the parameters supplied to the create source control sync job -// operation. -type SourceControlSyncJobCreateParameters struct { - // SourceControlSyncJobCreateProperties - The properties of the source control sync job. - *SourceControlSyncJobCreateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlSyncJobCreateParameters. -func (scsjcp SourceControlSyncJobCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scsjcp.SourceControlSyncJobCreateProperties != nil { - objectMap["properties"] = scsjcp.SourceControlSyncJobCreateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobCreateParameters struct. -func (scsjcp *SourceControlSyncJobCreateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var sourceControlSyncJobCreateProperties SourceControlSyncJobCreateProperties - err = json.Unmarshal(*v, &sourceControlSyncJobCreateProperties) - if err != nil { - return err - } - scsjcp.SourceControlSyncJobCreateProperties = &sourceControlSyncJobCreateProperties - } - } - } - - return nil -} - -// SourceControlSyncJobCreateProperties definition of create source control sync job properties. -type SourceControlSyncJobCreateProperties struct { - // CommitID - The commit id of the source control sync job. If not syncing to a commitId, enter an empty string. - CommitID *string `json:"commitId,omitempty"` -} - -// SourceControlSyncJobListResult the response model for the list source control sync jobs operation. -type SourceControlSyncJobListResult struct { - autorest.Response `json:"-"` - // Value - The list of source control sync jobs. - Value *[]SourceControlSyncJob `json:"value,omitempty"` - // NextLink - The next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// SourceControlSyncJobListResultIterator provides access to a complete listing of SourceControlSyncJob -// values. -type SourceControlSyncJobListResultIterator struct { - i int - page SourceControlSyncJobListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SourceControlSyncJobListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SourceControlSyncJobListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SourceControlSyncJobListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SourceControlSyncJobListResultIterator) Response() SourceControlSyncJobListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SourceControlSyncJobListResultIterator) Value() SourceControlSyncJob { - if !iter.page.NotDone() { - return SourceControlSyncJob{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SourceControlSyncJobListResultIterator type. -func NewSourceControlSyncJobListResultIterator(page SourceControlSyncJobListResultPage) SourceControlSyncJobListResultIterator { - return SourceControlSyncJobListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (scsjlr SourceControlSyncJobListResult) IsEmpty() bool { - return scsjlr.Value == nil || len(*scsjlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (scsjlr SourceControlSyncJobListResult) hasNextLink() bool { - return scsjlr.NextLink != nil && len(*scsjlr.NextLink) != 0 -} - -// sourceControlSyncJobListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (scsjlr SourceControlSyncJobListResult) sourceControlSyncJobListResultPreparer(ctx context.Context) (*http.Request, error) { - if !scsjlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(scsjlr.NextLink))) -} - -// SourceControlSyncJobListResultPage contains a page of SourceControlSyncJob values. -type SourceControlSyncJobListResultPage struct { - fn func(context.Context, SourceControlSyncJobListResult) (SourceControlSyncJobListResult, error) - scsjlr SourceControlSyncJobListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SourceControlSyncJobListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.scsjlr) - if err != nil { - return err - } - page.scsjlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SourceControlSyncJobListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SourceControlSyncJobListResultPage) NotDone() bool { - return !page.scsjlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SourceControlSyncJobListResultPage) Response() SourceControlSyncJobListResult { - return page.scsjlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SourceControlSyncJobListResultPage) Values() []SourceControlSyncJob { - if page.scsjlr.IsEmpty() { - return nil - } - return *page.scsjlr.Value -} - -// Creates a new instance of the SourceControlSyncJobListResultPage type. -func NewSourceControlSyncJobListResultPage(cur SourceControlSyncJobListResult, getNextPage func(context.Context, SourceControlSyncJobListResult) (SourceControlSyncJobListResult, error)) SourceControlSyncJobListResultPage { - return SourceControlSyncJobListResultPage{ - fn: getNextPage, - scsjlr: cur, - } -} - -// SourceControlSyncJobProperties definition of source control sync job properties. -type SourceControlSyncJobProperties struct { - // SourceControlSyncJobID - The source control sync job id. - SourceControlSyncJobID *string `json:"sourceControlSyncJobId,omitempty"` - // CreationTime - READ-ONLY; The creation time of the job. - CreationTime *date.Time `json:"creationTime,omitempty"` - // ProvisioningState - The provisioning state of the job. Possible values include: 'ProvisioningStateCompleted', 'ProvisioningStateFailed', 'ProvisioningStateRunning' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // StartTime - READ-ONLY; The start time of the job. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; The end time of the job. - EndTime *date.Time `json:"endTime,omitempty"` - // SyncType - The sync type. Possible values include: 'SyncTypePartialSync', 'SyncTypeFullSync' - SyncType SyncType `json:"syncType,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlSyncJobProperties. -func (scsjp SourceControlSyncJobProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scsjp.SourceControlSyncJobID != nil { - objectMap["sourceControlSyncJobId"] = scsjp.SourceControlSyncJobID - } - if scsjp.ProvisioningState != "" { - objectMap["provisioningState"] = scsjp.ProvisioningState - } - if scsjp.SyncType != "" { - objectMap["syncType"] = scsjp.SyncType - } - return json.Marshal(objectMap) -} - -// SourceControlSyncJobStream definition of the source control sync job stream. -type SourceControlSyncJobStream struct { - // ID - READ-ONLY; Resource id. - ID *string `json:"id,omitempty"` - // SourceControlSyncJobStreamProperties - The properties of the source control sync job stream. - *SourceControlSyncJobStreamProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlSyncJobStream. -func (scsjs SourceControlSyncJobStream) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scsjs.SourceControlSyncJobStreamProperties != nil { - objectMap["properties"] = scsjs.SourceControlSyncJobStreamProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobStream struct. -func (scsjs *SourceControlSyncJobStream) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - scsjs.ID = &ID - } - case "properties": - if v != nil { - var sourceControlSyncJobStreamProperties SourceControlSyncJobStreamProperties - err = json.Unmarshal(*v, &sourceControlSyncJobStreamProperties) - if err != nil { - return err - } - scsjs.SourceControlSyncJobStreamProperties = &sourceControlSyncJobStreamProperties - } - } - } - - return nil -} - -// SourceControlSyncJobStreamByID definition of the source control sync job stream by id. -type SourceControlSyncJobStreamByID struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource id. - ID *string `json:"id,omitempty"` - // SourceControlSyncJobStreamByIDProperties - The properties of the source control sync job stream. - *SourceControlSyncJobStreamByIDProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamByID. -func (scsjsbi SourceControlSyncJobStreamByID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scsjsbi.SourceControlSyncJobStreamByIDProperties != nil { - objectMap["properties"] = scsjsbi.SourceControlSyncJobStreamByIDProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobStreamByID struct. -func (scsjsbi *SourceControlSyncJobStreamByID) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - scsjsbi.ID = &ID - } - case "properties": - if v != nil { - var sourceControlSyncJobStreamByIDProperties SourceControlSyncJobStreamByIDProperties - err = json.Unmarshal(*v, &sourceControlSyncJobStreamByIDProperties) - if err != nil { - return err - } - scsjsbi.SourceControlSyncJobStreamByIDProperties = &sourceControlSyncJobStreamByIDProperties - } - } - } - - return nil -} - -// SourceControlSyncJobStreamByIDProperties definition of source control sync job stream by id properties. -type SourceControlSyncJobStreamByIDProperties struct { - // SourceControlSyncJobStreamID - The sync job stream id. - SourceControlSyncJobStreamID *string `json:"sourceControlSyncJobStreamId,omitempty"` - // Summary - The summary of the sync job stream. - Summary *string `json:"summary,omitempty"` - // Time - READ-ONLY; The time of the sync job stream. - Time *date.Time `json:"time,omitempty"` - // StreamType - The type of the sync job stream. Possible values include: 'StreamTypeError', 'StreamTypeOutput' - StreamType StreamType `json:"streamType,omitempty"` - // StreamText - The text of the sync job stream. - StreamText *string `json:"streamText,omitempty"` - // Value - The values of the job stream. - Value map[string]interface{} `json:"value"` -} - -// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamByIDProperties. -func (scsjsbip SourceControlSyncJobStreamByIDProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scsjsbip.SourceControlSyncJobStreamID != nil { - objectMap["sourceControlSyncJobStreamId"] = scsjsbip.SourceControlSyncJobStreamID - } - if scsjsbip.Summary != nil { - objectMap["summary"] = scsjsbip.Summary - } - if scsjsbip.StreamType != "" { - objectMap["streamType"] = scsjsbip.StreamType - } - if scsjsbip.StreamText != nil { - objectMap["streamText"] = scsjsbip.StreamText - } - if scsjsbip.Value != nil { - objectMap["value"] = scsjsbip.Value - } - return json.Marshal(objectMap) -} - -// SourceControlSyncJobStreamProperties definition of source control sync job stream properties. -type SourceControlSyncJobStreamProperties struct { - // SourceControlSyncJobStreamID - The sync job stream id. - SourceControlSyncJobStreamID *string `json:"sourceControlSyncJobStreamId,omitempty"` - // Summary - The summary of the sync job stream. - Summary *string `json:"summary,omitempty"` - // Time - READ-ONLY; The time of the sync job stream. - Time *date.Time `json:"time,omitempty"` - // StreamType - The type of the sync job stream. Possible values include: 'StreamTypeError', 'StreamTypeOutput' - StreamType StreamType `json:"streamType,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamProperties. -func (scsjsp SourceControlSyncJobStreamProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scsjsp.SourceControlSyncJobStreamID != nil { - objectMap["sourceControlSyncJobStreamId"] = scsjsp.SourceControlSyncJobStreamID - } - if scsjsp.Summary != nil { - objectMap["summary"] = scsjsp.Summary - } - if scsjsp.StreamType != "" { - objectMap["streamType"] = scsjsp.StreamType - } - return json.Marshal(objectMap) -} - -// SourceControlSyncJobStreamsListBySyncJob the response model for the list source control sync job streams -// operation. -type SourceControlSyncJobStreamsListBySyncJob struct { - autorest.Response `json:"-"` - // Value - The list of source control sync job streams. - Value *[]SourceControlSyncJobStream `json:"value,omitempty"` - // NextLink - READ-ONLY; The next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamsListBySyncJob. -func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scsjslbsj.Value != nil { - objectMap["value"] = scsjslbsj.Value - } - return json.Marshal(objectMap) -} - -// SourceControlSyncJobStreamsListBySyncJobIterator provides access to a complete listing of -// SourceControlSyncJobStream values. -type SourceControlSyncJobStreamsListBySyncJobIterator struct { - i int - page SourceControlSyncJobStreamsListBySyncJobPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SourceControlSyncJobStreamsListBySyncJobIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsListBySyncJobIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SourceControlSyncJobStreamsListBySyncJobIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SourceControlSyncJobStreamsListBySyncJobIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SourceControlSyncJobStreamsListBySyncJobIterator) Response() SourceControlSyncJobStreamsListBySyncJob { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SourceControlSyncJobStreamsListBySyncJobIterator) Value() SourceControlSyncJobStream { - if !iter.page.NotDone() { - return SourceControlSyncJobStream{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SourceControlSyncJobStreamsListBySyncJobIterator type. -func NewSourceControlSyncJobStreamsListBySyncJobIterator(page SourceControlSyncJobStreamsListBySyncJobPage) SourceControlSyncJobStreamsListBySyncJobIterator { - return SourceControlSyncJobStreamsListBySyncJobIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) IsEmpty() bool { - return scsjslbsj.Value == nil || len(*scsjslbsj.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) hasNextLink() bool { - return scsjslbsj.NextLink != nil && len(*scsjslbsj.NextLink) != 0 -} - -// sourceControlSyncJobStreamsListBySyncJobPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) sourceControlSyncJobStreamsListBySyncJobPreparer(ctx context.Context) (*http.Request, error) { - if !scsjslbsj.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(scsjslbsj.NextLink))) -} - -// SourceControlSyncJobStreamsListBySyncJobPage contains a page of SourceControlSyncJobStream values. -type SourceControlSyncJobStreamsListBySyncJobPage struct { - fn func(context.Context, SourceControlSyncJobStreamsListBySyncJob) (SourceControlSyncJobStreamsListBySyncJob, error) - scsjslbsj SourceControlSyncJobStreamsListBySyncJob -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SourceControlSyncJobStreamsListBySyncJobPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsListBySyncJobPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.scsjslbsj) - if err != nil { - return err - } - page.scsjslbsj = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SourceControlSyncJobStreamsListBySyncJobPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SourceControlSyncJobStreamsListBySyncJobPage) NotDone() bool { - return !page.scsjslbsj.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SourceControlSyncJobStreamsListBySyncJobPage) Response() SourceControlSyncJobStreamsListBySyncJob { - return page.scsjslbsj -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SourceControlSyncJobStreamsListBySyncJobPage) Values() []SourceControlSyncJobStream { - if page.scsjslbsj.IsEmpty() { - return nil - } - return *page.scsjslbsj.Value -} - -// Creates a new instance of the SourceControlSyncJobStreamsListBySyncJobPage type. -func NewSourceControlSyncJobStreamsListBySyncJobPage(cur SourceControlSyncJobStreamsListBySyncJob, getNextPage func(context.Context, SourceControlSyncJobStreamsListBySyncJob) (SourceControlSyncJobStreamsListBySyncJob, error)) SourceControlSyncJobStreamsListBySyncJobPage { - return SourceControlSyncJobStreamsListBySyncJobPage{ - fn: getNextPage, - scsjslbsj: cur, - } -} - -// SourceControlUpdateParameters the parameters supplied to the update source control operation. -type SourceControlUpdateParameters struct { - // SourceControlUpdateProperties - The value of the source control. - *SourceControlUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SourceControlUpdateParameters. -func (scup SourceControlUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scup.SourceControlUpdateProperties != nil { - objectMap["properties"] = scup.SourceControlUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SourceControlUpdateParameters struct. -func (scup *SourceControlUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var sourceControlUpdateProperties SourceControlUpdateProperties - err = json.Unmarshal(*v, &sourceControlUpdateProperties) - if err != nil { - return err - } - scup.SourceControlUpdateProperties = &sourceControlUpdateProperties - } - } - } - - return nil -} - -// SourceControlUpdateProperties the properties of the update source control -type SourceControlUpdateProperties struct { - // Branch - The repo branch of the source control. - Branch *string `json:"branch,omitempty"` - // FolderPath - The folder path of the source control. Path must be relative. - FolderPath *string `json:"folderPath,omitempty"` - // AutoSync - The auto sync of the source control. Default is false. - AutoSync *bool `json:"autoSync,omitempty"` - // PublishRunbook - The auto publish of the source control. Default is true. - PublishRunbook *bool `json:"publishRunbook,omitempty"` - // SecurityToken - The authorization token for the repo of the source control. - SecurityToken *SourceControlSecurityTokenProperties `json:"securityToken,omitempty"` - // Description - The user description of the source control. - Description *string `json:"description,omitempty"` -} - -// Statistics definition of the statistic. -type Statistics struct { - // CounterProperty - READ-ONLY; Gets the property value of the statistic. - CounterProperty *string `json:"counterProperty,omitempty"` - // CounterValue - READ-ONLY; Gets the value of the statistic. - CounterValue *int64 `json:"counterValue,omitempty"` - // StartTime - READ-ONLY; Gets the startTime of the statistic. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; Gets the endTime of the statistic. - EndTime *date.Time `json:"endTime,omitempty"` - // ID - READ-ONLY; Gets the id. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for Statistics. -func (s Statistics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// StatisticsListResult the response model for the list statistics operation. -type StatisticsListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of statistics. - Value *[]Statistics `json:"value,omitempty"` -} - -// String ... -type String struct { - autorest.Response `json:"-"` - Value *string `json:"value,omitempty"` -} - -// SUCScheduleProperties definition of schedule parameters. -type SUCScheduleProperties struct { - // StartTime - Gets or sets the start time of the schedule. - StartTime *date.Time `json:"startTime,omitempty"` - // StartTimeOffsetMinutes - READ-ONLY; Gets the start time's offset in minutes. - StartTimeOffsetMinutes *float64 `json:"startTimeOffsetMinutes,omitempty"` - // ExpiryTime - Gets or sets the end time of the schedule. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // ExpiryTimeOffsetMinutes - Gets or sets the expiry time's offset in minutes. - ExpiryTimeOffsetMinutes *float64 `json:"expiryTimeOffsetMinutes,omitempty"` - // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. - IsEnabled *bool `json:"isEnabled,omitempty"` - // NextRun - Gets or sets the next run time of the schedule. - NextRun *date.Time `json:"nextRun,omitempty"` - // NextRunOffsetMinutes - Gets or sets the next run time's offset in minutes. - NextRunOffsetMinutes *float64 `json:"nextRunOffsetMinutes,omitempty"` - // Interval - Gets or sets the interval of the schedule. - Interval *int64 `json:"interval,omitempty"` - // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'ScheduleFrequencyOneTime', 'ScheduleFrequencyDay', 'ScheduleFrequencyHour', 'ScheduleFrequencyWeek', 'ScheduleFrequencyMonth', 'ScheduleFrequencyMinute' - Frequency ScheduleFrequency `json:"frequency,omitempty"` - // TimeZone - Gets or sets the time zone of the schedule. - TimeZone *string `json:"timeZone,omitempty"` - // AdvancedSchedule - Gets or sets the advanced schedule. - AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` - // CreationTime - Gets or sets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for SUCScheduleProperties. -func (ssp SUCScheduleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ssp.StartTime != nil { - objectMap["startTime"] = ssp.StartTime - } - if ssp.ExpiryTime != nil { - objectMap["expiryTime"] = ssp.ExpiryTime - } - if ssp.ExpiryTimeOffsetMinutes != nil { - objectMap["expiryTimeOffsetMinutes"] = ssp.ExpiryTimeOffsetMinutes - } - if ssp.IsEnabled != nil { - objectMap["isEnabled"] = ssp.IsEnabled - } - if ssp.NextRun != nil { - objectMap["nextRun"] = ssp.NextRun - } - if ssp.NextRunOffsetMinutes != nil { - objectMap["nextRunOffsetMinutes"] = ssp.NextRunOffsetMinutes - } - if ssp.Interval != nil { - objectMap["interval"] = ssp.Interval - } - if ssp.Frequency != "" { - objectMap["frequency"] = ssp.Frequency - } - if ssp.TimeZone != nil { - objectMap["timeZone"] = ssp.TimeZone - } - if ssp.AdvancedSchedule != nil { - objectMap["advancedSchedule"] = ssp.AdvancedSchedule - } - if ssp.CreationTime != nil { - objectMap["creationTime"] = ssp.CreationTime - } - if ssp.LastModifiedTime != nil { - objectMap["lastModifiedTime"] = ssp.LastModifiedTime - } - if ssp.Description != nil { - objectMap["description"] = ssp.Description - } - return json.Marshal(objectMap) -} - -// TagSettingsProperties tag filter information for the VM. -type TagSettingsProperties struct { - // Tags - Dictionary of tags with its list of values. - Tags map[string][]string `json:"tags"` - // FilterOperator - Filter VMs by Any or All specified tags. Possible values include: 'TagOperatorsAll', 'TagOperatorsAny' - FilterOperator TagOperators `json:"filterOperator,omitempty"` -} - -// MarshalJSON is the custom marshaler for TagSettingsProperties. -func (tsp TagSettingsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tsp.Tags != nil { - objectMap["tags"] = tsp.Tags - } - if tsp.FilterOperator != "" { - objectMap["filterOperator"] = tsp.FilterOperator - } - return json.Marshal(objectMap) -} - -// TargetProperties group specific to the update configuration. -type TargetProperties struct { - // AzureQueries - List of Azure queries in the software update configuration. - AzureQueries *[]AzureQueryProperties `json:"azureQueries,omitempty"` - // NonAzureQueries - List of non Azure queries in the software update configuration. - NonAzureQueries *[]NonAzureQueryProperties `json:"nonAzureQueries,omitempty"` -} - -// TaskProperties task properties of the software update configuration. -type TaskProperties struct { - // Parameters - Gets or sets the parameters of the task. - Parameters map[string]*string `json:"parameters"` - // Source - Gets or sets the name of the runbook. - Source *string `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for TaskProperties. -func (tp TaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tp.Parameters != nil { - objectMap["parameters"] = tp.Parameters - } - if tp.Source != nil { - objectMap["source"] = tp.Source - } - return json.Marshal(objectMap) -} - -// TestJob definition of the test job. -type TestJob struct { - autorest.Response `json:"-"` - // CreationTime - Gets or sets the creation time of the test job. - CreationTime *date.Time `json:"creationTime,omitempty"` - // Status - Gets or sets the status of the test job. - Status *string `json:"status,omitempty"` - // StatusDetails - Gets or sets the status details of the test job. - StatusDetails *string `json:"statusDetails,omitempty"` - // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. - RunOn *string `json:"runOn,omitempty"` - // StartTime - Gets or sets the start time of the test job. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Gets or sets the end time of the test job. - EndTime *date.Time `json:"endTime,omitempty"` - // Exception - Gets or sets the exception of the test job. - Exception *string `json:"exception,omitempty"` - // LastModifiedTime - Gets or sets the last modified time of the test job. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // LastStatusModifiedTime - Gets or sets the last status modified time of the test job. - LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` - // Parameters - Gets or sets the parameters of the test job. - Parameters map[string]*string `json:"parameters"` - // LogActivityTrace - The activity-level tracing options of the runbook. - LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` -} - -// MarshalJSON is the custom marshaler for TestJob. -func (tj TestJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tj.CreationTime != nil { - objectMap["creationTime"] = tj.CreationTime - } - if tj.Status != nil { - objectMap["status"] = tj.Status - } - if tj.StatusDetails != nil { - objectMap["statusDetails"] = tj.StatusDetails - } - if tj.RunOn != nil { - objectMap["runOn"] = tj.RunOn - } - if tj.StartTime != nil { - objectMap["startTime"] = tj.StartTime - } - if tj.EndTime != nil { - objectMap["endTime"] = tj.EndTime - } - if tj.Exception != nil { - objectMap["exception"] = tj.Exception - } - if tj.LastModifiedTime != nil { - objectMap["lastModifiedTime"] = tj.LastModifiedTime - } - if tj.LastStatusModifiedTime != nil { - objectMap["lastStatusModifiedTime"] = tj.LastStatusModifiedTime - } - if tj.Parameters != nil { - objectMap["parameters"] = tj.Parameters - } - if tj.LogActivityTrace != nil { - objectMap["logActivityTrace"] = tj.LogActivityTrace - } - return json.Marshal(objectMap) -} - -// TestJobCreateParameters the parameters supplied to the create test job operation. -type TestJobCreateParameters struct { - // Parameters - Gets or sets the parameters of the test job. - Parameters map[string]*string `json:"parameters"` - // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. - RunOn *string `json:"runOn,omitempty"` -} - -// MarshalJSON is the custom marshaler for TestJobCreateParameters. -func (tjcp TestJobCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tjcp.Parameters != nil { - objectMap["parameters"] = tjcp.Parameters - } - if tjcp.RunOn != nil { - objectMap["runOn"] = tjcp.RunOn - } - return json.Marshal(objectMap) -} - -// TrackedResource the resource model definition for a ARM tracked top level resource -type TrackedResource struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The Azure Region where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for TrackedResource. -func (tr TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.Tags != nil { - objectMap["tags"] = tr.Tags - } - if tr.Location != nil { - objectMap["location"] = tr.Location - } - return json.Marshal(objectMap) -} - -// TypeField information about a field of a type. -type TypeField struct { - // Name - Gets or sets the name of the field. - Name *string `json:"name,omitempty"` - // Type - Gets or sets the type of the field. - Type *string `json:"type,omitempty"` -} - -// TypeFieldListResult the response model for the list fields operation. -type TypeFieldListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of fields. - Value *[]TypeField `json:"value,omitempty"` -} - -// UpdateConfiguration update specific properties of the software update configuration. -type UpdateConfiguration struct { - // OperatingSystem - operating system of target machines. Possible values include: 'OperatingSystemTypeWindows', 'OperatingSystemTypeLinux' - OperatingSystem OperatingSystemType `json:"operatingSystem,omitempty"` - // Windows - Windows specific update configuration. - Windows *WindowsProperties `json:"windows,omitempty"` - // Linux - Linux specific update configuration. - Linux *LinuxProperties `json:"linux,omitempty"` - // Duration - Maximum time allowed for the software update configuration run. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601 - Duration *string `json:"duration,omitempty"` - // AzureVirtualMachines - List of azure resource Ids for azure virtual machines targeted by the software update configuration. - AzureVirtualMachines *[]string `json:"azureVirtualMachines,omitempty"` - // NonAzureComputerNames - List of names of non-azure machines targeted by the software update configuration. - NonAzureComputerNames *[]string `json:"nonAzureComputerNames,omitempty"` - // Targets - Group targets for the software update configuration. - Targets *TargetProperties `json:"targets,omitempty"` -} - -// UpdateConfigurationMachineRunProperties software update configuration machine run properties. -type UpdateConfigurationMachineRunProperties struct { - // TargetComputer - READ-ONLY; name of the updated computer - TargetComputer *string `json:"targetComputer,omitempty"` - // TargetComputerType - READ-ONLY; type of the updated computer. - TargetComputerType *string `json:"targetComputerType,omitempty"` - // SoftwareUpdateConfiguration - software update configuration triggered this run - SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` - // Status - READ-ONLY; Status of the software update configuration machine run. - Status *string `json:"status,omitempty"` - // OsType - READ-ONLY; Operating system target of the software update configuration triggered this run - OsType *string `json:"osType,omitempty"` - // CorrelationID - READ-ONLY; correlation id of the software update configuration machine run - CorrelationID *uuid.UUID `json:"correlationId,omitempty"` - // SourceComputerID - READ-ONLY; source computer id of the software update configuration machine run - SourceComputerID *uuid.UUID `json:"sourceComputerId,omitempty"` - // StartTime - READ-ONLY; Start time of the software update configuration machine run. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; End time of the software update configuration machine run. - EndTime *date.Time `json:"endTime,omitempty"` - // ConfiguredDuration - READ-ONLY; configured duration for the software update configuration run. - ConfiguredDuration *string `json:"configuredDuration,omitempty"` - // Job - Job associated with the software update configuration machine run - Job *JobNavigation `json:"job,omitempty"` - // CreationTime - READ-ONLY; Creation time of the resource, which only appears in the response. - CreationTime *date.Time `json:"creationTime,omitempty"` - // CreatedBy - READ-ONLY; createdBy property, which only appears in the response. - CreatedBy *string `json:"createdBy,omitempty"` - // LastModifiedTime - READ-ONLY; Last time resource was modified, which only appears in the response. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // LastModifiedBy - READ-ONLY; lastModifiedBy property, which only appears in the response. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // Error - Details of provisioning error - Error *ErrorResponse `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpdateConfigurationMachineRunProperties. -func (ucmrp UpdateConfigurationMachineRunProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ucmrp.SoftwareUpdateConfiguration != nil { - objectMap["softwareUpdateConfiguration"] = ucmrp.SoftwareUpdateConfiguration - } - if ucmrp.Job != nil { - objectMap["job"] = ucmrp.Job - } - if ucmrp.Error != nil { - objectMap["error"] = ucmrp.Error - } - return json.Marshal(objectMap) -} - -// UpdateConfigurationNavigation software update configuration Run Navigation model. -type UpdateConfigurationNavigation struct { - // Name - READ-ONLY; Name of the software update configuration triggered the software update configuration run - Name *string `json:"name,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpdateConfigurationNavigation. -func (ucn UpdateConfigurationNavigation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Usage definition of Usage. -type Usage struct { - // ID - Gets or sets the id of the resource. - ID *string `json:"id,omitempty"` - // Name - Gets or sets the usage counter name. - Name *UsageCounterName `json:"name,omitempty"` - // Unit - Gets or sets the usage unit name. - Unit *string `json:"unit,omitempty"` - // CurrentValue - Gets or sets the current usage value. - CurrentValue *float64 `json:"currentValue,omitempty"` - // Limit - Gets or sets max limit. -1 for unlimited - Limit *int64 `json:"limit,omitempty"` - // ThrottleStatus - Gets or sets the throttle status. - ThrottleStatus *string `json:"throttleStatus,omitempty"` -} - -// UsageCounterName definition of usage counter name. -type UsageCounterName struct { - // Value - Gets or sets the usage counter name. - Value *string `json:"value,omitempty"` - // LocalizedValue - Gets or sets the localized usage counter name. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// UsageListResult the response model for the get usage operation. -type UsageListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets usage. - Value *[]Usage `json:"value,omitempty"` -} - -// Variable definition of the variable. -type Variable struct { - autorest.Response `json:"-"` - // VariableProperties - Gets or sets the properties of the variable. - *VariableProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Variable. -func (vVar Variable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vVar.VariableProperties != nil { - objectMap["properties"] = vVar.VariableProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Variable struct. -func (vVar *Variable) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var variableProperties VariableProperties - err = json.Unmarshal(*v, &variableProperties) - if err != nil { - return err - } - vVar.VariableProperties = &variableProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vVar.Type = &typeVar - } - } - } - - return nil -} - -// VariableCreateOrUpdateParameters the parameters supplied to the create or update variable operation. -type VariableCreateOrUpdateParameters struct { - // Name - Gets or sets the name of the variable. - Name *string `json:"name,omitempty"` - // VariableCreateOrUpdateProperties - Gets or sets the properties of the variable. - *VariableCreateOrUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for VariableCreateOrUpdateParameters. -func (vcoup VariableCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcoup.Name != nil { - objectMap["name"] = vcoup.Name - } - if vcoup.VariableCreateOrUpdateProperties != nil { - objectMap["properties"] = vcoup.VariableCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VariableCreateOrUpdateParameters struct. -func (vcoup *VariableCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vcoup.Name = &name - } - case "properties": - if v != nil { - var variableCreateOrUpdateProperties VariableCreateOrUpdateProperties - err = json.Unmarshal(*v, &variableCreateOrUpdateProperties) - if err != nil { - return err - } - vcoup.VariableCreateOrUpdateProperties = &variableCreateOrUpdateProperties - } - } - } - - return nil -} - -// VariableCreateOrUpdateProperties the properties of the create variable operation. -type VariableCreateOrUpdateProperties struct { - // Value - Gets or sets the value of the variable. - Value *string `json:"value,omitempty"` - // Description - Gets or sets the description of the variable. - Description *string `json:"description,omitempty"` - // IsEncrypted - Gets or sets the encrypted flag of the variable. - IsEncrypted *bool `json:"isEncrypted,omitempty"` -} - -// VariableListResult the response model for the list variables operation. -type VariableListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of variables. - Value *[]Variable `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// VariableListResultIterator provides access to a complete listing of Variable values. -type VariableListResultIterator struct { - i int - page VariableListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VariableListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VariableListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VariableListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VariableListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VariableListResultIterator) Response() VariableListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VariableListResultIterator) Value() Variable { - if !iter.page.NotDone() { - return Variable{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VariableListResultIterator type. -func NewVariableListResultIterator(page VariableListResultPage) VariableListResultIterator { - return VariableListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vlr VariableListResult) IsEmpty() bool { - return vlr.Value == nil || len(*vlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vlr VariableListResult) hasNextLink() bool { - return vlr.NextLink != nil && len(*vlr.NextLink) != 0 -} - -// variableListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vlr VariableListResult) variableListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vlr.NextLink))) -} - -// VariableListResultPage contains a page of Variable values. -type VariableListResultPage struct { - fn func(context.Context, VariableListResult) (VariableListResult, error) - vlr VariableListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VariableListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VariableListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vlr) - if err != nil { - return err - } - page.vlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VariableListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VariableListResultPage) NotDone() bool { - return !page.vlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VariableListResultPage) Response() VariableListResult { - return page.vlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VariableListResultPage) Values() []Variable { - if page.vlr.IsEmpty() { - return nil - } - return *page.vlr.Value -} - -// Creates a new instance of the VariableListResultPage type. -func NewVariableListResultPage(cur VariableListResult, getNextPage func(context.Context, VariableListResult) (VariableListResult, error)) VariableListResultPage { - return VariableListResultPage{ - fn: getNextPage, - vlr: cur, - } -} - -// VariableProperties definition of the variable properties -type VariableProperties struct { - // Value - Gets or sets the value of the variable. - Value *string `json:"value,omitempty"` - // IsEncrypted - Gets or sets the encrypted flag of the variable. - IsEncrypted *bool `json:"isEncrypted,omitempty"` - // CreationTime - Gets or sets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// VariableUpdateParameters the parameters supplied to the update variable operation. -type VariableUpdateParameters struct { - // Name - Gets or sets the name of the variable. - Name *string `json:"name,omitempty"` - // VariableUpdateProperties - Gets or sets the value of the variable. - *VariableUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for VariableUpdateParameters. -func (vup VariableUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vup.Name != nil { - objectMap["name"] = vup.Name - } - if vup.VariableUpdateProperties != nil { - objectMap["properties"] = vup.VariableUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VariableUpdateParameters struct. -func (vup *VariableUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vup.Name = &name - } - case "properties": - if v != nil { - var variableUpdateProperties VariableUpdateProperties - err = json.Unmarshal(*v, &variableUpdateProperties) - if err != nil { - return err - } - vup.VariableUpdateProperties = &variableUpdateProperties - } - } - } - - return nil -} - -// VariableUpdateProperties the properties of the update variable -type VariableUpdateProperties struct { - // Value - Gets or sets the value of the variable. - Value *string `json:"value,omitempty"` - // Description - Gets or sets the description of the variable. - Description *string `json:"description,omitempty"` -} - -// Watcher definition of the watcher type. -type Watcher struct { - autorest.Response `json:"-"` - // WatcherProperties - Gets or sets the watcher properties. - *WatcherProperties `json:"properties,omitempty"` - // Etag - Gets or sets the etag of the resource. - Etag *string `json:"etag,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Watcher. -func (w Watcher) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if w.WatcherProperties != nil { - objectMap["properties"] = w.WatcherProperties - } - if w.Etag != nil { - objectMap["etag"] = w.Etag - } - if w.Tags != nil { - objectMap["tags"] = w.Tags - } - if w.Location != nil { - objectMap["location"] = w.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Watcher struct. -func (w *Watcher) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var watcherProperties WatcherProperties - err = json.Unmarshal(*v, &watcherProperties) - if err != nil { - return err - } - w.WatcherProperties = &watcherProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - w.Etag = &etag - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - w.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - w.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - w.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - w.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - w.Type = &typeVar - } - } - } - - return nil -} - -// WatcherListResult the response model for the list watcher operation. -type WatcherListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of watchers. - Value *[]Watcher `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// WatcherListResultIterator provides access to a complete listing of Watcher values. -type WatcherListResultIterator struct { - i int - page WatcherListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *WatcherListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatcherListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WatcherListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WatcherListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter WatcherListResultIterator) Response() WatcherListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter WatcherListResultIterator) Value() Watcher { - if !iter.page.NotDone() { - return Watcher{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WatcherListResultIterator type. -func NewWatcherListResultIterator(page WatcherListResultPage) WatcherListResultIterator { - return WatcherListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (wlr WatcherListResult) IsEmpty() bool { - return wlr.Value == nil || len(*wlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (wlr WatcherListResult) hasNextLink() bool { - return wlr.NextLink != nil && len(*wlr.NextLink) != 0 -} - -// watcherListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wlr WatcherListResult) watcherListResultPreparer(ctx context.Context) (*http.Request, error) { - if !wlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wlr.NextLink))) -} - -// WatcherListResultPage contains a page of Watcher values. -type WatcherListResultPage struct { - fn func(context.Context, WatcherListResult) (WatcherListResult, error) - wlr WatcherListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *WatcherListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatcherListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wlr) - if err != nil { - return err - } - page.wlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *WatcherListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WatcherListResultPage) NotDone() bool { - return !page.wlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page WatcherListResultPage) Response() WatcherListResult { - return page.wlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page WatcherListResultPage) Values() []Watcher { - if page.wlr.IsEmpty() { - return nil - } - return *page.wlr.Value -} - -// Creates a new instance of the WatcherListResultPage type. -func NewWatcherListResultPage(cur WatcherListResult, getNextPage func(context.Context, WatcherListResult) (WatcherListResult, error)) WatcherListResultPage { - return WatcherListResultPage{ - fn: getNextPage, - wlr: cur, - } -} - -// WatcherProperties definition of the watcher properties -type WatcherProperties struct { - // ExecutionFrequencyInSeconds - Gets or sets the frequency at which the watcher is invoked. - ExecutionFrequencyInSeconds *int64 `json:"executionFrequencyInSeconds,omitempty"` - // ScriptName - Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook. - ScriptName *string `json:"scriptName,omitempty"` - // ScriptParameters - Gets or sets the parameters of the script. - ScriptParameters map[string]*string `json:"scriptParameters"` - // ScriptRunOn - Gets or sets the name of the hybrid worker group the watcher will run on. - ScriptRunOn *string `json:"scriptRunOn,omitempty"` - // Status - READ-ONLY; Gets the current status of the watcher. - Status *string `json:"status,omitempty"` - // CreationTime - READ-ONLY; Gets or sets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - READ-ONLY; Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // LastModifiedBy - READ-ONLY; Details of the user who last modified the watcher. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for WatcherProperties. -func (wp WatcherProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wp.ExecutionFrequencyInSeconds != nil { - objectMap["executionFrequencyInSeconds"] = wp.ExecutionFrequencyInSeconds - } - if wp.ScriptName != nil { - objectMap["scriptName"] = wp.ScriptName - } - if wp.ScriptParameters != nil { - objectMap["scriptParameters"] = wp.ScriptParameters - } - if wp.ScriptRunOn != nil { - objectMap["scriptRunOn"] = wp.ScriptRunOn - } - if wp.Description != nil { - objectMap["description"] = wp.Description - } - return json.Marshal(objectMap) -} - -// WatcherUpdateParameters ... -type WatcherUpdateParameters struct { - // WatcherUpdateProperties - Gets or sets the watcher update properties. - *WatcherUpdateProperties `json:"properties,omitempty"` - // Name - Gets or sets the name of the resource. - Name *string `json:"name,omitempty"` -} - -// MarshalJSON is the custom marshaler for WatcherUpdateParameters. -func (wup WatcherUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wup.WatcherUpdateProperties != nil { - objectMap["properties"] = wup.WatcherUpdateProperties - } - if wup.Name != nil { - objectMap["name"] = wup.Name - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for WatcherUpdateParameters struct. -func (wup *WatcherUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var watcherUpdateProperties WatcherUpdateProperties - err = json.Unmarshal(*v, &watcherUpdateProperties) - if err != nil { - return err - } - wup.WatcherUpdateProperties = &watcherUpdateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wup.Name = &name - } - } - } - - return nil -} - -// WatcherUpdateProperties the properties of the update watcher operation. -type WatcherUpdateProperties struct { - // ExecutionFrequencyInSeconds - Gets or sets the frequency at which the watcher is invoked. - ExecutionFrequencyInSeconds *int64 `json:"executionFrequencyInSeconds,omitempty"` -} - -// Webhook definition of the webhook type. -type Webhook struct { - autorest.Response `json:"-"` - // WebhookProperties - Gets or sets the webhook properties. - *WebhookProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Webhook. -func (w Webhook) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if w.WebhookProperties != nil { - objectMap["properties"] = w.WebhookProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Webhook struct. -func (w *Webhook) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var webhookProperties WebhookProperties - err = json.Unmarshal(*v, &webhookProperties) - if err != nil { - return err - } - w.WebhookProperties = &webhookProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - w.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - w.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - w.Type = &typeVar - } - } - } - - return nil -} - -// WebhookCreateOrUpdateParameters the parameters supplied to the create or update webhook operation. -type WebhookCreateOrUpdateParameters struct { - // Name - Gets or sets the name of the webhook. - Name *string `json:"name,omitempty"` - // WebhookCreateOrUpdateProperties - Gets or sets the properties of the webhook. - *WebhookCreateOrUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateParameters. -func (wcoup WebhookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wcoup.Name != nil { - objectMap["name"] = wcoup.Name - } - if wcoup.WebhookCreateOrUpdateProperties != nil { - objectMap["properties"] = wcoup.WebhookCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for WebhookCreateOrUpdateParameters struct. -func (wcoup *WebhookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wcoup.Name = &name - } - case "properties": - if v != nil { - var webhookCreateOrUpdateProperties WebhookCreateOrUpdateProperties - err = json.Unmarshal(*v, &webhookCreateOrUpdateProperties) - if err != nil { - return err - } - wcoup.WebhookCreateOrUpdateProperties = &webhookCreateOrUpdateProperties - } - } - } - - return nil -} - -// WebhookCreateOrUpdateProperties the properties of the create webhook operation. -type WebhookCreateOrUpdateProperties struct { - // IsEnabled - Gets or sets the value of the enabled flag of webhook. - IsEnabled *bool `json:"isEnabled,omitempty"` - // URI - Gets or sets the uri. - URI *string `json:"uri,omitempty"` - // ExpiryTime - Gets or sets the expiry time. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // Parameters - Gets or sets the parameters of the job. - Parameters map[string]*string `json:"parameters"` - // Runbook - Gets or sets the runbook. - Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` - // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. - RunOn *string `json:"runOn,omitempty"` -} - -// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateProperties. -func (wcoup WebhookCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wcoup.IsEnabled != nil { - objectMap["isEnabled"] = wcoup.IsEnabled - } - if wcoup.URI != nil { - objectMap["uri"] = wcoup.URI - } - if wcoup.ExpiryTime != nil { - objectMap["expiryTime"] = wcoup.ExpiryTime - } - if wcoup.Parameters != nil { - objectMap["parameters"] = wcoup.Parameters - } - if wcoup.Runbook != nil { - objectMap["runbook"] = wcoup.Runbook - } - if wcoup.RunOn != nil { - objectMap["runOn"] = wcoup.RunOn - } - return json.Marshal(objectMap) -} - -// WebhookListResult the response model for the list webhook operation. -type WebhookListResult struct { - autorest.Response `json:"-"` - // Value - Gets or sets a list of webhooks. - Value *[]Webhook `json:"value,omitempty"` - // NextLink - Gets or sets the next link. - NextLink *string `json:"nextLink,omitempty"` -} - -// WebhookListResultIterator provides access to a complete listing of Webhook values. -type WebhookListResultIterator struct { - i int - page WebhookListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *WebhookListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WebhookListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WebhookListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter WebhookListResultIterator) Response() WebhookListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter WebhookListResultIterator) Value() Webhook { - if !iter.page.NotDone() { - return Webhook{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WebhookListResultIterator type. -func NewWebhookListResultIterator(page WebhookListResultPage) WebhookListResultIterator { - return WebhookListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (wlr WebhookListResult) IsEmpty() bool { - return wlr.Value == nil || len(*wlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (wlr WebhookListResult) hasNextLink() bool { - return wlr.NextLink != nil && len(*wlr.NextLink) != 0 -} - -// webhookListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wlr WebhookListResult) webhookListResultPreparer(ctx context.Context) (*http.Request, error) { - if !wlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wlr.NextLink))) -} - -// WebhookListResultPage contains a page of Webhook values. -type WebhookListResultPage struct { - fn func(context.Context, WebhookListResult) (WebhookListResult, error) - wlr WebhookListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *WebhookListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wlr) - if err != nil { - return err - } - page.wlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *WebhookListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WebhookListResultPage) NotDone() bool { - return !page.wlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page WebhookListResultPage) Response() WebhookListResult { - return page.wlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page WebhookListResultPage) Values() []Webhook { - if page.wlr.IsEmpty() { - return nil - } - return *page.wlr.Value -} - -// Creates a new instance of the WebhookListResultPage type. -func NewWebhookListResultPage(cur WebhookListResult, getNextPage func(context.Context, WebhookListResult) (WebhookListResult, error)) WebhookListResultPage { - return WebhookListResultPage{ - fn: getNextPage, - wlr: cur, - } -} - -// WebhookProperties definition of the webhook properties -type WebhookProperties struct { - // IsEnabled - Gets or sets the value of the enabled flag of the webhook. - IsEnabled *bool `json:"isEnabled,omitempty"` - // URI - Gets or sets the webhook uri. - URI *string `json:"uri,omitempty"` - // ExpiryTime - Gets or sets the expiry time. - ExpiryTime *date.Time `json:"expiryTime,omitempty"` - // LastInvokedTime - Gets or sets the last invoked time. - LastInvokedTime *date.Time `json:"lastInvokedTime,omitempty"` - // Parameters - Gets or sets the parameters of the job that is created when the webhook calls the runbook it is associated with. - Parameters map[string]*string `json:"parameters"` - // Runbook - Gets or sets the runbook the webhook is associated with. - Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` - // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. - RunOn *string `json:"runOn,omitempty"` - // CreationTime - Gets or sets the creation time. - CreationTime *date.Time `json:"creationTime,omitempty"` - // LastModifiedTime - Gets or sets the last modified time. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // LastModifiedBy - Details of the user who last modified the Webhook - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // Description - Gets or sets the description. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for WebhookProperties. -func (wp WebhookProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wp.IsEnabled != nil { - objectMap["isEnabled"] = wp.IsEnabled - } - if wp.URI != nil { - objectMap["uri"] = wp.URI - } - if wp.ExpiryTime != nil { - objectMap["expiryTime"] = wp.ExpiryTime - } - if wp.LastInvokedTime != nil { - objectMap["lastInvokedTime"] = wp.LastInvokedTime - } - if wp.Parameters != nil { - objectMap["parameters"] = wp.Parameters - } - if wp.Runbook != nil { - objectMap["runbook"] = wp.Runbook - } - if wp.RunOn != nil { - objectMap["runOn"] = wp.RunOn - } - if wp.CreationTime != nil { - objectMap["creationTime"] = wp.CreationTime - } - if wp.LastModifiedTime != nil { - objectMap["lastModifiedTime"] = wp.LastModifiedTime - } - if wp.LastModifiedBy != nil { - objectMap["lastModifiedBy"] = wp.LastModifiedBy - } - if wp.Description != nil { - objectMap["description"] = wp.Description - } - return json.Marshal(objectMap) -} - -// WebhookUpdateParameters the parameters supplied to the update webhook operation. -type WebhookUpdateParameters struct { - // Name - Gets or sets the name of the webhook. - Name *string `json:"name,omitempty"` - // WebhookUpdateProperties - Gets or sets the value of the webhook. - *WebhookUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for WebhookUpdateParameters. -func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wup.Name != nil { - objectMap["name"] = wup.Name - } - if wup.WebhookUpdateProperties != nil { - objectMap["properties"] = wup.WebhookUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for WebhookUpdateParameters struct. -func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wup.Name = &name - } - case "properties": - if v != nil { - var webhookUpdateProperties WebhookUpdateProperties - err = json.Unmarshal(*v, &webhookUpdateProperties) - if err != nil { - return err - } - wup.WebhookUpdateProperties = &webhookUpdateProperties - } - } - } - - return nil -} - -// WebhookUpdateProperties the properties of the update webhook. -type WebhookUpdateProperties struct { - // IsEnabled - Gets or sets the value of the enabled flag of webhook. - IsEnabled *bool `json:"isEnabled,omitempty"` - // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. - RunOn *string `json:"runOn,omitempty"` - // Parameters - Gets or sets the parameters of the job. - Parameters map[string]*string `json:"parameters"` - // Description - Gets or sets the description of the webhook. - Description *string `json:"description,omitempty"` -} - -// MarshalJSON is the custom marshaler for WebhookUpdateProperties. -func (wup WebhookUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wup.IsEnabled != nil { - objectMap["isEnabled"] = wup.IsEnabled - } - if wup.RunOn != nil { - objectMap["runOn"] = wup.RunOn - } - if wup.Parameters != nil { - objectMap["parameters"] = wup.Parameters - } - if wup.Description != nil { - objectMap["description"] = wup.Description - } - return json.Marshal(objectMap) -} - -// WindowsProperties windows specific update configuration. -type WindowsProperties struct { - // IncludedUpdateClassifications - Update classification included in the software update configuration. A comma separated string with required values. Possible values include: 'WindowsUpdateClassesUnclassified', 'WindowsUpdateClassesCritical', 'WindowsUpdateClassesSecurity', 'WindowsUpdateClassesUpdateRollup', 'WindowsUpdateClassesFeaturePack', 'WindowsUpdateClassesServicePack', 'WindowsUpdateClassesDefinition', 'WindowsUpdateClassesTools', 'WindowsUpdateClassesUpdates' - IncludedUpdateClassifications WindowsUpdateClasses `json:"includedUpdateClassifications,omitempty"` - // ExcludedKbNumbers - KB numbers excluded from the software update configuration. - ExcludedKbNumbers *[]string `json:"excludedKbNumbers,omitempty"` - // IncludedKbNumbers - KB numbers included from the software update configuration. - IncludedKbNumbers *[]string `json:"includedKbNumbers,omitempty"` - // RebootSetting - Reboot setting for the software update configuration. - RebootSetting *string `json:"rebootSetting,omitempty"` -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/module.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/module.go deleted file mode 100644 index 7a675e3861fc..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/module.go +++ /dev/null @@ -1,516 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ModuleClient is the automation Client -type ModuleClient struct { - BaseClient -} - -// NewModuleClient creates an instance of the ModuleClient client. -func NewModuleClient(subscriptionID string) ModuleClient { - return NewModuleClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewModuleClientWithBaseURI creates an instance of the ModuleClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewModuleClientWithBaseURI(baseURI string, subscriptionID string) ModuleClient { - return ModuleClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or Update the module identified by module name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// moduleName - the name of module. -// parameters - the create or update parameters for module. -func (client ModuleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (result Module, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("automation.ModuleClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ModuleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ModuleClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ModuleClient) CreateOrUpdateResponder(resp *http.Response) (result Module, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the module by name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// moduleName - the module name. -func (client ModuleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ModuleClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, moduleName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ModuleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ModuleClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ModuleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the module identified by module name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// moduleName - the module name. -func (client ModuleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result Module, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ModuleClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ModuleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ModuleClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ModuleClient) GetResponder(resp *http.Response) (result Module, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of modules. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client ModuleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.mlr.Response.Response != nil { - sc = result.mlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ModuleClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.mlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.mlr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.mlr.hasNextLink() && result.mlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ModuleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client ModuleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client ModuleClient) ListByAutomationAccountResponder(resp *http.Response) (result ModuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client ModuleClient) listByAutomationAccountNextResults(ctx context.Context, lastResults ModuleListResult) (result ModuleListResult, err error) { - req, err := lastResults.moduleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ModuleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) - return -} - -// Update update the module identified by module name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// moduleName - the name of module. -// parameters - the update parameters for module. -func (client ModuleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (result Module, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ModuleClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ModuleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ModuleClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ModuleClient) UpdateResponder(resp *http.Response) (result Module, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/nodecountinformation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/nodecountinformation.go deleted file mode 100644 index 340068634da7..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/nodecountinformation.go +++ /dev/null @@ -1,119 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// NodeCountInformationClient is the automation Client -type NodeCountInformationClient struct { - BaseClient -} - -// NewNodeCountInformationClient creates an instance of the NodeCountInformationClient client. -func NewNodeCountInformationClient(subscriptionID string) NodeCountInformationClient { - return NewNodeCountInformationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewNodeCountInformationClientWithBaseURI creates an instance of the NodeCountInformationClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewNodeCountInformationClientWithBaseURI(baseURI string, subscriptionID string) NodeCountInformationClient { - return NodeCountInformationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve counts for Dsc Nodes. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// countType - the type of counts to retrieve -func (client NodeCountInformationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, countType CountType) (result NodeCounts, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NodeCountInformationClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.NodeCountInformationClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, countType) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.NodeCountInformationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.NodeCountInformationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.NodeCountInformationClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client NodeCountInformationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, countType CountType) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "countType": autorest.Encode("path", countType), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodecounts/{countType}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client NodeCountInformationClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client NodeCountInformationClient) GetResponder(resp *http.Response) (result NodeCounts, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/nodereports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/nodereports.go deleted file mode 100644 index eeb955153da9..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/nodereports.go +++ /dev/null @@ -1,340 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// NodeReportsClient is the automation Client -type NodeReportsClient struct { - BaseClient -} - -// NewNodeReportsClient creates an instance of the NodeReportsClient client. -func NewNodeReportsClient(subscriptionID string) NodeReportsClient { - return NewNodeReportsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewNodeReportsClientWithBaseURI creates an instance of the NodeReportsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewNodeReportsClientWithBaseURI(baseURI string, subscriptionID string) NodeReportsClient { - return NodeReportsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve the Dsc node report data by node id and report id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// nodeID - the Dsc node id. -// reportID - the report id. -func (client NodeReportsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result DscNodeReport, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NodeReportsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.NodeReportsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client NodeReportsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "nodeId": autorest.Encode("path", nodeID), - "reportId": autorest.Encode("path", reportID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client NodeReportsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client NodeReportsClient) GetResponder(resp *http.Response) (result DscNodeReport, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetContent retrieve the Dsc node reports by node id and report id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// nodeID - the Dsc node id. -// reportID - the report id. -func (client NodeReportsClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result SetObject, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NodeReportsClient.GetContent") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.NodeReportsClient", "GetContent", err.Error()) - } - - req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", nil, "Failure preparing request") - return - } - - resp, err := client.GetContentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", resp, "Failure sending request") - return - } - - result, err = client.GetContentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", resp, "Failure responding to request") - return - } - - return -} - -// GetContentPreparer prepares the GetContent request. -func (client NodeReportsClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "nodeId": autorest.Encode("path", nodeID), - "reportId": autorest.Encode("path", reportID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetContentSender sends the GetContent request. The method will close the -// http.Response Body if it receives an error. -func (client NodeReportsClient) GetContentSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetContentResponder handles the response to the GetContent request. The method always -// closes the http.Response Body. -func (client NodeReportsClient) GetContentResponder(resp *http.Response) (result SetObject, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByNode retrieve the Dsc node report list by node id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// nodeID - the parameters supplied to the list operation. -// filter - the filter to apply on the operation. -func (client NodeReportsClient) ListByNode(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NodeReportsClient.ListByNode") - defer func() { - sc := -1 - if result.dnrlr.Response.Response != nil { - sc = result.dnrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.NodeReportsClient", "ListByNode", err.Error()) - } - - result.fn = client.listByNodeNextResults - req, err := client.ListByNodePreparer(ctx, resourceGroupName, automationAccountName, nodeID, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", nil, "Failure preparing request") - return - } - - resp, err := client.ListByNodeSender(req) - if err != nil { - result.dnrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", resp, "Failure sending request") - return - } - - result.dnrlr, err = client.ListByNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", resp, "Failure responding to request") - return - } - if result.dnrlr.hasNextLink() && result.dnrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByNodePreparer prepares the ListByNode request. -func (client NodeReportsClient) ListByNodePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByNodeSender sends the ListByNode request. The method will close the -// http.Response Body if it receives an error. -func (client NodeReportsClient) ListByNodeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByNodeResponder handles the response to the ListByNode request. The method always -// closes the http.Response Body. -func (client NodeReportsClient) ListByNodeResponder(resp *http.Response) (result DscNodeReportListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByNodeNextResults retrieves the next set of results, if any. -func (client NodeReportsClient) listByNodeNextResults(ctx context.Context, lastResults DscNodeReportListResult) (result DscNodeReportListResult, err error) { - req, err := lastResults.dscNodeReportListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByNodeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByNodeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByNodeComplete enumerates all values, automatically crossing page boundaries as required. -func (client NodeReportsClient) ListByNodeComplete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NodeReportsClient.ListByNode") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByNode(ctx, resourceGroupName, automationAccountName, nodeID, filter) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/objectdatatypes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/objectdatatypes.go deleted file mode 100644 index a36c6719a2a3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/objectdatatypes.go +++ /dev/null @@ -1,206 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ObjectDataTypesClient is the automation Client -type ObjectDataTypesClient struct { - BaseClient -} - -// NewObjectDataTypesClient creates an instance of the ObjectDataTypesClient client. -func NewObjectDataTypesClient(subscriptionID string) ObjectDataTypesClient { - return NewObjectDataTypesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewObjectDataTypesClientWithBaseURI creates an instance of the ObjectDataTypesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewObjectDataTypesClientWithBaseURI(baseURI string, subscriptionID string) ObjectDataTypesClient { - return ObjectDataTypesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListFieldsByModuleAndType retrieve a list of fields of a given type identified by module name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// moduleName - the name of module. -// typeName - the name of type. -func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ObjectDataTypesClient.ListFieldsByModuleAndType") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", err.Error()) - } - - req, err := client.ListFieldsByModuleAndTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", nil, "Failure preparing request") - return - } - - resp, err := client.ListFieldsByModuleAndTypeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", resp, "Failure sending request") - return - } - - result, err = client.ListFieldsByModuleAndTypeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", resp, "Failure responding to request") - return - } - - return -} - -// ListFieldsByModuleAndTypePreparer prepares the ListFieldsByModuleAndType request. -func (client ObjectDataTypesClient) ListFieldsByModuleAndTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "typeName": autorest.Encode("path", typeName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFieldsByModuleAndTypeSender sends the ListFieldsByModuleAndType request. The method will close the -// http.Response Body if it receives an error. -func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListFieldsByModuleAndTypeResponder handles the response to the ListFieldsByModuleAndType request. The method always -// closes the http.Response Body. -func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListFieldsByType retrieve a list of fields of a given type across all accessible modules. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// typeName - the name of type. -func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (result TypeFieldListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ObjectDataTypesClient.ListFieldsByType") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByType", err.Error()) - } - - req, err := client.ListFieldsByTypePreparer(ctx, resourceGroupName, automationAccountName, typeName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", nil, "Failure preparing request") - return - } - - resp, err := client.ListFieldsByTypeSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", resp, "Failure sending request") - return - } - - result, err = client.ListFieldsByTypeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", resp, "Failure responding to request") - return - } - - return -} - -// ListFieldsByTypePreparer prepares the ListFieldsByType request. -func (client ObjectDataTypesClient) ListFieldsByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "typeName": autorest.Encode("path", typeName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListFieldsByTypeSender sends the ListFieldsByType request. The method will close the -// http.Response Body if it receives an error. -func (client ObjectDataTypesClient) ListFieldsByTypeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListFieldsByTypeResponder handles the response to the ListFieldsByType request. The method always -// closes the http.Response Body. -func (client ObjectDataTypesClient) ListFieldsByTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/operations.go deleted file mode 100644 index 42612f852cdb..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/operations.go +++ /dev/null @@ -1,98 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the automation Client -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all of the available Automation REST API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Automation/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/privateendpointconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/privateendpointconnections.go deleted file mode 100644 index 438a13e8b8d9..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/privateendpointconnections.go +++ /dev/null @@ -1,382 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateEndpointConnectionsClient is the automation Client -type PrivateEndpointConnectionsClient struct { - BaseClient -} - -// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. -func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { - return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { - return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate approve or reject a private endpoint connection with a given name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// privateEndpointConnectionName - the name of the private endpoint connection. -func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, privateEndpointConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (future PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a private endpoint connection with a given name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// privateEndpointConnectionName - the name of the private endpoint connection. -func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.PrivateEndpointConnectionsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a private endpoint connection. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// privateEndpointConnectionName - the name of the private endpoint connection. -func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.PrivateEndpointConnectionsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount list all private endpoint connections on a Automation account. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client PrivateEndpointConnectionsClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result PrivateEndpointConnectionListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.PrivateEndpointConnectionsClient", "ListByAutomationAccount", err.Error()) - } - - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client PrivateEndpointConnectionsClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/privateEndpointConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) ListByAutomationAccountResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/privatelinkresources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/privatelinkresources.go deleted file mode 100644 index 983e886c1af0..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/privatelinkresources.go +++ /dev/null @@ -1,117 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateLinkResourcesClient is the automation Client -type PrivateLinkResourcesClient struct { - BaseClient -} - -// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. -func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { - return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { - return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Method gets the private link resources that need to be created for Automation account. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client PrivateLinkResourcesClient) Method(ctx context.Context, resourceGroupName string, automationAccountName string) (result PrivateLinkResourceListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Method") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.PrivateLinkResourcesClient", "Method", err.Error()) - } - - req, err := client.MethodPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateLinkResourcesClient", "Method", nil, "Failure preparing request") - return - } - - resp, err := client.MethodSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.PrivateLinkResourcesClient", "Method", resp, "Failure sending request") - return - } - - result, err = client.MethodResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.PrivateLinkResourcesClient", "Method", resp, "Failure responding to request") - return - } - - return -} - -// MethodPreparer prepares the Method request. -func (client PrivateLinkResourcesClient) MethodPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/privateLinkResources", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// MethodSender sends the Method request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkResourcesClient) MethodSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// MethodResponder handles the response to the Method request. The method always -// closes the http.Response Body. -func (client PrivateLinkResourcesClient) MethodResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/python2package.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/python2package.go deleted file mode 100644 index 4faa6b476c5b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/python2package.go +++ /dev/null @@ -1,516 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// Python2PackageClient is the automation Client -type Python2PackageClient struct { - BaseClient -} - -// NewPython2PackageClient creates an instance of the Python2PackageClient client. -func NewPython2PackageClient(subscriptionID string) Python2PackageClient { - return NewPython2PackageClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPython2PackageClientWithBaseURI creates an instance of the Python2PackageClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPython2PackageClientWithBaseURI(baseURI string, subscriptionID string) Python2PackageClient { - return Python2PackageClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or Update the python 2 package identified by package name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// packageName - the name of python package. -// parameters - the create or update parameters for python package. -func (client Python2PackageClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string, parameters PythonPackageCreateParameters) (result Module, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.PythonPackageCreateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.PythonPackageCreateProperties.ContentLink", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.PythonPackageCreateProperties.ContentLink.ContentHash", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PythonPackageCreateProperties.ContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.PythonPackageCreateProperties.ContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("automation.Python2PackageClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, packageName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Python2PackageClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string, parameters PythonPackageCreateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "packageName": autorest.Encode("path", packageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client Python2PackageClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client Python2PackageClient) CreateOrUpdateResponder(resp *http.Response) (result Module, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the python 2 package by name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// packageName - the python package name. -func (client Python2PackageClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.Python2PackageClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, packageName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client Python2PackageClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "packageName": autorest.Encode("path", packageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client Python2PackageClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client Python2PackageClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the python 2 package identified by package name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// packageName - the python package name. -func (client Python2PackageClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string) (result Module, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.Python2PackageClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, packageName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client Python2PackageClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "packageName": autorest.Encode("path", packageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client Python2PackageClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client Python2PackageClient) GetResponder(resp *http.Response) (result Module, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of python 2 packages. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client Python2PackageClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.mlr.Response.Response != nil { - sc = result.mlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.Python2PackageClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.mlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.mlr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.mlr.hasNextLink() && result.mlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client Python2PackageClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client Python2PackageClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client Python2PackageClient) ListByAutomationAccountResponder(resp *http.Response) (result ModuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client Python2PackageClient) listByAutomationAccountNextResults(ctx context.Context, lastResults ModuleListResult) (result ModuleListResult, err error) { - req, err := lastResults.moduleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.Python2PackageClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.Python2PackageClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client Python2PackageClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) - return -} - -// Update update the python 2 package identified by package name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// packageName - the name of python package. -// parameters - the update parameters for python package. -func (client Python2PackageClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string, parameters PythonPackageUpdateParameters) (result Module, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.Python2PackageClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, packageName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client Python2PackageClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string, parameters PythonPackageUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "packageName": autorest.Encode("path", packageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client Python2PackageClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client Python2PackageClient) UpdateResponder(resp *http.Response) (result Module, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/runbook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/runbook.go deleted file mode 100644 index d6727e0dbcc5..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/runbook.go +++ /dev/null @@ -1,698 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RunbookClient is the automation Client -type RunbookClient struct { - BaseClient -} - -// NewRunbookClient creates an instance of the RunbookClient client. -func NewRunbookClient(subscriptionID string) RunbookClient { - return NewRunbookClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRunbookClientWithBaseURI creates an instance of the RunbookClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string) RunbookClient { - return RunbookClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create the runbook identified by runbook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -// parameters - the create or update parameters for runbook. Provide either content link for a published -// runbook or draft, not both. -func (client RunbookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (result Runbook, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - {Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("automation.RunbookClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RunbookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RunbookClient) CreateOrUpdateResponder(resp *http.Response) (result Runbook, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the runbook by name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -func (client RunbookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RunbookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RunbookClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the runbook identified by runbook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -func (client RunbookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result Runbook, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RunbookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RunbookClient) GetResponder(resp *http.Response) (result Runbook, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetContent retrieve the content of runbook identified by runbook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -func (client RunbookClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result ReadCloser, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.GetContent") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookClient", "GetContent", err.Error()) - } - - req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", nil, "Failure preparing request") - return - } - - resp, err := client.GetContentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", resp, "Failure sending request") - return - } - - result, err = client.GetContentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", resp, "Failure responding to request") - return - } - - return -} - -// GetContentPreparer prepares the GetContent request. -func (client RunbookClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetContentSender sends the GetContent request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookClient) GetContentSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetContentResponder handles the response to the GetContent request. The method always -// closes the http.Response Body. -func (client RunbookClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK)) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of runbooks. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client RunbookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.rlr.Response.Response != nil { - sc = result.rlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.rlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.rlr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.rlr.hasNextLink() && result.rlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client RunbookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client RunbookClient) ListByAutomationAccountResponder(resp *http.Response) (result RunbookListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client RunbookClient) listByAutomationAccountNextResults(ctx context.Context, lastResults RunbookListResult) (result RunbookListResult, err error) { - req, err := lastResults.runbookListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client RunbookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) - return -} - -// Publish publish runbook draft. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the parameters supplied to the publish runbook operation. -func (client RunbookClient) Publish(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookPublishFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.Publish") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookClient", "Publish", err.Error()) - } - - req, err := client.PublishPreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Publish", nil, "Failure preparing request") - return - } - - result, err = client.PublishSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Publish", result.Response(), "Failure sending request") - return - } - - return -} - -// PublishPreparer prepares the Publish request. -func (client RunbookClient) PublishPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/publish", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PublishSender sends the Publish request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookClient) PublishSender(req *http.Request) (future RunbookPublishFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PublishResponder handles the response to the Publish request. The method always -// closes the http.Response Body. -func (client RunbookClient) PublishResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update update the runbook identified by runbook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -// parameters - the update parameters for runbook. -func (client RunbookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (result Runbook, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client RunbookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client RunbookClient) UpdateResponder(resp *http.Response) (result Runbook, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/runbookdraft.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/runbookdraft.go deleted file mode 100644 index 221d6347b4ef..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/runbookdraft.go +++ /dev/null @@ -1,382 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "io" - "net/http" -) - -// RunbookDraftClient is the automation Client -type RunbookDraftClient struct { - BaseClient -} - -// NewRunbookDraftClient creates an instance of the RunbookDraftClient client. -func NewRunbookDraftClient(subscriptionID string) RunbookDraftClient { - return NewRunbookDraftClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRunbookDraftClientWithBaseURI creates an instance of the RunbookDraftClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string) RunbookDraftClient { - return RunbookDraftClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve the runbook draft identified by runbook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -func (client RunbookDraftClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraft, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookDraftClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookDraftClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RunbookDraftClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookDraftClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RunbookDraftClient) GetResponder(resp *http.Response) (result RunbookDraft, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetContent retrieve the content of runbook draft identified by runbook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -func (client RunbookDraftClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result ReadCloser, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookDraftClient.GetContent") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookDraftClient", "GetContent", err.Error()) - } - - req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", nil, "Failure preparing request") - return - } - - resp, err := client.GetContentSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure sending request") - return - } - - result, err = client.GetContentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure responding to request") - return - } - - return -} - -// GetContentPreparer prepares the GetContent request. -func (client RunbookDraftClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetContentSender sends the GetContent request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookDraftClient) GetContentSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetContentResponder handles the response to the GetContent request. The method always -// closes the http.Response Body. -func (client RunbookDraftClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK)) - result.Response = autorest.Response{Response: resp} - return -} - -// ReplaceContent replaces the runbook draft content. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// 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 io.ReadCloser) (result RunbookDraftReplaceContentFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookDraftClient.ReplaceContent") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookDraftClient", "ReplaceContent", err.Error()) - } - - req, err := client.ReplaceContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName, runbookContent) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", nil, "Failure preparing request") - return - } - - result, err = client.ReplaceContentSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", result.Response(), "Failure sending request") - return - } - - return -} - -// ReplaceContentPreparer prepares the ReplaceContent request. -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), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("text/powershell"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), - autorest.WithFile(runbookContent), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReplaceContentSender sends the ReplaceContent request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookDraftClient) ReplaceContentSender(req *http.Request) (future RunbookDraftReplaceContentFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReplaceContentResponder handles the response to the ReplaceContent request. The method always -// closes the http.Response Body. -func (client RunbookDraftClient) ReplaceContentResponder(resp *http.Response) (result ReadCloser, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UndoEdit undo draft edit to last known published state identified by runbook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -func (client RunbookDraftClient) UndoEdit(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftUndoEditResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunbookDraftClient.UndoEdit") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookDraftClient", "UndoEdit", err.Error()) - } - - req, err := client.UndoEditPreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", nil, "Failure preparing request") - return - } - - resp, err := client.UndoEditSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", resp, "Failure sending request") - return - } - - result, err = client.UndoEditResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", resp, "Failure responding to request") - return - } - - return -} - -// UndoEditPreparer prepares the UndoEdit request. -func (client RunbookDraftClient) UndoEditPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UndoEditSender sends the UndoEdit request. The method will close the -// http.Response Body if it receives an error. -func (client RunbookDraftClient) UndoEditSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UndoEditResponder handles the response to the UndoEdit request. The method always -// closes the http.Response Body. -func (client RunbookDraftClient) UndoEditResponder(resp *http.Response) (result RunbookDraftUndoEditResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/schedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/schedule.go deleted file mode 100644 index 68ab28b63a2c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/schedule.go +++ /dev/null @@ -1,511 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ScheduleClient is the automation Client -type ScheduleClient struct { - BaseClient -} - -// NewScheduleClient creates an instance of the ScheduleClient client. -func NewScheduleClient(subscriptionID string) ScheduleClient { - return NewScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewScheduleClientWithBaseURI creates an instance of the ScheduleClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewScheduleClientWithBaseURI(baseURI string, subscriptionID string) ScheduleClient { - return ScheduleClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create a schedule. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// scheduleName - the schedule name. -// parameters - the parameters supplied to the create or update schedule operation. -func (client ScheduleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (result Schedule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ScheduleCreateOrUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ScheduleCreateOrUpdateProperties.StartTime", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("automation.ScheduleClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ScheduleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scheduleName": autorest.Encode("path", scheduleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ScheduleClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ScheduleClient) CreateOrUpdateResponder(resp *http.Response) (result Schedule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusConflict), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the schedule identified by schedule name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// scheduleName - the schedule name. -func (client ScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ScheduleClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, scheduleName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scheduleName": autorest.Encode("path", scheduleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the schedule identified by schedule name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// scheduleName - the schedule name. -func (client ScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result Schedule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ScheduleClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, scheduleName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scheduleName": autorest.Encode("path", scheduleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ScheduleClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ScheduleClient) GetResponder(resp *http.Response) (result Schedule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of schedules. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.slr.Response.Response != nil { - sc = result.slr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ScheduleClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.slr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.slr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.slr.hasNextLink() && result.slr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client ScheduleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client ScheduleClient) ListByAutomationAccountResponder(resp *http.Response) (result ScheduleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client ScheduleClient) listByAutomationAccountNextResults(ctx context.Context, lastResults ScheduleListResult) (result ScheduleListResult, err error) { - req, err := lastResults.scheduleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) - return -} - -// Update update the schedule identified by schedule name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// scheduleName - the schedule name. -// parameters - the parameters supplied to the update schedule operation. -func (client ScheduleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (result Schedule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ScheduleClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ScheduleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scheduleName": autorest.Encode("path", scheduleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ScheduleClient) UpdateResponder(resp *http.Response) (result Schedule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationmachineruns.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationmachineruns.go deleted file mode 100644 index d1f3bb5a6cd1..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationmachineruns.go +++ /dev/null @@ -1,228 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "github.com/gofrs/uuid" - "net/http" -) - -// SoftwareUpdateConfigurationMachineRunsClient is the automation Client -type SoftwareUpdateConfigurationMachineRunsClient struct { - BaseClient -} - -// NewSoftwareUpdateConfigurationMachineRunsClient creates an instance of the -// SoftwareUpdateConfigurationMachineRunsClient client. -func NewSoftwareUpdateConfigurationMachineRunsClient(subscriptionID string) SoftwareUpdateConfigurationMachineRunsClient { - return NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI creates an instance of the -// SoftwareUpdateConfigurationMachineRunsClient client using a custom endpoint. Use this when interacting with an -// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationMachineRunsClient { - return SoftwareUpdateConfigurationMachineRunsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetByID get a single software update configuration machine run by Id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// softwareUpdateConfigurationMachineRunID - the Id of the software update configuration machine run. -// clientRequestID - identifies this specific client request. -func (client SoftwareUpdateConfigurationMachineRunsClient) GetByID(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationMachineRunID uuid.UUID, clientRequestID string) (result SoftwareUpdateConfigurationMachineRun, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationMachineRunsClient.GetByID") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", err.Error()) - } - - req, err := client.GetByIDPreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationMachineRunID, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", nil, "Failure preparing request") - return - } - - resp, err := client.GetByIDSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", resp, "Failure sending request") - return - } - - result, err = client.GetByIDResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", resp, "Failure responding to request") - return - } - - return -} - -// GetByIDPreparer prepares the GetByID request. -func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationMachineRunID uuid.UUID, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "softwareUpdateConfigurationMachineRunId": autorest.Encode("path", softwareUpdateConfigurationMachineRunID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByIDSender sends the GetByID request. The method will close the -// http.Response Body if it receives an error. -func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetByIDResponder handles the response to the GetByID request. The method always -// closes the http.Response Body. -func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDResponder(resp *http.Response) (result SoftwareUpdateConfigurationMachineRun, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List return list of software update configuration machine runs -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// clientRequestID - identifies this specific client request. -// filter - the filter to apply on the operation. You can use the following filters: 'properties/osType', -// 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' -// skip - number of entries you skip before returning results -// top - maximum number of entries returned in the results collection -func (client SoftwareUpdateConfigurationMachineRunsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (result SoftwareUpdateConfigurationMachineRunListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationMachineRunsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SoftwareUpdateConfigurationMachineRunsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter, skip, top) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SoftwareUpdateConfigurationMachineRunsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(skip) > 0 { - queryParameters["$skip"] = autorest.Encode("query", skip) - } - if len(top) > 0 { - queryParameters["$top"] = autorest.Encode("query", top) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SoftwareUpdateConfigurationMachineRunsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SoftwareUpdateConfigurationMachineRunsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationMachineRunListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationruns.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationruns.go deleted file mode 100644 index 3f81299ed59b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationruns.go +++ /dev/null @@ -1,227 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "github.com/gofrs/uuid" - "net/http" -) - -// SoftwareUpdateConfigurationRunsClient is the automation Client -type SoftwareUpdateConfigurationRunsClient struct { - BaseClient -} - -// NewSoftwareUpdateConfigurationRunsClient creates an instance of the SoftwareUpdateConfigurationRunsClient client. -func NewSoftwareUpdateConfigurationRunsClient(subscriptionID string) SoftwareUpdateConfigurationRunsClient { - return NewSoftwareUpdateConfigurationRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSoftwareUpdateConfigurationRunsClientWithBaseURI creates an instance of the SoftwareUpdateConfigurationRunsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewSoftwareUpdateConfigurationRunsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationRunsClient { - return SoftwareUpdateConfigurationRunsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetByID get a single software update configuration Run by Id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// softwareUpdateConfigurationRunID - the Id of the software update configuration run. -// clientRequestID - identifies this specific client request. -func (client SoftwareUpdateConfigurationRunsClient) GetByID(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationRunID uuid.UUID, clientRequestID string) (result SoftwareUpdateConfigurationRun, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationRunsClient.GetByID") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SoftwareUpdateConfigurationRunsClient", "GetByID", err.Error()) - } - - req, err := client.GetByIDPreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationRunID, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", nil, "Failure preparing request") - return - } - - resp, err := client.GetByIDSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", resp, "Failure sending request") - return - } - - result, err = client.GetByIDResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", resp, "Failure responding to request") - return - } - - return -} - -// GetByIDPreparer prepares the GetByID request. -func (client SoftwareUpdateConfigurationRunsClient) GetByIDPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationRunID uuid.UUID, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "softwareUpdateConfigurationRunId": autorest.Encode("path", softwareUpdateConfigurationRunID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByIDSender sends the GetByID request. The method will close the -// http.Response Body if it receives an error. -func (client SoftwareUpdateConfigurationRunsClient) GetByIDSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetByIDResponder handles the response to the GetByID request. The method always -// closes the http.Response Body. -func (client SoftwareUpdateConfigurationRunsClient) GetByIDResponder(resp *http.Response) (result SoftwareUpdateConfigurationRun, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List return list of software update configuration runs -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// clientRequestID - identifies this specific client request. -// filter - the filter to apply on the operation. You can use the following filters: 'properties/osType', -// 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' -// skip - number of entries you skip before returning results -// top - maximum number of entries returned in the results collection -func (client SoftwareUpdateConfigurationRunsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (result SoftwareUpdateConfigurationRunListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationRunsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SoftwareUpdateConfigurationRunsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter, skip, top) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SoftwareUpdateConfigurationRunsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(skip) > 0 { - queryParameters["$skip"] = autorest.Encode("query", skip) - } - if len(top) > 0 { - queryParameters["$top"] = autorest.Encode("query", top) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SoftwareUpdateConfigurationRunsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SoftwareUpdateConfigurationRunsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationRunListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurations.go deleted file mode 100644 index 145e3cfdc4e9..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurations.go +++ /dev/null @@ -1,409 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SoftwareUpdateConfigurationsClient is the automation Client -type SoftwareUpdateConfigurationsClient struct { - BaseClient -} - -// NewSoftwareUpdateConfigurationsClient creates an instance of the SoftwareUpdateConfigurationsClient client. -func NewSoftwareUpdateConfigurationsClient(subscriptionID string) SoftwareUpdateConfigurationsClient { - return NewSoftwareUpdateConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSoftwareUpdateConfigurationsClientWithBaseURI creates an instance of the SoftwareUpdateConfigurationsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewSoftwareUpdateConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationsClient { - return SoftwareUpdateConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create a new software update configuration with the name given in the URI. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// softwareUpdateConfigurationName - the name of the software update configuration to be created. -// parameters - request body. -// clientRequestID - identifies this specific client request. -func (client SoftwareUpdateConfigurationsClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, parameters SoftwareUpdateConfiguration, clientRequestID string) (result SoftwareUpdateConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationsClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.SoftwareUpdateConfigurationProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.SoftwareUpdateConfigurationProperties.UpdateConfiguration", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.SoftwareUpdateConfigurationProperties.ScheduleInfo", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, parameters, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client SoftwareUpdateConfigurationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, parameters SoftwareUpdateConfiguration, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Name = nil - parameters.ID = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client SoftwareUpdateConfigurationsClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client SoftwareUpdateConfigurationsClient) CreateResponder(resp *http.Response) (result SoftwareUpdateConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a specific software update configuration. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// softwareUpdateConfigurationName - the name of the software update configuration to be created. -// clientRequestID - identifies this specific client request. -func (client SoftwareUpdateConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SoftwareUpdateConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SoftwareUpdateConfigurationsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SoftwareUpdateConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetByName get a single software update configuration by name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// softwareUpdateConfigurationName - the name of the software update configuration to be created. -// clientRequestID - identifies this specific client request. -func (client SoftwareUpdateConfigurationsClient) GetByName(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (result SoftwareUpdateConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationsClient.GetByName") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "GetByName", err.Error()) - } - - req, err := client.GetByNamePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", nil, "Failure preparing request") - return - } - - resp, err := client.GetByNameSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", resp, "Failure sending request") - return - } - - result, err = client.GetByNameResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", resp, "Failure responding to request") - return - } - - return -} - -// GetByNamePreparer prepares the GetByName request. -func (client SoftwareUpdateConfigurationsClient) GetByNamePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByNameSender sends the GetByName request. The method will close the -// http.Response Body if it receives an error. -func (client SoftwareUpdateConfigurationsClient) GetByNameSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetByNameResponder handles the response to the GetByName request. The method always -// closes the http.Response Body. -func (client SoftwareUpdateConfigurationsClient) GetByNameResponder(resp *http.Response) (result SoftwareUpdateConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get all software update configurations for the account. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// clientRequestID - identifies this specific client request. -// filter - the filter to apply on the operation. -func (client SoftwareUpdateConfigurationsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string) (result SoftwareUpdateConfigurationListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SoftwareUpdateConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if len(clientRequestID) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SoftwareUpdateConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SoftwareUpdateConfigurationsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrol.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrol.go deleted file mode 100644 index 7b8f6d2f374b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrol.go +++ /dev/null @@ -1,528 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SourceControlClient is the automation Client -type SourceControlClient struct { - BaseClient -} - -// NewSourceControlClient creates an instance of the SourceControlClient client. -func NewSourceControlClient(subscriptionID string) SourceControlClient { - return NewSourceControlClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSourceControlClientWithBaseURI creates an instance of the SourceControlClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSourceControlClientWithBaseURI(baseURI string, subscriptionID string) SourceControlClient { - return SourceControlClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create a source control. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// sourceControlName - the source control name. -// parameters - the parameters supplied to the create or update source control operation. -func (client SourceControlClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlCreateOrUpdateParameters) (result SourceControl, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.RepoURL", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.RepoURL", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, - {Target: "parameters.SourceControlCreateOrUpdateProperties.Branch", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.Branch", Name: validation.MaxLength, Rule: 255, Chain: nil}}}, - {Target: "parameters.SourceControlCreateOrUpdateProperties.FolderPath", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.FolderPath", Name: validation.MaxLength, Rule: 255, Chain: nil}}}, - {Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken.AccessToken", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken.AccessToken", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, - {Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken.RefreshToken", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken.RefreshToken", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, - }}, - {Target: "parameters.SourceControlCreateOrUpdateProperties.Description", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.Description", Name: validation.MaxLength, Rule: 512, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("automation.SourceControlClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SourceControlClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sourceControlName": autorest.Encode("path", sourceControlName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SourceControlClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SourceControlClient) CreateOrUpdateResponder(resp *http.Response) (result SourceControl, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the source control. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// sourceControlName - the name of source control. -func (client SourceControlClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SourceControlClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SourceControlClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sourceControlName": autorest.Encode("path", sourceControlName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SourceControlClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SourceControlClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the source control identified by source control name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// sourceControlName - the name of source control. -func (client SourceControlClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (result SourceControl, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SourceControlClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SourceControlClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sourceControlName": autorest.Encode("path", sourceControlName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SourceControlClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SourceControlClient) GetResponder(resp *http.Response) (result SourceControl, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of source controls. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -func (client SourceControlClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result SourceControlListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.sclr.Response.Response != nil { - sc = result.sclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SourceControlClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.sclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.sclr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.sclr.hasNextLink() && result.sclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client SourceControlClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client SourceControlClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client SourceControlClient) ListByAutomationAccountResponder(resp *http.Response) (result SourceControlListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client SourceControlClient) listByAutomationAccountNextResults(ctx context.Context, lastResults SourceControlListResult) (result SourceControlListResult, err error) { - req, err := lastResults.sourceControlListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client SourceControlClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result SourceControlListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) - return -} - -// Update update a source control. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// sourceControlName - the source control name. -// parameters - the parameters supplied to the update source control operation. -func (client SourceControlClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlUpdateParameters) (result SourceControl, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SourceControlClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SourceControlClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sourceControlName": autorest.Encode("path", sourceControlName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client SourceControlClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client SourceControlClient) UpdateResponder(resp *http.Response) (result SourceControl, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjob.go deleted file mode 100644 index b981c516366c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjob.go +++ /dev/null @@ -1,350 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "github.com/gofrs/uuid" - "net/http" -) - -// SourceControlSyncJobClient is the automation Client -type SourceControlSyncJobClient struct { - BaseClient -} - -// NewSourceControlSyncJobClient creates an instance of the SourceControlSyncJobClient client. -func NewSourceControlSyncJobClient(subscriptionID string) SourceControlSyncJobClient { - return NewSourceControlSyncJobClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSourceControlSyncJobClientWithBaseURI creates an instance of the SourceControlSyncJobClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewSourceControlSyncJobClientWithBaseURI(baseURI string, subscriptionID string) SourceControlSyncJobClient { - return SourceControlSyncJobClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates the sync job for a source control. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// sourceControlName - the source control name. -// sourceControlSyncJobID - the source control sync job id. -// parameters - the parameters supplied to the create source control sync job operation. -func (client SourceControlSyncJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, parameters SourceControlSyncJobCreateParameters) (result SourceControlSyncJob, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.SourceControlSyncJobCreateProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.SourceControlSyncJobCreateProperties.CommitID", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.SourceControlSyncJobCreateProperties.CommitID", Name: validation.MinLength, Rule: 0, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("automation.SourceControlSyncJobClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client SourceControlSyncJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, parameters SourceControlSyncJobCreateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sourceControlName": autorest.Encode("path", sourceControlName), - "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client SourceControlSyncJobClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client SourceControlSyncJobClient) CreateResponder(resp *http.Response) (result SourceControlSyncJob, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieve the source control sync job identified by job id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// sourceControlName - the source control name. -// sourceControlSyncJobID - the source control sync job id. -func (client SourceControlSyncJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (result SourceControlSyncJobByID, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SourceControlSyncJobClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SourceControlSyncJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sourceControlName": autorest.Encode("path", sourceControlName), - "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SourceControlSyncJobClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SourceControlSyncJobClient) GetResponder(resp *http.Response) (result SourceControlSyncJobByID, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of source control sync jobs. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// sourceControlName - the source control name. -// filter - the filter to apply on the operation. -func (client SourceControlSyncJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (result SourceControlSyncJobListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.scsjlr.Response.Response != nil { - sc = result.scsjlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SourceControlSyncJobClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.scsjlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.scsjlr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.scsjlr.hasNextLink() && result.scsjlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client SourceControlSyncJobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sourceControlName": autorest.Encode("path", sourceControlName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client SourceControlSyncJobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client SourceControlSyncJobClient) ListByAutomationAccountResponder(resp *http.Response) (result SourceControlSyncJobListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client SourceControlSyncJobClient) listByAutomationAccountNextResults(ctx context.Context, lastResults SourceControlSyncJobListResult) (result SourceControlSyncJobListResult, err error) { - req, err := lastResults.sourceControlSyncJobListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client SourceControlSyncJobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (result SourceControlSyncJobListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, sourceControlName, filter) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjobstreams.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjobstreams.go deleted file mode 100644 index a33a2b8e3cfb..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjobstreams.go +++ /dev/null @@ -1,258 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "github.com/gofrs/uuid" - "net/http" -) - -// SourceControlSyncJobStreamsClient is the automation Client -type SourceControlSyncJobStreamsClient struct { - BaseClient -} - -// NewSourceControlSyncJobStreamsClient creates an instance of the SourceControlSyncJobStreamsClient client. -func NewSourceControlSyncJobStreamsClient(subscriptionID string) SourceControlSyncJobStreamsClient { - return NewSourceControlSyncJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSourceControlSyncJobStreamsClientWithBaseURI creates an instance of the SourceControlSyncJobStreamsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewSourceControlSyncJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) SourceControlSyncJobStreamsClient { - return SourceControlSyncJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve a sync job stream identified by stream id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// sourceControlName - the source control name. -// sourceControlSyncJobID - the source control sync job id. -// streamID - the id of the sync job stream. -func (client SourceControlSyncJobStreamsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, streamID string) (result SourceControlSyncJobStreamByID, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SourceControlSyncJobStreamsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, streamID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SourceControlSyncJobStreamsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, streamID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sourceControlName": autorest.Encode("path", sourceControlName), - "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), - "streamId": autorest.Encode("path", streamID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams/{streamId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SourceControlSyncJobStreamsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SourceControlSyncJobStreamsClient) GetResponder(resp *http.Response) (result SourceControlSyncJobStreamByID, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListBySyncJob retrieve a list of sync job streams identified by sync job id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// sourceControlName - the source control name. -// sourceControlSyncJobID - the source control sync job id. -// filter - the filter to apply on the operation. -func (client SourceControlSyncJobStreamsClient) ListBySyncJob(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (result SourceControlSyncJobStreamsListBySyncJobPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsClient.ListBySyncJob") - defer func() { - sc := -1 - if result.scsjslbsj.Response.Response != nil { - sc = result.scsjslbsj.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", err.Error()) - } - - result.fn = client.listBySyncJobNextResults - req, err := client.ListBySyncJobPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySyncJobSender(req) - if err != nil { - result.scsjslbsj.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", resp, "Failure sending request") - return - } - - result.scsjslbsj, err = client.ListBySyncJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", resp, "Failure responding to request") - return - } - if result.scsjslbsj.hasNextLink() && result.scsjslbsj.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySyncJobPreparer prepares the ListBySyncJob request. -func (client SourceControlSyncJobStreamsClient) ListBySyncJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sourceControlName": autorest.Encode("path", sourceControlName), - "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySyncJobSender sends the ListBySyncJob request. The method will close the -// http.Response Body if it receives an error. -func (client SourceControlSyncJobStreamsClient) ListBySyncJobSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySyncJobResponder handles the response to the ListBySyncJob request. The method always -// closes the http.Response Body. -func (client SourceControlSyncJobStreamsClient) ListBySyncJobResponder(resp *http.Response) (result SourceControlSyncJobStreamsListBySyncJob, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySyncJobNextResults retrieves the next set of results, if any. -func (client SourceControlSyncJobStreamsClient) listBySyncJobNextResults(ctx context.Context, lastResults SourceControlSyncJobStreamsListBySyncJob) (result SourceControlSyncJobStreamsListBySyncJob, err error) { - req, err := lastResults.sourceControlSyncJobStreamsListBySyncJobPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySyncJobSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySyncJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySyncJobComplete enumerates all values, automatically crossing page boundaries as required. -func (client SourceControlSyncJobStreamsClient) ListBySyncJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (result SourceControlSyncJobStreamsListBySyncJobIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsClient.ListBySyncJob") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySyncJob(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, filter) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/statistics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/statistics.go deleted file mode 100644 index 4baf146cb0c9..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/statistics.go +++ /dev/null @@ -1,120 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// StatisticsClient is the automation Client -type StatisticsClient struct { - BaseClient -} - -// NewStatisticsClient creates an instance of the StatisticsClient client. -func NewStatisticsClient(subscriptionID string) StatisticsClient { - return NewStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewStatisticsClientWithBaseURI creates an instance of the StatisticsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string) StatisticsClient { - return StatisticsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByAutomationAccount retrieve the statistics for the account. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -func (client StatisticsClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result StatisticsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/StatisticsClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.StatisticsClient", "ListByAutomationAccount", err.Error()) - } - - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client StatisticsClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/statistics", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client StatisticsClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client StatisticsClient) ListByAutomationAccountResponder(resp *http.Response) (result StatisticsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/testjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/testjob.go deleted file mode 100644 index 661e65bdee11..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/testjob.go +++ /dev/null @@ -1,462 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// TestJobClient is the automation Client -type TestJobClient struct { - BaseClient -} - -// NewTestJobClient creates an instance of the TestJobClient client. -func NewTestJobClient(subscriptionID string) TestJobClient { - return NewTestJobClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewTestJobClientWithBaseURI creates an instance of the TestJobClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewTestJobClientWithBaseURI(baseURI string, subscriptionID string) TestJobClient { - return TestJobClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create a test job of the runbook. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the parameters supplied to the create test job operation. -// parameters - the parameters supplied to the create test job operation. -func (client TestJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (result TestJob, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TestJobClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.TestJobClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client TestJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client TestJobClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client TestJobClient) CreateResponder(resp *http.Response) (result TestJob, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieve the test job for the specified runbook. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -func (client TestJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result TestJob, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TestJobClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.TestJobClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client TestJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client TestJobClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client TestJobClient) GetResponder(resp *http.Response) (result TestJob, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Resume resume the test job. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -func (client TestJobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TestJobClient.Resume") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.TestJobClient", "Resume", err.Error()) - } - - req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", nil, "Failure preparing request") - return - } - - resp, err := client.ResumeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure sending request") - return - } - - result, err = client.ResumeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure responding to request") - return - } - - return -} - -// ResumePreparer prepares the Resume request. -func (client TestJobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResumeSender sends the Resume request. The method will close the -// http.Response Body if it receives an error. -func (client TestJobClient) ResumeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ResumeResponder handles the response to the Resume request. The method always -// closes the http.Response Body. -func (client TestJobClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Stop stop the test job. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -func (client TestJobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TestJobClient.Stop") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.TestJobClient", "Stop", err.Error()) - } - - req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", nil, "Failure preparing request") - return - } - - resp, err := client.StopSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure sending request") - return - } - - result, err = client.StopResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure responding to request") - return - } - - return -} - -// StopPreparer prepares the Stop request. -func (client TestJobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopSender sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (client TestJobClient) StopSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// StopResponder handles the response to the Stop request. The method always -// closes the http.Response Body. -func (client TestJobClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Suspend suspend the test job. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -func (client TestJobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TestJobClient.Suspend") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.TestJobClient", "Suspend", err.Error()) - } - - req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, runbookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", nil, "Failure preparing request") - return - } - - resp, err := client.SuspendSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure sending request") - return - } - - result, err = client.SuspendResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure responding to request") - return - } - - return -} - -// SuspendPreparer prepares the Suspend request. -func (client TestJobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SuspendSender sends the Suspend request. The method will close the -// http.Response Body if it receives an error. -func (client TestJobClient) SuspendSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SuspendResponder handles the response to the Suspend request. The method always -// closes the http.Response Body. -func (client TestJobClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/testjobstreams.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/testjobstreams.go deleted file mode 100644 index 0fe6f2525e87..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/testjobstreams.go +++ /dev/null @@ -1,252 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// TestJobStreamsClient is the automation Client -type TestJobStreamsClient struct { - BaseClient -} - -// NewTestJobStreamsClient creates an instance of the TestJobStreamsClient client. -func NewTestJobStreamsClient(subscriptionID string) TestJobStreamsClient { - return NewTestJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewTestJobStreamsClientWithBaseURI creates an instance of the TestJobStreamsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) TestJobStreamsClient { - return TestJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve a test job stream of the test job identified by runbook name and stream id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -// jobStreamID - the job stream id. -func (client TestJobStreamsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (result JobStream, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TestJobStreamsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.TestJobStreamsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName, jobStreamID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client TestJobStreamsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobStreamId": autorest.Encode("path", jobStreamID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client TestJobStreamsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client TestJobStreamsClient) GetResponder(resp *http.Response) (result JobStream, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByTestJob retrieve a list of test job streams identified by runbook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// runbookName - the runbook name. -// filter - the filter to apply on the operation. -func (client TestJobStreamsClient) ListByTestJob(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TestJobStreamsClient.ListByTestJob") - defer func() { - sc := -1 - if result.jslr.Response.Response != nil { - sc = result.jslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.TestJobStreamsClient", "ListByTestJob", err.Error()) - } - - result.fn = client.listByTestJobNextResults - req, err := client.ListByTestJobPreparer(ctx, resourceGroupName, automationAccountName, runbookName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", nil, "Failure preparing request") - return - } - - resp, err := client.ListByTestJobSender(req) - if err != nil { - result.jslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", resp, "Failure sending request") - return - } - - result.jslr, err = client.ListByTestJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", resp, "Failure responding to request") - return - } - if result.jslr.hasNextLink() && result.jslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByTestJobPreparer prepares the ListByTestJob request. -func (client TestJobStreamsClient) ListByTestJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runbookName": autorest.Encode("path", runbookName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-30" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByTestJobSender sends the ListByTestJob request. The method will close the -// http.Response Body if it receives an error. -func (client TestJobStreamsClient) ListByTestJobSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByTestJobResponder handles the response to the ListByTestJob request. The method always -// closes the http.Response Body. -func (client TestJobStreamsClient) ListByTestJobResponder(resp *http.Response) (result JobStreamListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByTestJobNextResults retrieves the next set of results, if any. -func (client TestJobStreamsClient) listByTestJobNextResults(ctx context.Context, lastResults JobStreamListResult) (result JobStreamListResult, err error) { - req, err := lastResults.jobStreamListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByTestJobSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByTestJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByTestJobComplete enumerates all values, automatically crossing page boundaries as required. -func (client TestJobStreamsClient) ListByTestJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TestJobStreamsClient.ListByTestJob") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByTestJob(ctx, resourceGroupName, automationAccountName, runbookName, filter) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/usages.go deleted file mode 100644 index 9d0713805968..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/usages.go +++ /dev/null @@ -1,116 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsagesClient is the automation Client -type UsagesClient struct { - BaseClient -} - -// NewUsagesClient creates an instance of the UsagesClient client. -func NewUsagesClient(subscriptionID string) UsagesClient { - return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { - return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByAutomationAccount retrieve the usage for the account id. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client UsagesClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result UsageListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.UsagesClient", "ListByAutomationAccount", err.Error()) - } - - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client UsagesClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client UsagesClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client UsagesClient) ListByAutomationAccountResponder(resp *http.Response) (result UsageListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/variable.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/variable.go deleted file mode 100644 index a235e357262e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/variable.go +++ /dev/null @@ -1,510 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VariableClient is the automation Client -type VariableClient struct { - BaseClient -} - -// NewVariableClient creates an instance of the VariableClient client. -func NewVariableClient(subscriptionID string) VariableClient { - return NewVariableClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVariableClientWithBaseURI creates an instance of the VariableClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVariableClientWithBaseURI(baseURI string, subscriptionID string) VariableClient { - return VariableClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create a variable. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// variableName - the variable name. -// parameters - the parameters supplied to the create or update variable operation. -func (client VariableClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (result Variable, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VariableCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.VariableClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VariableClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "variableName": autorest.Encode("path", variableName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VariableClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VariableClient) CreateOrUpdateResponder(resp *http.Response) (result Variable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the variable. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// variableName - the name of variable. -func (client VariableClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.VariableClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, variableName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VariableClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "variableName": autorest.Encode("path", variableName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VariableClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VariableClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the variable identified by variable name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// variableName - the name of variable. -func (client VariableClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result Variable, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.VariableClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, variableName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VariableClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "variableName": autorest.Encode("path", variableName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VariableClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VariableClient) GetResponder(resp *http.Response) (result Variable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of variables. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client VariableClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.vlr.Response.Response != nil { - sc = result.vlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.VariableClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.vlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.vlr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.vlr.hasNextLink() && result.vlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client VariableClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client VariableClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client VariableClient) ListByAutomationAccountResponder(resp *http.Response) (result VariableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client VariableClient) listByAutomationAccountNextResults(ctx context.Context, lastResults VariableListResult) (result VariableListResult, err error) { - req, err := lastResults.variableListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client VariableClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) - return -} - -// Update update a variable. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// variableName - the variable name. -// parameters - the parameters supplied to the update variable operation. -func (client VariableClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (result Variable, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.VariableClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VariableClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "variableName": autorest.Encode("path", variableName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VariableClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VariableClient) UpdateResponder(resp *http.Response) (result Variable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/version.go deleted file mode 100644 index 2327deaca531..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package automation - -import "github.com/Azure/azure-sdk-for-go/version" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " automation/2020-01-13-preview" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/watcher.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/watcher.go deleted file mode 100644 index 92ee2c0c5221..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/watcher.go +++ /dev/null @@ -1,681 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WatcherClient is the automation Client -type WatcherClient struct { - BaseClient -} - -// NewWatcherClient creates an instance of the WatcherClient client. -func NewWatcherClient(subscriptionID string) WatcherClient { - return NewWatcherClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWatcherClientWithBaseURI creates an instance of the WatcherClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWatcherClientWithBaseURI(baseURI string, subscriptionID string) WatcherClient { - return WatcherClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create the watcher identified by watcher name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// watcherName - the watcher name. -// parameters - the create or update parameters for watcher. -func (client WatcherClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters Watcher) (result Watcher, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WatcherClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, watcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client WatcherClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters Watcher) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "watcherName": autorest.Encode("path", watcherName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client WatcherClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client WatcherClient) CreateOrUpdateResponder(resp *http.Response) (result Watcher, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the watcher by name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// watcherName - the watcher name. -func (client WatcherClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WatcherClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, watcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client WatcherClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "watcherName": autorest.Encode("path", watcherName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client WatcherClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client WatcherClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve the watcher identified by watcher name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// watcherName - the watcher name. -func (client WatcherClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result Watcher, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WatcherClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, watcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client WatcherClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "watcherName": autorest.Encode("path", watcherName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WatcherClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WatcherClient) GetResponder(resp *http.Response) (result Watcher, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of watchers. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -func (client WatcherClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WatcherListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.wlr.Response.Response != nil { - sc = result.wlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WatcherClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.wlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.wlr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.wlr.hasNextLink() && result.wlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client WatcherClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client WatcherClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client WatcherClient) ListByAutomationAccountResponder(resp *http.Response) (result WatcherListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client WatcherClient) listByAutomationAccountNextResults(ctx context.Context, lastResults WatcherListResult) (result WatcherListResult, err error) { - req, err := lastResults.watcherListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.WatcherClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.WatcherClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client WatcherClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WatcherListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) - return -} - -// Start resume the watcher identified by watcher name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// watcherName - the watcher name. -func (client WatcherClient) Start(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.Start") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WatcherClient", "Start", err.Error()) - } - - req, err := client.StartPreparer(ctx, resourceGroupName, automationAccountName, watcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Start", nil, "Failure preparing request") - return - } - - resp, err := client.StartSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Start", resp, "Failure sending request") - return - } - - result, err = client.StartResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Start", resp, "Failure responding to request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client WatcherClient) StartPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "watcherName": autorest.Encode("path", watcherName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client WatcherClient) StartSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client WatcherClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Stop resume the watcher identified by watcher name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// watcherName - the watcher name. -func (client WatcherClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.Stop") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WatcherClient", "Stop", err.Error()) - } - - req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, watcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Stop", nil, "Failure preparing request") - return - } - - resp, err := client.StopSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Stop", resp, "Failure sending request") - return - } - - result, err = client.StopResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Stop", resp, "Failure responding to request") - return - } - - return -} - -// StopPreparer prepares the Stop request. -func (client WatcherClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "watcherName": autorest.Encode("path", watcherName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/stop", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopSender sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (client WatcherClient) StopSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// StopResponder handles the response to the Stop request. The method always -// closes the http.Response Body. -func (client WatcherClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update update the watcher identified by watcher name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// watcherName - the watcher name. -// parameters - the update parameters for watcher. -func (client WatcherClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters WatcherUpdateParameters) (result Watcher, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WatcherClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, watcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client WatcherClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters WatcherUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "watcherName": autorest.Encode("path", watcherName), - } - - const APIVersion = "2020-01-13-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client WatcherClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client WatcherClient) UpdateResponder(resp *http.Response) (result Watcher, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/webhook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/webhook.go deleted file mode 100644 index 302cfc5d2402..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/webhook.go +++ /dev/null @@ -1,598 +0,0 @@ -package automation - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WebhookClient is the automation Client -type WebhookClient struct { - BaseClient -} - -// NewWebhookClient creates an instance of the WebhookClient client. -func NewWebhookClient(subscriptionID string) WebhookClient { - return NewWebhookClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWebhookClientWithBaseURI creates an instance of the WebhookClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string) WebhookClient { - return WebhookClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create the webhook identified by webhook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// webhookName - the webhook name. -// parameters - the create or update parameters for webhook. -func (client WebhookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (result Webhook, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.WebhookCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WebhookClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client WebhookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webhookName": autorest.Encode("path", webhookName), - } - - const APIVersion = "2015-10-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client WebhookClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client WebhookClient) CreateOrUpdateResponder(resp *http.Response) (result Webhook, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the webhook by name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// webhookName - the webhook name. -func (client WebhookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WebhookClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, webhookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client WebhookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webhookName": autorest.Encode("path", webhookName), - } - - const APIVersion = "2015-10-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client WebhookClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client WebhookClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// GenerateURI generates a Uri for use in creating a webhook. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -func (client WebhookClient) GenerateURI(ctx context.Context, resourceGroupName string, automationAccountName string) (result String, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.GenerateURI") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WebhookClient", "GenerateURI", err.Error()) - } - - req, err := client.GenerateURIPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", nil, "Failure preparing request") - return - } - - resp, err := client.GenerateURISender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", resp, "Failure sending request") - return - } - - result, err = client.GenerateURIResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", resp, "Failure responding to request") - return - } - - return -} - -// GenerateURIPreparer prepares the GenerateURI request. -func (client WebhookClient) GenerateURIPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-10-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GenerateURISender sends the GenerateURI request. The method will close the -// http.Response Body if it receives an error. -func (client WebhookClient) GenerateURISender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GenerateURIResponder handles the response to the GenerateURI request. The method always -// closes the http.Response Body. -func (client WebhookClient) GenerateURIResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieve the webhook identified by webhook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// webhookName - the webhook name. -func (client WebhookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result Webhook, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WebhookClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, webhookName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client WebhookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webhookName": autorest.Encode("path", webhookName), - } - - const APIVersion = "2015-10-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WebhookClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WebhookClient) GetResponder(resp *http.Response) (result Webhook, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByAutomationAccount retrieve a list of webhooks. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// filter - the filter to apply on the operation. -func (client WebhookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.wlr.Response.Response != nil { - sc = result.wlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WebhookClient", "ListByAutomationAccount", err.Error()) - } - - result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.wlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result.wlr, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", resp, "Failure responding to request") - return - } - if result.wlr.hasNextLink() && result.wlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client WebhookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-10-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client WebhookClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client WebhookClient) ListByAutomationAccountResponder(resp *http.Response) (result WebhookListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByAutomationAccountNextResults retrieves the next set of results, if any. -func (client WebhookClient) listByAutomationAccountNextResults(ctx context.Context, lastResults WebhookListResult) (result WebhookListResult, err error) { - req, err := lastResults.webhookListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client WebhookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.ListByAutomationAccount") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) - return -} - -// Update update the webhook identified by webhook name. -// Parameters: -// resourceGroupName - name of an Azure Resource group. -// automationAccountName - the name of the automation account. -// webhookName - the webhook name. -// parameters - the update parameters for webhook. -func (client WebhookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (result Webhook, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.WebhookClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client WebhookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "webhookName": autorest.Encode("path", webhookName), - } - - const APIVersion = "2015-10-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client WebhookClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client WebhookClient) UpdateResponder(resp *http.Response) (result Webhook, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/README.md new file mode 100644 index 000000000000..a0d7a2fe6a70 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/README.md @@ -0,0 +1,57 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation` Documentation + +The `agentregistrationinformation` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2019-06-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation" +``` + + +### Client Initialization + +```go +client := agentregistrationinformation.NewAgentRegistrationInformationClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AgentRegistrationInformationClient.Get` + +```go +ctx := context.TODO() +id := agentregistrationinformation.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AgentRegistrationInformationClient.RegenerateKey` + +```go +ctx := context.TODO() +id := agentregistrationinformation.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +payload := agentregistrationinformation.AgentRegistrationRegenerateKeyParameter{ + // ... +} + + +read, err := client.RegenerateKey(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/client.go new file mode 100644 index 000000000000..a9273f52a712 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/client.go @@ -0,0 +1,18 @@ +package agentregistrationinformation + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentRegistrationInformationClient struct { + Client autorest.Client + baseUri string +} + +func NewAgentRegistrationInformationClientWithBaseURI(endpoint string) AgentRegistrationInformationClient { + return AgentRegistrationInformationClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/constants.go new file mode 100644 index 000000000000..7c764fb75fde --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/constants.go @@ -0,0 +1,34 @@ +package agentregistrationinformation + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentRegistrationKeyName string + +const ( + AgentRegistrationKeyNamePrimary AgentRegistrationKeyName = "primary" + AgentRegistrationKeyNameSecondary AgentRegistrationKeyName = "secondary" +) + +func PossibleValuesForAgentRegistrationKeyName() []string { + return []string{ + string(AgentRegistrationKeyNamePrimary), + string(AgentRegistrationKeyNameSecondary), + } +} + +func parseAgentRegistrationKeyName(input string) (*AgentRegistrationKeyName, error) { + vals := map[string]AgentRegistrationKeyName{ + "primary": AgentRegistrationKeyNamePrimary, + "secondary": AgentRegistrationKeyNameSecondary, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AgentRegistrationKeyName(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/id_automationaccount.go new file mode 100644 index 000000000000..08b840fe82dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/id_automationaccount.go @@ -0,0 +1,127 @@ +package agentregistrationinformation + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = AutomationAccountId{} + +// AutomationAccountId is a struct representing the Resource ID for a Automation Account +type AutomationAccountId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string +} + +// NewAutomationAccountID returns a new AutomationAccountId struct +func NewAutomationAccountID(subscriptionId string, resourceGroupName string, automationAccountName string) AutomationAccountId { + return AutomationAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + } +} + +// ParseAutomationAccountID parses 'input' into a AutomationAccountId +func ParseAutomationAccountID(input string) (*AutomationAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(AutomationAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := AutomationAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.AutomationAccountName, ok = parsed.Parsed["automationAccountName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "automationAccountName", *parsed) + } + + return &id, nil +} + +// ParseAutomationAccountIDInsensitively parses 'input' case-insensitively into a AutomationAccountId +// note: this method should only be used for API response data and not user input +func ParseAutomationAccountIDInsensitively(input string) (*AutomationAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(AutomationAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := AutomationAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.AutomationAccountName, ok = parsed.Parsed["automationAccountName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "automationAccountName", *parsed) + } + + return &id, nil +} + +// ValidateAutomationAccountID checks that 'input' can be parsed as a Automation Account ID +func ValidateAutomationAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseAutomationAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Automation Account ID +func (id AutomationAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Automation Account ID +func (id AutomationAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftAutomation", "Microsoft.Automation", "Microsoft.Automation"), + resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), + resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountValue"), + } +} + +// String returns a human-readable description of this Automation Account ID +func (id AutomationAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Automation Account Name: %q", id.AutomationAccountName), + } + return fmt.Sprintf("Automation Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/method_get_autorest.go new file mode 100644 index 000000000000..a4f2eb516281 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/method_get_autorest.go @@ -0,0 +1,69 @@ +package agentregistrationinformation + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *AgentRegistration +} + +// Get ... +func (c AgentRegistrationInformationClient) Get(ctx context.Context, id AutomationAccountId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "agentregistrationinformation.AgentRegistrationInformationClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "agentregistrationinformation.AgentRegistrationInformationClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "agentregistrationinformation.AgentRegistrationInformationClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c AgentRegistrationInformationClient) preparerForGet(ctx context.Context, id AutomationAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/agentRegistrationInformation", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c AgentRegistrationInformationClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/method_regeneratekey_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/method_regeneratekey_autorest.go new file mode 100644 index 000000000000..1a20a94d7325 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/method_regeneratekey_autorest.go @@ -0,0 +1,70 @@ +package agentregistrationinformation + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegenerateKeyOperationResponse struct { + HttpResponse *http.Response + Model *AgentRegistration +} + +// RegenerateKey ... +func (c AgentRegistrationInformationClient) RegenerateKey(ctx context.Context, id AutomationAccountId, input AgentRegistrationRegenerateKeyParameter) (result RegenerateKeyOperationResponse, err error) { + req, err := c.preparerForRegenerateKey(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "agentregistrationinformation.AgentRegistrationInformationClient", "RegenerateKey", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "agentregistrationinformation.AgentRegistrationInformationClient", "RegenerateKey", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForRegenerateKey(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "agentregistrationinformation.AgentRegistrationInformationClient", "RegenerateKey", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForRegenerateKey prepares the RegenerateKey request. +func (c AgentRegistrationInformationClient) preparerForRegenerateKey(ctx context.Context, id AutomationAccountId, input AgentRegistrationRegenerateKeyParameter) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/agentRegistrationInformation/regenerateKey", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForRegenerateKey handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (c AgentRegistrationInformationClient) responderForRegenerateKey(resp *http.Response) (result RegenerateKeyOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/model_agentregistration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/model_agentregistration.go new file mode 100644 index 000000000000..384ba1e11efd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/model_agentregistration.go @@ -0,0 +1,11 @@ +package agentregistrationinformation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentRegistration struct { + DscMetaConfiguration *string `json:"dscMetaConfiguration,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + Id *string `json:"id,omitempty"` + Keys *AgentRegistrationKeys `json:"keys,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/model_agentregistrationkeys.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/model_agentregistrationkeys.go new file mode 100644 index 000000000000..419c0dac217c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/model_agentregistrationkeys.go @@ -0,0 +1,9 @@ +package agentregistrationinformation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentRegistrationKeys struct { + Primary *string `json:"primary,omitempty"` + Secondary *string `json:"secondary,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/model_agentregistrationregeneratekeyparameter.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/model_agentregistrationregeneratekeyparameter.go new file mode 100644 index 000000000000..fcaba2277008 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/model_agentregistrationregeneratekeyparameter.go @@ -0,0 +1,8 @@ +package agentregistrationinformation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentRegistrationRegenerateKeyParameter struct { + KeyName AgentRegistrationKeyName `json:"keyName"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/version.go new file mode 100644 index 000000000000..5e92d277d13b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation/version.go @@ -0,0 +1,12 @@ +package agentregistrationinformation + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2019-06-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/agentregistrationinformation/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 0c39f5b47929..1cdf44f30b9f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -9,7 +9,6 @@ github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization -github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2019-06-01-preview/templatespecs github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-preview/policy @@ -229,6 +228,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/role github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roleassignments github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roledefinitions github.com/hashicorp/go-azure-sdk/resource-manager/automation/2015-10-31/webhook +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/softwareupdateconfiguration github.com/hashicorp/go-azure-sdk/resource-manager/automation/2020-01-13-preview/watcher github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08