diff --git a/internal/services/automation/automation_account_data_source.go b/internal/services/automation/automation_account_data_source.go index d1edbe83ed32..f7f477b20284 100644 --- a/internal/services/automation/automation_account_data_source.go +++ b/internal/services/automation/automation_account_data_source.go @@ -77,7 +77,7 @@ func dataSourceAutomationAccount() *pluginsdk.Resource { func dataSourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}) error { iclient := meta.(*clients.Client).Automation.AgentRegistrationInfoClient - client := meta.(*clients.Client).Automation.AccountClient + client := meta.(*clients.Client).Automation.AutomationAccount subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) diff --git a/internal/services/automation/automation_account_resource.go b/internal/services/automation/automation_account_resource.go index 5c2f1126a85d..1bdcc8785772 100644 --- a/internal/services/automation/automation_account_resource.go +++ b/internal/services/automation/automation_account_resource.go @@ -157,7 +157,7 @@ func resourceAutomationAccount() *pluginsdk.Resource { } func resourceAutomationAccountCreate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.AccountClient + client := meta.(*clients.Client).Automation.AutomationAccount subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -216,7 +216,7 @@ func resourceAutomationAccountCreate(d *pluginsdk.ResourceData, meta interface{} } func resourceAutomationAccountUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.AccountClient + client := meta.(*clients.Client).Automation.AutomationAccount ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -263,7 +263,7 @@ func resourceAutomationAccountUpdate(d *pluginsdk.ResourceData, meta interface{} } func resourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.AccountClient + client := meta.(*clients.Client).Automation.AutomationAccount registrationClient := meta.(*clients.Client).Automation.AgentRegistrationInfoClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -351,7 +351,7 @@ func resourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}) } func resourceAutomationAccountDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.AccountClient + client := meta.(*clients.Client).Automation.AutomationAccount ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_account_resource_test.go b/internal/services/automation/automation_account_resource_test.go index 6dff7f504ff3..8d3beb220ca5 100644 --- a/internal/services/automation/automation_account_resource_test.go +++ b/internal/services/automation/automation_account_resource_test.go @@ -186,7 +186,7 @@ func (t AutomationAccountResource) Exists(ctx context.Context, clients *clients. return nil, err } - resp, err := clients.Automation.AccountClient.Get(ctx, *id) + resp, err := clients.Automation.AutomationAccount.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving Automation Account %q (resource group: %q): %+v", id.AutomationAccountName, id.ResourceGroupName, err) } diff --git a/internal/services/automation/automation_certificate_resource.go b/internal/services/automation/automation_certificate_resource.go index 9bd202cad9ac..d9c4f4f54e21 100644 --- a/internal/services/automation/automation_certificate_resource.go +++ b/internal/services/automation/automation_certificate_resource.go @@ -82,7 +82,7 @@ func resourceAutomationCertificate() *pluginsdk.Resource { } func resourceAutomationCertificateCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.CertificateClient + client := meta.(*clients.Client).Automation.Certificate subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -129,7 +129,7 @@ func resourceAutomationCertificateCreateUpdate(d *pluginsdk.ResourceData, meta i } func resourceAutomationCertificateRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.CertificateClient + client := meta.(*clients.Client).Automation.Certificate ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -164,7 +164,7 @@ func resourceAutomationCertificateRead(d *pluginsdk.ResourceData, meta interface } func resourceAutomationCertificateDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.CertificateClient + client := meta.(*clients.Client).Automation.Certificate ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_certificate_resource_test.go b/internal/services/automation/automation_certificate_resource_test.go index 3cc27ef5d6d7..0246830e4f8f 100644 --- a/internal/services/automation/automation_certificate_resource_test.go +++ b/internal/services/automation/automation_certificate_resource_test.go @@ -107,7 +107,7 @@ func (t AutomationCertificateResource) Exists(ctx context.Context, clients *clie return nil, err } - resp, err := clients.Automation.CertificateClient.Get(ctx, *id) + resp, err := clients.Automation.Certificate.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_connection_certificate_resource.go b/internal/services/automation/automation_connection_certificate_resource.go index 85efc88aeee1..32a1c4ac17b3 100644 --- a/internal/services/automation/automation_connection_certificate_resource.go +++ b/internal/services/automation/automation_connection_certificate_resource.go @@ -77,7 +77,7 @@ func resourceAutomationConnectionCertificate() *pluginsdk.Resource { } func resourceAutomationConnectionCertificateCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -125,7 +125,7 @@ func resourceAutomationConnectionCertificateCreateUpdate(d *pluginsdk.ResourceDa } func resourceAutomationConnectionCertificateRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -166,7 +166,7 @@ func resourceAutomationConnectionCertificateRead(d *pluginsdk.ResourceData, meta } func resourceAutomationConnectionCertificateDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_connection_certificate_resource_test.go b/internal/services/automation/automation_connection_certificate_resource_test.go index ff1c3041424a..5b1fc55423b2 100644 --- a/internal/services/automation/automation_connection_certificate_resource_test.go +++ b/internal/services/automation/automation_connection_certificate_resource_test.go @@ -98,7 +98,7 @@ func (t AutomationConnectionCertificateResource) Exists(ctx context.Context, cli return nil, err } - resp, err := clients.Automation.ConnectionClient.Get(ctx, *id) + resp, err := clients.Automation.Connection.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_connection_classic_certificate_resource.go b/internal/services/automation/automation_connection_classic_certificate_resource.go index e10baf8ee95a..ff7783cfc425 100644 --- a/internal/services/automation/automation_connection_classic_certificate_resource.go +++ b/internal/services/automation/automation_connection_classic_certificate_resource.go @@ -83,7 +83,7 @@ func resourceAutomationConnectionClassicCertificate() *pluginsdk.Resource { } func resourceAutomationConnectionClassicCertificateCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -132,7 +132,7 @@ func resourceAutomationConnectionClassicCertificateCreateUpdate(d *pluginsdk.Res } func resourceAutomationConnectionClassicCertificateRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -177,7 +177,7 @@ func resourceAutomationConnectionClassicCertificateRead(d *pluginsdk.ResourceDat } func resourceAutomationConnectionClassicCertificateDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_connection_classic_certificate_resource_test.go b/internal/services/automation/automation_connection_classic_certificate_resource_test.go index adc817fe0c29..507d0b17ec75 100644 --- a/internal/services/automation/automation_connection_classic_certificate_resource_test.go +++ b/internal/services/automation/automation_connection_classic_certificate_resource_test.go @@ -98,7 +98,7 @@ func (t AutomationConnectionClassicCertificateResource) Exists(ctx context.Conte return nil, err } - resp, err := clients.Automation.ConnectionClient.Get(ctx, *id) + resp, err := clients.Automation.Connection.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_connection_import.go b/internal/services/automation/automation_connection_import.go index ac97afe90e27..aee80af9ad8c 100644 --- a/internal/services/automation/automation_connection_import.go +++ b/internal/services/automation/automation_connection_import.go @@ -23,7 +23,7 @@ func importAutomationConnection(connectionType string) pluginsdk.ImporterFunc { ctx, cancel := timeouts.ForRead(ctx, d) defer cancel() - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection resp, err := client.Get(ctx, *id) if err != nil { return []*pluginsdk.ResourceData{}, fmt.Errorf("retrieving %s: %+v", *id, err) diff --git a/internal/services/automation/automation_connection_resource.go b/internal/services/automation/automation_connection_resource.go index 78316b88b8fd..3c59542eb7a1 100644 --- a/internal/services/automation/automation_connection_resource.go +++ b/internal/services/automation/automation_connection_resource.go @@ -82,9 +82,9 @@ func resourceAutomationConnection() *pluginsdk.Resource { } func resourceAutomationConnectionCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection subscriptionId := meta.(*clients.Client).Account.SubscriptionId - connectionTypeClient := meta.(*clients.Client).Automation.ConnectionTypeClient + connectionTypeClient := meta.(*clients.Client).Automation.ConnectionType ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -147,7 +147,7 @@ func resourceAutomationConnectionCreateUpdate(d *pluginsdk.ResourceData, meta in } func resourceAutomationConnectionRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -189,7 +189,7 @@ func resourceAutomationConnectionRead(d *pluginsdk.ResourceData, meta interface{ } func resourceAutomationConnectionDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_connection_resource_test.go b/internal/services/automation/automation_connection_resource_test.go index 7789ff4e7670..bc633fd53ec7 100644 --- a/internal/services/automation/automation_connection_resource_test.go +++ b/internal/services/automation/automation_connection_resource_test.go @@ -98,7 +98,7 @@ func (t AutomationConnectionResource) Exists(ctx context.Context, clients *clien return nil, err } - resp, err := clients.Automation.ConnectionClient.Get(ctx, *id) + resp, err := clients.Automation.Connection.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_connection_service_principal_resource.go b/internal/services/automation/automation_connection_service_principal_resource.go index cf172f2aed0e..012d41e4ebae 100644 --- a/internal/services/automation/automation_connection_service_principal_resource.go +++ b/internal/services/automation/automation_connection_service_principal_resource.go @@ -89,7 +89,7 @@ func resourceAutomationConnectionServicePrincipal() *pluginsdk.Resource { } func resourceAutomationConnectionServicePrincipalCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -139,7 +139,7 @@ func resourceAutomationConnectionServicePrincipalCreateUpdate(d *pluginsdk.Resou } func resourceAutomationConnectionServicePrincipalRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -193,7 +193,7 @@ func resourceAutomationConnectionServicePrincipalRead(d *pluginsdk.ResourceData, } func resourceAutomationConnectionServicePrincipalDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ConnectionClient + client := meta.(*clients.Client).Automation.Connection ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_connection_service_principal_resource_test.go b/internal/services/automation/automation_connection_service_principal_resource_test.go index 6d1de7716eb4..7467ac8c26e7 100644 --- a/internal/services/automation/automation_connection_service_principal_resource_test.go +++ b/internal/services/automation/automation_connection_service_principal_resource_test.go @@ -98,7 +98,7 @@ func (t AutomationConnectionServicePrincipalResource) Exists(ctx context.Context return nil, err } - resp, err := clients.Automation.ConnectionClient.Get(ctx, *id) + resp, err := clients.Automation.Connection.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_connection_type_resource.go b/internal/services/automation/automation_connection_type_resource.go index dc7537d1bfbd..d49370946b94 100644 --- a/internal/services/automation/automation_connection_type_resource.go +++ b/internal/services/automation/automation_connection_type_resource.go @@ -105,8 +105,8 @@ func (m AutomationConnectionTypeResource) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, meta sdk.ResourceMetaData) error { - client := meta.Client.Automation.ConnectionTypeClient - connClient := meta.Client.Automation.AccountClient + client := meta.Client.Automation.ConnectionType + connClient := meta.Client.Automation.AutomationAccount var model AutomationConnectionTypeModel if err := meta.Decode(&model); err != nil { @@ -165,7 +165,7 @@ func (m AutomationConnectionTypeResource) Read() sdk.ResourceFunc { return err } - client := meta.Client.Automation.ConnectionTypeClient + client := meta.Client.Automation.ConnectionType resp, err := client.Get(ctx, *id) if err != nil { if response.WasNotFound(resp.HttpResponse) { @@ -208,7 +208,7 @@ func (m AutomationConnectionTypeResource) Delete() sdk.ResourceFunc { return err } - client := meta.Client.Automation.ConnectionTypeClient + client := meta.Client.Automation.ConnectionType if _, err = client.Delete(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %v", *id, err) } diff --git a/internal/services/automation/automation_connection_type_resource_test.go b/internal/services/automation/automation_connection_type_resource_test.go index 624a8508fa89..9372d3871d35 100644 --- a/internal/services/automation/automation_connection_type_resource_test.go +++ b/internal/services/automation/automation_connection_type_resource_test.go @@ -24,7 +24,7 @@ func (a AutomationConnectionTypeResource) Exists(ctx context.Context, client *cl if err != nil { return nil, err } - resp, err := client.Automation.ConnectionTypeClient.Get(ctx, *id) + resp, err := client.Automation.ConnectionType.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving Automation Connection Type %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_credential_resource.go b/internal/services/automation/automation_credential_resource.go index 57f8377fe7a5..fb79f1193eb3 100644 --- a/internal/services/automation/automation_credential_resource.go +++ b/internal/services/automation/automation_credential_resource.go @@ -73,7 +73,7 @@ func resourceAutomationCredential() *pluginsdk.Resource { } func resourceAutomationCredentialCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.CredentialClient + client := meta.(*clients.Client).Automation.Credential subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -118,7 +118,7 @@ func resourceAutomationCredentialCreateUpdate(d *pluginsdk.ResourceData, meta in } func resourceAutomationCredentialRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.CredentialClient + client := meta.(*clients.Client).Automation.Credential ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -152,7 +152,7 @@ func resourceAutomationCredentialRead(d *pluginsdk.ResourceData, meta interface{ } func resourceAutomationCredentialDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.CredentialClient + client := meta.(*clients.Client).Automation.Credential ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_credential_resource_test.go b/internal/services/automation/automation_credential_resource_test.go index c736e8ee5abf..a3dff7c7993b 100644 --- a/internal/services/automation/automation_credential_resource_test.go +++ b/internal/services/automation/automation_credential_resource_test.go @@ -72,7 +72,7 @@ func (t AutomationCredentialResource) Exists(ctx context.Context, clients *clien return nil, err } - resp, err := clients.Automation.CredentialClient.Get(ctx, *id) + resp, err := clients.Automation.Credential.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_dsc_configuration_resource.go b/internal/services/automation/automation_dsc_configuration_resource.go index 5c14f35e1fcf..cee73aecbc4b 100644 --- a/internal/services/automation/automation_dsc_configuration_resource.go +++ b/internal/services/automation/automation_dsc_configuration_resource.go @@ -94,7 +94,7 @@ func resourceAutomationDscConfiguration() *pluginsdk.Resource { } func resourceAutomationDscConfigurationCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.DscConfigurationClient + client := meta.(*clients.Client).Automation.DscConfiguration subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -144,7 +144,7 @@ func resourceAutomationDscConfigurationCreateUpdate(d *pluginsdk.ResourceData, m } func resourceAutomationDscConfigurationRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.DscConfigurationClient + client := meta.(*clients.Client).Automation.DscConfiguration ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -208,7 +208,7 @@ func resourceAutomationDscConfigurationRead(d *pluginsdk.ResourceData, meta inte } func resourceAutomationDscConfigurationDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.DscConfigurationClient + client := meta.(*clients.Client).Automation.DscConfiguration ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_dsc_configuration_resource_test.go b/internal/services/automation/automation_dsc_configuration_resource_test.go index b37b8bc39b2e..f46256990675 100644 --- a/internal/services/automation/automation_dsc_configuration_resource_test.go +++ b/internal/services/automation/automation_dsc_configuration_resource_test.go @@ -74,7 +74,7 @@ func (t AutomationDscConfigurationResource) Exists(ctx context.Context, clients return nil, err } - resp, err := clients.Automation.DscConfigurationClient.Get(ctx, *id) + resp, err := clients.Automation.DscConfiguration.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_dsc_nodeconfiguration_resource.go b/internal/services/automation/automation_dsc_nodeconfiguration_resource.go index dc0152f58897..77fcd710ca22 100644 --- a/internal/services/automation/automation_dsc_nodeconfiguration_resource.go +++ b/internal/services/automation/automation_dsc_nodeconfiguration_resource.go @@ -72,7 +72,7 @@ func resourceAutomationDscNodeConfiguration() *pluginsdk.Resource { } func resourceAutomationDscNodeConfigurationCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.DscNodeConfigurationClient + client := meta.(*clients.Client).Automation.DscNodeConfiguration subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -127,7 +127,7 @@ func resourceAutomationDscNodeConfigurationCreateUpdate(d *pluginsdk.ResourceDat } func resourceAutomationDscNodeConfigurationRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.DscNodeConfigurationClient + client := meta.(*clients.Client).Automation.DscNodeConfiguration ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -166,7 +166,7 @@ func resourceAutomationDscNodeConfigurationRead(d *pluginsdk.ResourceData, meta } func resourceAutomationDscNodeConfigurationDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.DscNodeConfigurationClient + client := meta.(*clients.Client).Automation.DscNodeConfiguration ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_dsc_nodeconfiguration_resource_test.go b/internal/services/automation/automation_dsc_nodeconfiguration_resource_test.go index 913db867983b..601ecc7bb61c 100644 --- a/internal/services/automation/automation_dsc_nodeconfiguration_resource_test.go +++ b/internal/services/automation/automation_dsc_nodeconfiguration_resource_test.go @@ -55,7 +55,7 @@ func (t AutomationDscNodeConfigurationResource) Exists(ctx context.Context, clie return nil, err } - resp, err := clients.Automation.DscNodeConfigurationClient.Get(ctx, *id) + resp, err := clients.Automation.DscNodeConfiguration.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_hybrid_runbook_worker.go b/internal/services/automation/automation_hybrid_runbook_worker.go index a374799e3724..74a221fc7d63 100644 --- a/internal/services/automation/automation_hybrid_runbook_worker.go +++ b/internal/services/automation/automation_hybrid_runbook_worker.go @@ -110,7 +110,7 @@ func (m HybridRunbookWorkerResource) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, meta sdk.ResourceMetaData) error { - client := meta.Client.Automation.RunbookWorkerClient + client := meta.Client.Automation.HybridRunbookWorker var model HybridRunbookWorkerModel if err := meta.Decode(&model); err != nil { @@ -156,7 +156,7 @@ func (m HybridRunbookWorkerResource) Read() sdk.ResourceFunc { if err != nil { return err } - client := meta.Client.Automation.RunbookWorkerClient + client := meta.Client.Automation.HybridRunbookWorker result, err := client.Get(ctx, *id) if err != nil { return err @@ -194,7 +194,7 @@ func (m HybridRunbookWorkerResource) Delete() sdk.ResourceFunc { return err } meta.Logger.Infof("deleting %s", id) - client := meta.Client.Automation.RunbookWorkerClient + client := meta.Client.Automation.HybridRunbookWorker if _, err = client.Delete(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %v", id, err) } diff --git a/internal/services/automation/automation_hybrid_runbook_worker_group.go b/internal/services/automation/automation_hybrid_runbook_worker_group.go index ab5d6b362d45..3edec113dbef 100644 --- a/internal/services/automation/automation_hybrid_runbook_worker_group.go +++ b/internal/services/automation/automation_hybrid_runbook_worker_group.go @@ -6,12 +6,12 @@ package automation import ( "context" "fmt" - "net/http" "time" + "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-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -68,7 +68,7 @@ func (m HybridRunbookWorkerGroupResource) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, meta sdk.ResourceMetaData) error { - client := meta.Client.Automation.RunBookWgClient + client := meta.Client.Automation.HybridRunbookWorkerGroup var model HybridRunbookWorkerGroupModel if err := meta.Decode(&model); err != nil { @@ -85,16 +85,19 @@ func (m HybridRunbookWorkerGroupResource) Create() sdk.ResourceFunc { } return meta.ResourceRequiresImport(m.ResourceType(), id) } - req := hybridrunbookworkergroup.HybridRunbookWorkerGroupCreateOrUpdateParameters{} + req := hybridrunbookworkergroup.HybridRunbookWorkerGroupCreateOrUpdateParameters{ + Name: pointer.To(model.Name), + } if model.CredentialName != "" { - req.Credential = &hybridrunbookworkergroup.RunAsCredentialAssociationProperty{ + req.Properties = &hybridrunbookworkergroup.HybridRunbookWorkerGroupCreateOrUpdateProperties{} + req.Properties.Credential = &hybridrunbookworkergroup.RunAsCredentialAssociationProperty{ Name: utils.String(model.CredentialName), } } // return 201 cause err in autorest sdk - future, err := client.Create(ctx, id, req) + _, err = client.Create(ctx, id, req) // Workaround swagger issue https://github.com/Azure/azure-rest-api-specs/issues/19741 - if err != nil && !response.WasStatusCode(future.HttpResponse, http.StatusCreated) { + if err != nil { return fmt.Errorf("creating %s: %v", id, err) } @@ -112,7 +115,7 @@ func (m HybridRunbookWorkerGroupResource) Read() sdk.ResourceFunc { if err != nil { return err } - client := meta.Client.Automation.RunBookWgClient + client := meta.Client.Automation.HybridRunbookWorkerGroup result, err := client.Get(ctx, *id) if err != nil { return err @@ -124,8 +127,12 @@ func (m HybridRunbookWorkerGroupResource) Read() sdk.ResourceFunc { output.Name = utils.NormalizeNilableString(result.Model.Name) output.AutomationAccountName = id.AutomationAccountName - if c := result.Model.Credential; c != nil { - output.CredentialName = utils.NormalizeNilableString(c.Name) + if model := result.Model; model != nil { + if prop := model.Properties; prop != nil { + if prop.Credential != nil { + output.CredentialName = pointer.From(prop.Credential.Name) + } + } } output.ResourceGroupName = id.ResourceGroupName return meta.Encode(&output) @@ -137,7 +144,7 @@ func (m HybridRunbookWorkerGroupResource) Update() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 10 * time.Minute, Func: func(ctx context.Context, meta sdk.ResourceMetaData) (err error) { - client := meta.Client.Automation.RunBookWgClient + client := meta.Client.Automation.HybridRunbookWorkerGroup id, err := hybridrunbookworkergroup.ParseHybridRunbookWorkerGroupID(meta.ResourceData.Id()) if err != nil { return err @@ -150,7 +157,8 @@ func (m HybridRunbookWorkerGroupResource) Update() sdk.ResourceFunc { var upd hybridrunbookworkergroup.HybridRunbookWorkerGroupCreateOrUpdateParameters if meta.ResourceData.HasChange("credential_name") { - upd.Credential = &hybridrunbookworkergroup.RunAsCredentialAssociationProperty{ + upd.Properties = &hybridrunbookworkergroup.HybridRunbookWorkerGroupCreateOrUpdateProperties{} + upd.Properties.Credential = &hybridrunbookworkergroup.RunAsCredentialAssociationProperty{ Name: utils.String(model.CredentialName), } } @@ -172,7 +180,7 @@ func (m HybridRunbookWorkerGroupResource) Delete() sdk.ResourceFunc { return err } meta.Logger.Infof("deleting %s", id) - client := meta.Client.Automation.RunBookWgClient + client := meta.Client.Automation.HybridRunbookWorkerGroup if _, err = client.Delete(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %v", id, err) } diff --git a/internal/services/automation/automation_hybrid_runbook_worker_group_test.go b/internal/services/automation/automation_hybrid_runbook_worker_group_test.go index fd481c235034..67c2f236da83 100644 --- a/internal/services/automation/automation_hybrid_runbook_worker_group_test.go +++ b/internal/services/automation/automation_hybrid_runbook_worker_group_test.go @@ -8,7 +8,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -24,7 +24,7 @@ func (a HybridRunbookWorkerGroupResource) Exists(ctx context.Context, client *cl if err != nil { return nil, err } - resp, err := client.Automation.RunBookWgClient.Get(ctx, *id) + resp, err := client.Automation.HybridRunbookWorkerGroup.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving HybridRunbookWorkerGroup %s: %+v", id, err) } diff --git a/internal/services/automation/automation_hybrid_runbook_worker_test.go b/internal/services/automation/automation_hybrid_runbook_worker_test.go index 3186ad265a32..0ab534f57330 100644 --- a/internal/services/automation/automation_hybrid_runbook_worker_test.go +++ b/internal/services/automation/automation_hybrid_runbook_worker_test.go @@ -25,7 +25,7 @@ func (a HybridRunbookWorkerResource) Exists(ctx context.Context, client *clients if err != nil { return nil, err } - resp, err := client.Automation.RunbookWorkerClient.Get(ctx, *id) + resp, err := client.Automation.HybridRunbookWorker.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving HybridRunbookWorker %s: %+v", id, err) } diff --git a/internal/services/automation/automation_job_schedule_resource.go b/internal/services/automation/automation_job_schedule_resource.go index 8fef1c521e35..626ff1e3db8c 100644 --- a/internal/services/automation/automation_job_schedule_resource.go +++ b/internal/services/automation/automation_job_schedule_resource.go @@ -90,7 +90,7 @@ func resourceAutomationJobSchedule() *pluginsdk.Resource { } func resourceAutomationJobScheduleCreate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.JobScheduleClient + client := meta.(*clients.Client).Automation.JobSchedule subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -184,7 +184,7 @@ func resourceAutomationJobScheduleCreate(d *pluginsdk.ResourceData, meta interfa } func resourceAutomationJobScheduleRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.JobScheduleClient + client := meta.(*clients.Client).Automation.JobSchedule ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -231,7 +231,7 @@ func resourceAutomationJobScheduleRead(d *pluginsdk.ResourceData, meta interface } func resourceAutomationJobScheduleDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.JobScheduleClient + client := meta.(*clients.Client).Automation.JobSchedule ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_job_schedule_resource_test.go b/internal/services/automation/automation_job_schedule_resource_test.go index 2c4bef0aad58..4ae4af96c43e 100644 --- a/internal/services/automation/automation_job_schedule_resource_test.go +++ b/internal/services/automation/automation_job_schedule_resource_test.go @@ -99,7 +99,7 @@ func (t AutomationJobScheduleResource) Exists(ctx context.Context, clients *clie return nil, err } - resp, err := clients.Automation.JobScheduleClient.Get(ctx, *id) + resp, err := clients.Automation.JobSchedule.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %v", *id, err) } diff --git a/internal/services/automation/automation_module_resource.go b/internal/services/automation/automation_module_resource.go index fe10bfd4bf7a..780ff23aeeb4 100644 --- a/internal/services/automation/automation_module_resource.go +++ b/internal/services/automation/automation_module_resource.go @@ -91,7 +91,7 @@ func resourceAutomationModule() *pluginsdk.Resource { } func resourceAutomationModuleCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ModuleClient + client := meta.(*clients.Client).Automation.Module subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -183,7 +183,7 @@ func resourceAutomationModuleCreateUpdate(d *pluginsdk.ResourceData, meta interf } func resourceAutomationModuleRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ModuleClient + client := meta.(*clients.Client).Automation.Module ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -210,7 +210,7 @@ func resourceAutomationModuleRead(d *pluginsdk.ResourceData, meta interface{}) e } func resourceAutomationModuleDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ModuleClient + client := meta.(*clients.Client).Automation.Module ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_module_resource_test.go b/internal/services/automation/automation_module_resource_test.go index dc245752604f..ef397b2a1a86 100644 --- a/internal/services/automation/automation_module_resource_test.go +++ b/internal/services/automation/automation_module_resource_test.go @@ -84,7 +84,7 @@ func (t AutomationModuleResource) Exists(ctx context.Context, clients *clients.C return nil, err } - resp, err := clients.Automation.ModuleClient.Get(ctx, *id) + resp, err := clients.Automation.Module.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_runbook_resource.go b/internal/services/automation/automation_runbook_resource.go index 2bbd765098f8..f3ffde67c4cd 100644 --- a/internal/services/automation/automation_runbook_resource.go +++ b/internal/services/automation/automation_runbook_resource.go @@ -4,9 +4,7 @@ package automation import ( - "bytes" "fmt" - "io" "log" "time" @@ -14,9 +12,9 @@ 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" - runbook2 "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook" "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" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -248,8 +246,8 @@ func resourceAutomationRunbook() *pluginsdk.Resource { func resourceAutomationRunbookCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { autoCli := meta.(*clients.Client).Automation - client := autoCli.RunbookClient - jsClient := autoCli.JobScheduleClient + client := autoCli.Runbook + jsClient := autoCli.JobSchedule ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -310,17 +308,12 @@ func resourceAutomationRunbookCreateUpdate(d *pluginsdk.ResourceData, meta inter if v, ok := d.GetOk("content"); ok { content := v.(string) - _, err := autoCli.RunbookDraftClient.ReplaceContent(ctx, id.ResourceGroupName, id.AutomationAccountName, id.RunbookName, io.NopCloser(bytes.NewBufferString(content))) - if err != nil { + draftRunbookID := runbookdraft.NewRunbookID(id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.RunbookName) + if err := autoCli.RunbookDraft.ReplaceContentThenPoll(ctx, draftRunbookID, []byte(content)); err != nil { return fmt.Errorf("setting the draft for %s: %+v", id, err) } - // Uncomment below once https://github.com/Azure/azure-sdk-for-go/issues/17196 is resolved. - // if err := f1.WaitForCompletionRef(ctx, draftClient.Client); err != nil { - // return fmt.Errorf("waiting for set the draft for %s: %+v", id, err) - // } - id2 := runbook2.NewRunbookID(id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.RunbookName) - if err := autoCli.RunbookClientHack.PublishThenPoll(ctx, id2); err != nil { + if err := autoCli.Runbook.PublishThenPoll(ctx, id); err != nil { return fmt.Errorf("publishing the updated %s: %+v", id, err) } } @@ -328,7 +321,6 @@ func resourceAutomationRunbookCreateUpdate(d *pluginsdk.ResourceData, meta inter d.SetId(id.ID()) automationAccountId := jobschedule.NewAutomationAccountID(subscriptionID, id.ResourceGroupName, id.AutomationAccountName) - jsIterator, err := jsClient.ListByAutomationAccountComplete(ctx, automationAccountId, jobschedule.ListByAutomationAccountOperationOptions{}) if err != nil { return fmt.Errorf("loading Automation Account %q Job Schedule List: %+v", id.AutomationAccountName, err) @@ -368,8 +360,8 @@ func resourceAutomationRunbookCreateUpdate(d *pluginsdk.ResourceData, meta inter func resourceAutomationRunbookRead(d *pluginsdk.ResourceData, meta interface{}) error { autoCli := meta.(*clients.Client).Automation - client := autoCli.RunbookClient - jsClient := autoCli.JobScheduleClient + client := autoCli.Runbook + jsClient := autoCli.JobSchedule ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -405,8 +397,8 @@ func resourceAutomationRunbookRead(d *pluginsdk.ResourceData, meta interface{}) } // GetContent need to use preview version client RunbookClientHack - // move to stable RunbookClient once this issue fixed: https://github.com/Azure/azure-sdk-for-go/issues/17591#issuecomment-1233676539 - contentResp, err := autoCli.RunbookClient.GetContent(ctx, *id) + // move to stable Runbook once this issue fixed: https://github.com/Azure/azure-sdk-for-go/issues/17591#issuecomment-1233676539 + contentResp, err := autoCli.Runbook.GetContent(ctx, *id) if err != nil { if response.WasNotFound(contentResp.HttpResponse) { d.Set("content", "") @@ -454,7 +446,7 @@ func resourceAutomationRunbookRead(d *pluginsdk.ResourceData, meta interface{}) } func resourceAutomationRunbookDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.RunbookClient + client := meta.(*clients.Client).Automation.Runbook ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_runbook_resource_test.go b/internal/services/automation/automation_runbook_resource_test.go index 64c2a9e8e7b2..59e9c7820175 100644 --- a/internal/services/automation/automation_runbook_resource_test.go +++ b/internal/services/automation/automation_runbook_resource_test.go @@ -153,7 +153,7 @@ func (t AutomationRunbookResource) Exists(ctx context.Context, clients *clients. return nil, err } - resp, err := clients.Automation.RunbookClient.Get(ctx, *id) + resp, err := clients.Automation.Runbook.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving Automation Runbook '%s' (resource group: '%s') does not exist", id.RunbookName, id.ResourceGroupName) } diff --git a/internal/services/automation/automation_schedule_resource.go b/internal/services/automation/automation_schedule_resource.go index f2570fc0e367..e5666f0a7417 100644 --- a/internal/services/automation/automation_schedule_resource.go +++ b/internal/services/automation/automation_schedule_resource.go @@ -212,7 +212,7 @@ func resourceAutomationSchedule() *pluginsdk.Resource { } func resourceAutomationScheduleCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ScheduleClient + client := meta.(*clients.Client).Automation.Schedule subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -294,7 +294,7 @@ func resourceAutomationScheduleCreateUpdate(d *pluginsdk.ResourceData, meta inte } func resourceAutomationScheduleRead(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ScheduleClient + client := meta.(*clients.Client).Automation.Schedule ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -355,7 +355,7 @@ func resourceAutomationScheduleRead(d *pluginsdk.ResourceData, meta interface{}) } func resourceAutomationScheduleDelete(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).Automation.ScheduleClient + client := meta.(*clients.Client).Automation.Schedule ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_schedule_resource_test.go b/internal/services/automation/automation_schedule_resource_test.go index b47b4eeed341..c233bffb1279 100644 --- a/internal/services/automation/automation_schedule_resource_test.go +++ b/internal/services/automation/automation_schedule_resource_test.go @@ -230,7 +230,7 @@ func (t AutomationScheduleResource) Exists(ctx context.Context, clients *clients return nil, err } - resp, err := clients.Automation.ScheduleClient.Get(ctx, *id) + resp, err := clients.Automation.Schedule.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving %s: %v", *id, err) } diff --git a/internal/services/automation/automation_source_control_resource.go b/internal/services/automation/automation_source_control_resource.go index 49b6c2119c70..fa87816eb213 100644 --- a/internal/services/automation/automation_source_control_resource.go +++ b/internal/services/automation/automation_source_control_resource.go @@ -159,7 +159,7 @@ func (m SourceControlResource) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, meta sdk.ResourceMetaData) error { - client := meta.Client.Automation.SourceControlClient + client := meta.Client.Automation.SourceControl var model SourceControlModel if err := meta.Decode(&model); err != nil { @@ -220,7 +220,7 @@ func (m SourceControlResource) Read() sdk.ResourceFunc { return err } - client := meta.Client.Automation.SourceControlClient + client := meta.Client.Automation.SourceControl resp, err := client.Get(ctx, *id) if err != nil { if response.WasNotFound(resp.HttpResponse) { @@ -263,7 +263,7 @@ func (m SourceControlResource) Update() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 10 * time.Minute, Func: func(ctx context.Context, meta sdk.ResourceMetaData) (err error) { - client := meta.Client.Automation.SourceControlClient + client := meta.Client.Automation.SourceControl id, err := sourcecontrol.ParseSourceControlID(meta.ResourceData.Id()) if err != nil { @@ -323,7 +323,7 @@ func (m SourceControlResource) Delete() sdk.ResourceFunc { return err } meta.Logger.Infof("deleting %s", *id) - client := meta.Client.Automation.SourceControlClient + client := meta.Client.Automation.SourceControl if _, err = client.Delete(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %v", *id, err) } diff --git a/internal/services/automation/automation_source_control_resource_test.go b/internal/services/automation/automation_source_control_resource_test.go index 3ea6496be890..6972db68475e 100644 --- a/internal/services/automation/automation_source_control_resource_test.go +++ b/internal/services/automation/automation_source_control_resource_test.go @@ -48,7 +48,7 @@ func (s SourceControlResource) Exists(ctx context.Context, client *clients.Clien if err != nil { return nil, err } - resp, err := client.Automation.SourceControlClient.Get(ctx, *id) + resp, err := client.Automation.SourceControl.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving Type %s: %+v", *id, err) } diff --git a/internal/services/automation/automation_variable.go b/internal/services/automation/automation_variable.go index 598652c44889..bc4f9e43c985 100644 --- a/internal/services/automation/automation_variable.go +++ b/internal/services/automation/automation_variable.go @@ -132,7 +132,7 @@ func datasourceAutomationVariableCommonSchema(attType pluginsdk.ValueType) map[s } func resourceAutomationVariableCreateUpdate(d *pluginsdk.ResourceData, meta interface{}, varType string) error { - client := meta.(*clients.Client).Automation.VariableClient + client := meta.(*clients.Client).Automation.Variable subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -198,7 +198,7 @@ func resourceAutomationVariableCreateUpdate(d *pluginsdk.ResourceData, meta inte } func resourceAutomationVariableRead(d *pluginsdk.ResourceData, meta interface{}, varType string) error { - client := meta.(*clients.Client).Automation.VariableClient + client := meta.(*clients.Client).Automation.Variable ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -246,7 +246,7 @@ func resourceAutomationVariableRead(d *pluginsdk.ResourceData, meta interface{}, } func dataSourceAutomationVariableRead(d *pluginsdk.ResourceData, meta interface{}, varType string) error { - client := meta.(*clients.Client).Automation.VariableClient + client := meta.(*clients.Client).Automation.Variable subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -293,7 +293,7 @@ func dataSourceAutomationVariableRead(d *pluginsdk.ResourceData, meta interface{ } func resourceAutomationVariableDelete(d *pluginsdk.ResourceData, meta interface{}, varType string) error { - client := meta.(*clients.Client).Automation.VariableClient + client := meta.(*clients.Client).Automation.Variable ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/automation/automation_variable_test.go b/internal/services/automation/automation_variable_test.go index 7d794dcf3ed5..f836752116a0 100644 --- a/internal/services/automation/automation_variable_test.go +++ b/internal/services/automation/automation_variable_test.go @@ -122,7 +122,7 @@ func testCheckAzureRMAutomationVariableExists(ctx context.Context, clients *clie return nil, err } - resp, err := clients.Automation.VariableClient.Get(ctx, *id) + resp, err := clients.Automation.Variable.Get(ctx, *id) if err != nil { return nil, fmt.Errorf("retrieving Automation %s Variable %q (Automation Account Name %q / Resource Group %q) does not exist", varType, id.VariableName, id.AutomationAccountName, id.ResourceGroupName) } diff --git a/internal/services/automation/automation_variables_data_source.go b/internal/services/automation/automation_variables_data_source.go index a688d1c5e4a8..2e49ace7a849 100644 --- a/internal/services/automation/automation_variables_data_source.go +++ b/internal/services/automation/automation_variables_data_source.go @@ -129,7 +129,7 @@ func (v AutomationVariablesDataSource) Read() sdk.ResourceFunc { return err } - client := metadata.Client.Automation.VariableClient + client := metadata.Client.Automation.Variable variableList, err := client.ListByAutomationAccountComplete(ctx, pointer.From(automationAccountId)) if err != nil { diff --git a/internal/services/automation/client/client.go b/internal/services/automation/client/client.go index c8aaa72fb830..4067b341aa3a 100644 --- a/internal/services/automation/client/client.go +++ b/internal/services/automation/client/client.go @@ -10,60 +10,31 @@ import ( "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/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/dscnodeconfiguration" - - // hybridrunbookworkergroup v2022-08-08 issue: https://github.com/Azure/azure-rest-api-specs/issues/24740 - runbook2 "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/automationaccount" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/certificate" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/connection" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/connectiontype" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/credential" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscconfiguration" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworker" - "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/module" - "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/schedule" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrol" - "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/variable" + automation_2022_08_08 "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) type Client struct { - AccountClient *automationaccount.AutomationAccountClient + *automation_2022_08_08.Client + AgentRegistrationInfoClient *automation.AgentRegistrationInformationClient - CertificateClient *certificate.CertificateClient - ConnectionClient *connection.ConnectionClient - ConnectionTypeClient *connectiontype.ConnectionTypeClient - CredentialClient *credential.CredentialClient - DscConfigurationClient *dscconfiguration.DscConfigurationClient - DscNodeConfigurationClient *dscnodeconfiguration.DscNodeConfigurationClient - JobScheduleClient *jobschedule.JobScheduleClient - ModuleClient *module.ModuleClient - RunbookClient *runbook.RunbookClient - // use new sdk once https://github.com/hashicorp/pandora/issues/2754 fixed - RunbookClientHack *runbook2.RunbookClient - // port to new sdk issue once https://github.com/hashicorp/pandora/issues/2753 fixed - RunbookDraftClient *automation.RunbookDraftClient - RunBookWgClient *hybridrunbookworkergroup.HybridRunbookWorkerGroupClient - RunbookWorkerClient *hybridrunbookworker.HybridRunbookWorkerClient - ScheduleClient *schedule.ScheduleClient - SoftwareUpdateConfigClient *softwareupdateconfiguration.SoftwareUpdateConfigurationClient - SourceControlClient *sourcecontrol.SourceControlClient - VariableClient *variable.VariableClient - WatcherClient *watcher.WatcherClient - WebhookClient *webhook.WebhookClient + SoftwareUpdateConfigClient *softwareupdateconfiguration.SoftwareUpdateConfigurationClient + WebhookClient *webhook.WebhookClient + WatcherClient *watcher.WatcherClient } func NewClient(o *common.ClientOptions) (*Client, error) { + metaClient, err := automation_2022_08_08.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) { + o.Configure(c, o.Authorizers.ResourceManager) + }) + if err != nil { + return nil, fmt.Errorf("building Automation client: %+v", err) + } + agentRegistrationInfoClient := automation.NewAgentRegistrationInformationClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&agentRegistrationInfoClient.Client, o.ResourceManagerAuthorizer) - runbookWgClient := hybridrunbookworkergroup.NewHybridRunbookWorkerGroupClientWithBaseURI(o.ResourceManagerEndpoint) - o.ConfigureClient(&runbookWgClient.Client, o.ResourceManagerAuthorizer) - softUpClient := softwareupdateconfiguration.NewSoftwareUpdateConfigurationClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&softUpClient.Client, o.ResourceManagerAuthorizer) @@ -73,119 +44,11 @@ func NewClient(o *common.ClientOptions) (*Client, error) { webhookClient := webhook.NewWebhookClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&webhookClient.Client, o.ResourceManagerAuthorizer) - accountClient, err := automationaccount.NewAutomationAccountClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build accountClient: %+v", err) - } - o.Configure(accountClient.Client, o.Authorizers.ResourceManager) - - certificateClient, err := certificate.NewCertificateClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build certificateClient: %+v", err) - } - o.Configure(certificateClient.Client, o.Authorizers.ResourceManager) - - connectionClient, err := connection.NewConnectionClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build connectionClient: %+v", err) - } - o.Configure(connectionClient.Client, o.Authorizers.ResourceManager) - - connectionTypeClient, err := connectiontype.NewConnectionTypeClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build connectionTypeClient: %+v", err) - } - o.Configure(connectionTypeClient.Client, o.Authorizers.ResourceManager) - - credentialClient, err := credential.NewCredentialClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build credentialClient: %+v", err) - } - o.Configure(credentialClient.Client, o.Authorizers.ResourceManager) - - dscConfigurationClient, err := dscconfiguration.NewDscConfigurationClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build dscConfigurationClient: %+v", err) - } - o.Configure(dscConfigurationClient.Client, o.Authorizers.ResourceManager) - - dscNodeConfigurationClient, err := dscnodeconfiguration.NewDscNodeConfigurationClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("building DscNodeConfiguration client: %+v", err) - } - o.Configure(dscNodeConfigurationClient.Client, o.Authorizers.ResourceManager) - - jobScheduleClient, err := jobschedule.NewJobScheduleClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build jobScheduleClient: %+v", err) - } - o.Configure(jobScheduleClient.Client, o.Authorizers.ResourceManager) - - moduleClient, err := module.NewModuleClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build moduleClient: %+v", err) - } - o.Configure(moduleClient.Client, o.Authorizers.ResourceManager) - - runbookClient2 := runbook2.NewRunbookClientWithBaseURI(o.ResourceManagerEndpoint) - o.ConfigureClient(&runbookClient2.Client, o.ResourceManagerAuthorizer) - - runbookClient, err := runbook.NewRunbookClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build runbookClient: %+v", err) - } - o.Configure(runbookClient.Client, o.Authorizers.ResourceManager) - - runbookDraftClient := automation.NewRunbookDraftClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) - o.ConfigureClient(&runbookDraftClient.Client, o.ResourceManagerAuthorizer) - - // runbookDraftClient := runbookdraft.NewRunbookDraftClientWithBaseURI(o.ResourceManagerEndpoint) - // o.ConfigureClient(&runbookDraftClient.Client, o.ResourceManagerAuthorizer) - - runbookWorkerClient, err := hybridrunbookworker.NewHybridRunbookWorkerClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build runbookWorkerClient: %+v", err) - } - o.Configure(runbookWorkerClient.Client, o.Authorizers.ResourceManager) - - sourceCtlClient, err := sourcecontrol.NewSourceControlClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build sourceCtlClient: %+v", err) - } - o.Configure(sourceCtlClient.Client, o.Authorizers.ResourceManager) - - scheduleClient, err := schedule.NewScheduleClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build scheduleClient: %+v", err) - } - o.Configure(scheduleClient.Client, o.Authorizers.ResourceManager) - - variableClient, err := variable.NewVariableClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("build variableClient: %+v", err) - } - o.Configure(variableClient.Client, o.Authorizers.ResourceManager) - return &Client{ - AccountClient: accountClient, + Client: metaClient, + AgentRegistrationInfoClient: &agentRegistrationInfoClient, - CertificateClient: certificateClient, - ConnectionClient: connectionClient, - ConnectionTypeClient: connectionTypeClient, - CredentialClient: credentialClient, - DscConfigurationClient: dscConfigurationClient, - DscNodeConfigurationClient: dscNodeConfigurationClient, - JobScheduleClient: jobScheduleClient, - ModuleClient: moduleClient, - RunbookClient: runbookClient, - RunbookClientHack: &runbookClient2, - RunbookDraftClient: &runbookDraftClient, - RunBookWgClient: &runbookWgClient, - RunbookWorkerClient: runbookWorkerClient, - ScheduleClient: scheduleClient, SoftwareUpdateConfigClient: &softUpClient, - SourceControlClient: sourceCtlClient, - VariableClient: variableClient, WatcherClient: &watcherClient, WebhookClient: &webhookClient, }, nil diff --git a/internal/services/netapp/client/client.go b/internal/services/netapp/client/client.go index 5fd67d41d526..44bf51af4b6a 100644 --- a/internal/services/netapp/client/client.go +++ b/internal/services/netapp/client/client.go @@ -30,7 +30,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) { accountClient, err := netappaccounts.NewNetAppAccountsClientWithBaseURI(o.Environment.ResourceManager) o.Configure(accountClient.Client, o.Authorizers.ResourceManager) if err != nil { - return nil, fmt.Errorf("building AccountClient client: %+v", err) + return nil, fmt.Errorf("building AutomationAccount client: %+v", err) } poolClient, err := capacitypools.NewCapacityPoolsClientWithBaseURI(o.Environment.ResourceManager) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/README.md deleted file mode 100644 index dc7bc0c34a1d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/README.md +++ /dev/null @@ -1,139 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook` Documentation - -The `runbook` 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/runbook" -``` - - -### Client Initialization - -```go -client := runbook.NewRunbookClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RunbookClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := runbook.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") - -payload := runbook.RunbookCreateOrUpdateParameters{ - // ... -} - - -read, err := client.CreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RunbookClient.Delete` - -```go -ctx := context.TODO() -id := runbook.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") - -read, err := client.Delete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RunbookClient.Get` - -```go -ctx := context.TODO() -id := runbook.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") - -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: `RunbookClient.GetContent` - -```go -ctx := context.TODO() -id := runbook.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") - -read, err := client.GetContent(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RunbookClient.ListByAutomationAccount` - -```go -ctx := context.TODO() -id := runbook.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") - -// alternatively `client.ListByAutomationAccount(ctx, id)` can be used to do batched pagination -items, err := client.ListByAutomationAccountComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `RunbookClient.Publish` - -```go -ctx := context.TODO() -id := runbook.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") - -if err := client.PublishThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RunbookClient.Update` - -```go -ctx := context.TODO() -id := runbook.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") - -payload := runbook.RunbookUpdateParameters{ - // ... -} - - -read, err := client.Update(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/runbook/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/client.go deleted file mode 100644 index 9db531d95ffd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package runbook - -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 RunbookClient struct { - Client autorest.Client - baseUri string -} - -func NewRunbookClientWithBaseURI(endpoint string) RunbookClient { - return RunbookClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/constants.go deleted file mode 100644 index d6b40a67147a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/constants.go +++ /dev/null @@ -1,108 +0,0 @@ -package runbook - -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 RunbookProvisioningState string - -const ( - RunbookProvisioningStateSucceeded RunbookProvisioningState = "Succeeded" -) - -func PossibleValuesForRunbookProvisioningState() []string { - return []string{ - string(RunbookProvisioningStateSucceeded), - } -} - -func parseRunbookProvisioningState(input string) (*RunbookProvisioningState, error) { - vals := map[string]RunbookProvisioningState{ - "succeeded": RunbookProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RunbookProvisioningState(input) - return &out, nil -} - -type RunbookState string - -const ( - RunbookStateEdit RunbookState = "Edit" - RunbookStateNew RunbookState = "New" - RunbookStatePublished RunbookState = "Published" -) - -func PossibleValuesForRunbookState() []string { - return []string{ - string(RunbookStateEdit), - string(RunbookStateNew), - string(RunbookStatePublished), - } -} - -func parseRunbookState(input string) (*RunbookState, error) { - vals := map[string]RunbookState{ - "edit": RunbookStateEdit, - "new": RunbookStateNew, - "published": RunbookStatePublished, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RunbookState(input) - return &out, nil -} - -type RunbookTypeEnum string - -const ( - RunbookTypeEnumGraph RunbookTypeEnum = "Graph" - RunbookTypeEnumGraphPowerShell RunbookTypeEnum = "GraphPowerShell" - RunbookTypeEnumGraphPowerShellWorkflow RunbookTypeEnum = "GraphPowerShellWorkflow" - RunbookTypeEnumPowerShell RunbookTypeEnum = "PowerShell" - RunbookTypeEnumPowerShellWorkflow RunbookTypeEnum = "PowerShellWorkflow" - RunbookTypeEnumPythonThree RunbookTypeEnum = "Python3" - RunbookTypeEnumPythonTwo RunbookTypeEnum = "Python2" - RunbookTypeEnumScript RunbookTypeEnum = "Script" -) - -func PossibleValuesForRunbookTypeEnum() []string { - return []string{ - string(RunbookTypeEnumGraph), - string(RunbookTypeEnumGraphPowerShell), - string(RunbookTypeEnumGraphPowerShellWorkflow), - string(RunbookTypeEnumPowerShell), - string(RunbookTypeEnumPowerShellWorkflow), - string(RunbookTypeEnumPythonThree), - string(RunbookTypeEnumPythonTwo), - string(RunbookTypeEnumScript), - } -} - -func parseRunbookTypeEnum(input string) (*RunbookTypeEnum, error) { - vals := map[string]RunbookTypeEnum{ - "graph": RunbookTypeEnumGraph, - "graphpowershell": RunbookTypeEnumGraphPowerShell, - "graphpowershellworkflow": RunbookTypeEnumGraphPowerShellWorkflow, - "powershell": RunbookTypeEnumPowerShell, - "powershellworkflow": RunbookTypeEnumPowerShellWorkflow, - "python3": RunbookTypeEnumPythonThree, - "python2": RunbookTypeEnumPythonTwo, - "script": RunbookTypeEnumScript, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RunbookTypeEnum(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_createorupdate_autorest.go deleted file mode 100644 index b4c13df46117..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_createorupdate_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package runbook - -import ( - "context" - "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 CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - Model *Runbook -} - -// CreateOrUpdate ... -func (c RunbookClient) CreateOrUpdate(ctx context.Context, id RunbookId, input RunbookCreateOrUpdateParameters) (result CreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForCreateOrUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "CreateOrUpdate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForCreateOrUpdate prepares the CreateOrUpdate request. -func (c RunbookClient) preparerForCreateOrUpdate(ctx context.Context, id RunbookId, input RunbookCreateOrUpdateParameters) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForCreateOrUpdate handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (c RunbookClient) responderForCreateOrUpdate(resp *http.Response) (result CreateOrUpdateOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusCreated, 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/runbook/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_delete_autorest.go deleted file mode 100644 index de2022f0cb3d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_delete_autorest.go +++ /dev/null @@ -1,66 +0,0 @@ -package runbook - -import ( - "context" - "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 DeleteOperationResponse struct { - HttpResponse *http.Response -} - -// Delete ... -func (c RunbookClient) Delete(ctx context.Context, id RunbookId) (result DeleteOperationResponse, err error) { - req, err := c.preparerForDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Delete", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Delete", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForDelete(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Delete", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForDelete prepares the Delete request. -func (c RunbookClient) preparerForDelete(ctx context.Context, id RunbookId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForDelete handles the response to the Delete request. The method always -// closes the http.Response Body. -func (c RunbookClient) responderForDelete(resp *http.Response) (result DeleteOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_get_autorest.go deleted file mode 100644 index 2379b32301e9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_get_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package runbook - -import ( - "context" - "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 *Runbook -} - -// Get ... -func (c RunbookClient) Get(ctx context.Context, id RunbookId) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c RunbookClient) preparerForGet(ctx context.Context, id RunbookId) (*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(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 RunbookClient) 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/runbook/method_getcontent_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_getcontent_autorest.go deleted file mode 100644 index bebe1430da67..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_getcontent_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package runbook - -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 GetContentOperationResponse struct { - HttpResponse *http.Response - Model *string -} - -// GetContent ... -func (c RunbookClient) GetContent(ctx context.Context, id RunbookId) (result GetContentOperationResponse, err error) { - req, err := c.preparerForGetContent(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "GetContent", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "GetContent", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGetContent(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "GetContent", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGetContent prepares the GetContent request. -func (c RunbookClient) preparerForGetContent(ctx context.Context, id RunbookId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("text/powershell"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/content", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGetContent handles the response to the GetContent request. The method always -// closes the http.Response Body. -func (c RunbookClient) responderForGetContent(resp *http.Response) (result GetContentOperationResponse, 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/runbook/method_listbyautomationaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_listbyautomationaccount_autorest.go deleted file mode 100644 index 79b15e3dca19..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_listbyautomationaccount_autorest.go +++ /dev/null @@ -1,186 +0,0 @@ -package runbook - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "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 ListByAutomationAccountOperationResponse struct { - HttpResponse *http.Response - Model *[]Runbook - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListByAutomationAccountOperationResponse, error) -} - -type ListByAutomationAccountCompleteResult struct { - Items []Runbook -} - -func (r ListByAutomationAccountOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListByAutomationAccountOperationResponse) LoadMore(ctx context.Context) (resp ListByAutomationAccountOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// ListByAutomationAccount ... -func (c RunbookClient) ListByAutomationAccount(ctx context.Context, id AutomationAccountId) (resp ListByAutomationAccountOperationResponse, err error) { - req, err := c.preparerForListByAutomationAccount(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "ListByAutomationAccount", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForListByAutomationAccount(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "ListByAutomationAccount", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForListByAutomationAccount prepares the ListByAutomationAccount request. -func (c RunbookClient) preparerForListByAutomationAccount(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/runbooks", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListByAutomationAccountWithNextLink prepares the ListByAutomationAccount request with the given nextLink token. -func (c RunbookClient) preparerForListByAutomationAccountWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForListByAutomationAccount handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (c RunbookClient) responderForListByAutomationAccount(resp *http.Response) (result ListByAutomationAccountOperationResponse, err error) { - type page struct { - Values []Runbook `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByAutomationAccountOperationResponse, err error) { - req, err := c.preparerForListByAutomationAccountWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "ListByAutomationAccount", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForListByAutomationAccount(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "ListByAutomationAccount", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListByAutomationAccountComplete retrieves all of the results into a single object -func (c RunbookClient) ListByAutomationAccountComplete(ctx context.Context, id AutomationAccountId) (ListByAutomationAccountCompleteResult, error) { - return c.ListByAutomationAccountCompleteMatchingPredicate(ctx, id, RunbookOperationPredicate{}) -} - -// ListByAutomationAccountCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c RunbookClient) ListByAutomationAccountCompleteMatchingPredicate(ctx context.Context, id AutomationAccountId, predicate RunbookOperationPredicate) (resp ListByAutomationAccountCompleteResult, err error) { - items := make([]Runbook, 0) - - page, err := c.ListByAutomationAccount(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListByAutomationAccountCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_publish_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_publish_autorest.go deleted file mode 100644 index f2e736037d78..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_publish_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package runbook - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublishOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Publish ... -func (c RunbookClient) Publish(ctx context.Context, id RunbookId) (result PublishOperationResponse, err error) { - req, err := c.preparerForPublish(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Publish", nil, "Failure preparing request") - return - } - - result, err = c.senderForPublish(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Publish", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// PublishThenPoll performs Publish then polls until it's completed -func (c RunbookClient) PublishThenPoll(ctx context.Context, id RunbookId) error { - result, err := c.Publish(ctx, id) - if err != nil { - return fmt.Errorf("performing Publish: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Publish: %+v", err) - } - - return nil -} - -// preparerForPublish prepares the Publish request. -func (c RunbookClient) preparerForPublish(ctx context.Context, id RunbookId) (*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/publish", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForPublish sends the Publish request. The method will close the -// http.Response Body if it receives an error. -func (c RunbookClient) senderForPublish(ctx context.Context, req *http.Request) (future PublishOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_update_autorest.go deleted file mode 100644 index 0d6a67ad38d1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/method_update_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package runbook - -import ( - "context" - "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 UpdateOperationResponse struct { - HttpResponse *http.Response - Model *Runbook -} - -// Update ... -func (c RunbookClient) Update(ctx context.Context, id RunbookId, input RunbookUpdateParameters) (result UpdateOperationResponse, err error) { - req, err := c.preparerForUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Update", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Update", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "runbook.RunbookClient", "Update", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForUpdate prepares the Update request. -func (c RunbookClient) preparerForUpdate(ctx context.Context, id RunbookId, input RunbookUpdateParameters) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForUpdate handles the response to the Update request. The method always -// closes the http.Response Body. -func (c RunbookClient) responderForUpdate(resp *http.Response) (result UpdateOperationResponse, 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/runbook/model_runbookcreateorupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookcreateorupdateparameters.go deleted file mode 100644 index d0b7ae400f0e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookcreateorupdateparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package runbook - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RunbookCreateOrUpdateParameters struct { - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties RunbookCreateOrUpdateProperties `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookcreateorupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookcreateorupdateproperties.go deleted file mode 100644 index bfd925628499..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookcreateorupdateproperties.go +++ /dev/null @@ -1,14 +0,0 @@ -package runbook - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RunbookCreateOrUpdateProperties struct { - Description *string `json:"description,omitempty"` - Draft *RunbookDraft `json:"draft,omitempty"` - LogActivityTrace *int64 `json:"logActivityTrace,omitempty"` - LogProgress *bool `json:"logProgress,omitempty"` - LogVerbose *bool `json:"logVerbose,omitempty"` - PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` - RunbookType RunbookTypeEnum `json:"runbookType"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookproperties.go deleted file mode 100644 index 34088469d39c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookproperties.go +++ /dev/null @@ -1,52 +0,0 @@ -package runbook - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RunbookProperties struct { - CreationTime *string `json:"creationTime,omitempty"` - Description *string `json:"description,omitempty"` - Draft *RunbookDraft `json:"draft,omitempty"` - JobCount *int64 `json:"jobCount,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - LastModifiedTime *string `json:"lastModifiedTime,omitempty"` - LogActivityTrace *int64 `json:"logActivityTrace,omitempty"` - LogProgress *bool `json:"logProgress,omitempty"` - LogVerbose *bool `json:"logVerbose,omitempty"` - OutputTypes *[]string `json:"outputTypes,omitempty"` - Parameters *map[string]RunbookParameter `json:"parameters,omitempty"` - ProvisioningState *RunbookProvisioningState `json:"provisioningState,omitempty"` - PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` - RunbookType *RunbookTypeEnum `json:"runbookType,omitempty"` - State *RunbookState `json:"state,omitempty"` -} - -func (o *RunbookProperties) GetCreationTimeAsTime() (*time.Time, error) { - if o.CreationTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *RunbookProperties) SetCreationTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreationTime = &formatted -} - -func (o *RunbookProperties) GetLastModifiedTimeAsTime() (*time.Time, error) { - if o.LastModifiedTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *RunbookProperties) SetLastModifiedTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTime = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookupdateparameters.go deleted file mode 100644 index 64cdc09fce98..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookupdateparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package runbook - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RunbookUpdateParameters struct { - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RunbookUpdateProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookupdateproperties.go deleted file mode 100644 index ebd52032b89f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookupdateproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package runbook - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RunbookUpdateProperties struct { - Description *string `json:"description,omitempty"` - LogActivityTrace *int64 `json:"logActivityTrace,omitempty"` - LogProgress *bool `json:"logProgress,omitempty"` - LogVerbose *bool `json:"logVerbose,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/client.go deleted file mode 100644 index e012f60b2acd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package hybridrunbookworkergroup - -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 HybridRunbookWorkerGroupClient struct { - Client autorest.Client - baseUri string -} - -func NewHybridRunbookWorkerGroupClientWithBaseURI(endpoint string) HybridRunbookWorkerGroupClient { - return HybridRunbookWorkerGroupClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_create_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_create_autorest.go deleted file mode 100644 index 0d6c78fd3a51..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_create_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package hybridrunbookworkergroup - -import ( - "context" - "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 CreateOperationResponse struct { - HttpResponse *http.Response - Model *HybridRunbookWorkerGroup -} - -// Create ... -func (c HybridRunbookWorkerGroupClient) Create(ctx context.Context, id HybridRunbookWorkerGroupId, input HybridRunbookWorkerGroupCreateOrUpdateParameters) (result CreateOperationResponse, err error) { - req, err := c.preparerForCreate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Create", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Create", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForCreate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Create", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForCreate prepares the Create request. -func (c HybridRunbookWorkerGroupClient) preparerForCreate(ctx context.Context, id HybridRunbookWorkerGroupId, input HybridRunbookWorkerGroupCreateOrUpdateParameters) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForCreate handles the response to the Create request. The method always -// closes the http.Response Body. -func (c HybridRunbookWorkerGroupClient) responderForCreate(resp *http.Response) (result CreateOperationResponse, 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/2021-06-22/hybridrunbookworkergroup/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_delete_autorest.go deleted file mode 100644 index e16fc9fa0b3c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_delete_autorest.go +++ /dev/null @@ -1,66 +0,0 @@ -package hybridrunbookworkergroup - -import ( - "context" - "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 DeleteOperationResponse struct { - HttpResponse *http.Response -} - -// Delete ... -func (c HybridRunbookWorkerGroupClient) Delete(ctx context.Context, id HybridRunbookWorkerGroupId) (result DeleteOperationResponse, err error) { - req, err := c.preparerForDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Delete", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Delete", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForDelete(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Delete", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForDelete prepares the Delete request. -func (c HybridRunbookWorkerGroupClient) preparerForDelete(ctx context.Context, id HybridRunbookWorkerGroupId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForDelete handles the response to the Delete request. The method always -// closes the http.Response Body. -func (c HybridRunbookWorkerGroupClient) responderForDelete(resp *http.Response) (result DeleteOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_get_autorest.go deleted file mode 100644 index 8662caeb62d2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_get_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package hybridrunbookworkergroup - -import ( - "context" - "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 *HybridRunbookWorkerGroup -} - -// Get ... -func (c HybridRunbookWorkerGroupClient) Get(ctx context.Context, id HybridRunbookWorkerGroupId) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c HybridRunbookWorkerGroupClient) preparerForGet(ctx context.Context, id HybridRunbookWorkerGroupId) (*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(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 HybridRunbookWorkerGroupClient) 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/2021-06-22/hybridrunbookworkergroup/method_listbyautomationaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_listbyautomationaccount_autorest.go deleted file mode 100644 index 377335307792..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_listbyautomationaccount_autorest.go +++ /dev/null @@ -1,215 +0,0 @@ -package hybridrunbookworkergroup - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "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 ListByAutomationAccountOperationResponse struct { - HttpResponse *http.Response - Model *[]HybridRunbookWorkerGroup - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListByAutomationAccountOperationResponse, error) -} - -type ListByAutomationAccountCompleteResult struct { - Items []HybridRunbookWorkerGroup -} - -func (r ListByAutomationAccountOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListByAutomationAccountOperationResponse) LoadMore(ctx context.Context) (resp ListByAutomationAccountOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type ListByAutomationAccountOperationOptions struct { - Filter *string -} - -func DefaultListByAutomationAccountOperationOptions() ListByAutomationAccountOperationOptions { - return ListByAutomationAccountOperationOptions{} -} - -func (o ListByAutomationAccountOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o ListByAutomationAccountOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Filter != nil { - out["$filter"] = *o.Filter - } - - return out -} - -// ListByAutomationAccount ... -func (c HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions) (resp ListByAutomationAccountOperationResponse, err error) { - req, err := c.preparerForListByAutomationAccount(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForListByAutomationAccount(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForListByAutomationAccount prepares the ListByAutomationAccount request. -func (c HybridRunbookWorkerGroupClient) preparerForListByAutomationAccount(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/hybridRunbookWorkerGroups", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListByAutomationAccountWithNextLink prepares the ListByAutomationAccount request with the given nextLink token. -func (c HybridRunbookWorkerGroupClient) preparerForListByAutomationAccountWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForListByAutomationAccount handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (c HybridRunbookWorkerGroupClient) responderForListByAutomationAccount(resp *http.Response) (result ListByAutomationAccountOperationResponse, err error) { - type page struct { - Values []HybridRunbookWorkerGroup `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByAutomationAccountOperationResponse, err error) { - req, err := c.preparerForListByAutomationAccountWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForListByAutomationAccount(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListByAutomationAccountComplete retrieves all of the results into a single object -func (c HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions) (ListByAutomationAccountCompleteResult, error) { - return c.ListByAutomationAccountCompleteMatchingPredicate(ctx, id, options, HybridRunbookWorkerGroupOperationPredicate{}) -} - -// ListByAutomationAccountCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c HybridRunbookWorkerGroupClient) ListByAutomationAccountCompleteMatchingPredicate(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions, predicate HybridRunbookWorkerGroupOperationPredicate) (resp ListByAutomationAccountCompleteResult, err error) { - items := make([]HybridRunbookWorkerGroup, 0) - - page, err := c.ListByAutomationAccount(ctx, id, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListByAutomationAccountCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_update_autorest.go deleted file mode 100644 index 11af90321480..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/method_update_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package hybridrunbookworkergroup - -import ( - "context" - "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 UpdateOperationResponse struct { - HttpResponse *http.Response - Model *HybridRunbookWorkerGroup -} - -// Update ... -func (c HybridRunbookWorkerGroupClient) Update(ctx context.Context, id HybridRunbookWorkerGroupId, input HybridRunbookWorkerGroupCreateOrUpdateParameters) (result UpdateOperationResponse, err error) { - req, err := c.preparerForUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Update", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Update", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "hybridrunbookworkergroup.HybridRunbookWorkerGroupClient", "Update", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForUpdate prepares the Update request. -func (c HybridRunbookWorkerGroupClient) preparerForUpdate(ctx context.Context, id HybridRunbookWorkerGroupId, input HybridRunbookWorkerGroupCreateOrUpdateParameters) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForUpdate handles the response to the Update request. The method always -// closes the http.Response Body. -func (c HybridRunbookWorkerGroupClient) responderForUpdate(resp *http.Response) (result UpdateOperationResponse, 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/2021-06-22/hybridrunbookworkergroup/model_hybridrunbookworkergroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/model_hybridrunbookworkergroup.go deleted file mode 100644 index 40b13e14b2bc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/model_hybridrunbookworkergroup.go +++ /dev/null @@ -1,18 +0,0 @@ -package hybridrunbookworkergroup - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HybridRunbookWorkerGroup struct { - Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` - GroupType *GroupTypeEnum `json:"groupType,omitempty"` - HybridRunbookWorkers *[]HybridRunbookWorkerLegacy `json:"hybridRunbookWorkers,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/model_hybridrunbookworkerlegacy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/model_hybridrunbookworkerlegacy.go deleted file mode 100644 index d4f2e64249ac..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/model_hybridrunbookworkerlegacy.go +++ /dev/null @@ -1,41 +0,0 @@ -package hybridrunbookworkergroup - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HybridRunbookWorkerLegacy struct { - IP *string `json:"ip,omitempty"` - LastSeenDateTime *string `json:"lastSeenDateTime,omitempty"` - Name *string `json:"name,omitempty"` - RegistrationTime *string `json:"registrationTime,omitempty"` -} - -func (o *HybridRunbookWorkerLegacy) GetLastSeenDateTimeAsTime() (*time.Time, error) { - if o.LastSeenDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastSeenDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HybridRunbookWorkerLegacy) SetLastSeenDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastSeenDateTime = &formatted -} - -func (o *HybridRunbookWorkerLegacy) GetRegistrationTimeAsTime() (*time.Time, error) { - if o.RegistrationTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.RegistrationTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HybridRunbookWorkerLegacy) SetRegistrationTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.RegistrationTime = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/README.md new file mode 100644 index 000000000000..06c08fdf88fb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity` Documentation + +The `activity` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/activity" +``` + + +### Client Initialization + +```go +client := activity.NewActivityClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ActivityClient.Get` + +```go +ctx := context.TODO() +id := activity.NewActivityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "moduleValue", "activityValue") + +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: `ActivityClient.ListByModule` + +```go +ctx := context.TODO() +id := activity.NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "moduleValue") + +// alternatively `client.ListByModule(ctx, id)` can be used to do batched pagination +items, err := client.ListByModuleComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/client.go new file mode 100644 index 000000000000..0142d55ea1f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/client.go @@ -0,0 +1,26 @@ +package activity + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActivityClient struct { + Client *resourcemanager.Client +} + +func NewActivityClientWithBaseURI(sdkApi sdkEnv.Api) (*ActivityClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "activity", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ActivityClient: %+v", err) + } + + return &ActivityClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/id_activity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/id_activity.go new file mode 100644 index 000000000000..3930c9054927 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/id_activity.go @@ -0,0 +1,153 @@ +package activity + +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 = ActivityId{} + +// ActivityId is a struct representing the Resource ID for a Activity +type ActivityId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + ModuleName string + ActivityName string +} + +// NewActivityID returns a new ActivityId struct +func NewActivityID(subscriptionId string, resourceGroupName string, automationAccountName string, moduleName string, activityName string) ActivityId { + return ActivityId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + ModuleName: moduleName, + ActivityName: activityName, + } +} + +// ParseActivityID parses 'input' into a ActivityId +func ParseActivityID(input string) (*ActivityId, error) { + parser := resourceids.NewParserFromResourceIdType(ActivityId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ActivityId{} + + 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) + } + + if id.ModuleName, ok = parsed.Parsed["moduleName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "moduleName", *parsed) + } + + if id.ActivityName, ok = parsed.Parsed["activityName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "activityName", *parsed) + } + + return &id, nil +} + +// ParseActivityIDInsensitively parses 'input' case-insensitively into a ActivityId +// note: this method should only be used for API response data and not user input +func ParseActivityIDInsensitively(input string) (*ActivityId, error) { + parser := resourceids.NewParserFromResourceIdType(ActivityId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ActivityId{} + + 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) + } + + if id.ModuleName, ok = parsed.Parsed["moduleName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "moduleName", *parsed) + } + + if id.ActivityName, ok = parsed.Parsed["activityName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "activityName", *parsed) + } + + return &id, nil +} + +// ValidateActivityID checks that 'input' can be parsed as a Activity ID +func ValidateActivityID(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 := ParseActivityID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Activity ID +func (id ActivityId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/modules/%s/activities/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.ModuleName, id.ActivityName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Activity ID +func (id ActivityId) 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"), + resourceids.StaticSegment("staticModules", "modules", "modules"), + resourceids.UserSpecifiedSegment("moduleName", "moduleValue"), + resourceids.StaticSegment("staticActivities", "activities", "activities"), + resourceids.UserSpecifiedSegment("activityName", "activityValue"), + } +} + +// String returns a human-readable description of this Activity ID +func (id ActivityId) 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), + fmt.Sprintf("Module Name: %q", id.ModuleName), + fmt.Sprintf("Activity Name: %q", id.ActivityName), + } + return fmt.Sprintf("Activity (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/id_module.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/id_module.go new file mode 100644 index 000000000000..0c927d16d45c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/id_module.go @@ -0,0 +1,140 @@ +package activity + +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 = ModuleId{} + +// ModuleId is a struct representing the Resource ID for a Module +type ModuleId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + ModuleName string +} + +// NewModuleID returns a new ModuleId struct +func NewModuleID(subscriptionId string, resourceGroupName string, automationAccountName string, moduleName string) ModuleId { + return ModuleId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + ModuleName: moduleName, + } +} + +// ParseModuleID parses 'input' into a ModuleId +func ParseModuleID(input string) (*ModuleId, error) { + parser := resourceids.NewParserFromResourceIdType(ModuleId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ModuleId{} + + 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) + } + + if id.ModuleName, ok = parsed.Parsed["moduleName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "moduleName", *parsed) + } + + return &id, nil +} + +// ParseModuleIDInsensitively parses 'input' case-insensitively into a ModuleId +// note: this method should only be used for API response data and not user input +func ParseModuleIDInsensitively(input string) (*ModuleId, error) { + parser := resourceids.NewParserFromResourceIdType(ModuleId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ModuleId{} + + 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) + } + + if id.ModuleName, ok = parsed.Parsed["moduleName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "moduleName", *parsed) + } + + return &id, nil +} + +// ValidateModuleID checks that 'input' can be parsed as a Module ID +func ValidateModuleID(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 := ParseModuleID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Module ID +func (id ModuleId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/modules/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.ModuleName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Module ID +func (id ModuleId) 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"), + resourceids.StaticSegment("staticModules", "modules", "modules"), + resourceids.UserSpecifiedSegment("moduleName", "moduleValue"), + } +} + +// String returns a human-readable description of this Module ID +func (id ModuleId) 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), + fmt.Sprintf("Module Name: %q", id.ModuleName), + } + return fmt.Sprintf("Module (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/method_get.go new file mode 100644 index 000000000000..85eef139cbbd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/method_get.go @@ -0,0 +1,51 @@ +package activity + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *Activity +} + +// Get ... +func (c ActivityClient) Get(ctx context.Context, id ActivityId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/method_listbymodule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/method_listbymodule.go new file mode 100644 index 000000000000..56a36067135e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/method_listbymodule.go @@ -0,0 +1,89 @@ +package activity + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByModuleOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Activity +} + +type ListByModuleCompleteResult struct { + Items []Activity +} + +// ListByModule ... +func (c ActivityClient) ListByModule(ctx context.Context, id ModuleId) (result ListByModuleOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/activities", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Activity `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByModuleComplete retrieves all the results into a single object +func (c ActivityClient) ListByModuleComplete(ctx context.Context, id ModuleId) (ListByModuleCompleteResult, error) { + return c.ListByModuleCompleteMatchingPredicate(ctx, id, ActivityOperationPredicate{}) +} + +// ListByModuleCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ActivityClient) ListByModuleCompleteMatchingPredicate(ctx context.Context, id ModuleId, predicate ActivityOperationPredicate) (result ListByModuleCompleteResult, err error) { + items := make([]Activity, 0) + + resp, err := c.ListByModule(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByModuleCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activity.go new file mode 100644 index 000000000000..ded9bf48612c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activity.go @@ -0,0 +1,10 @@ +package activity + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Activity struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ActivityProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityoutputtype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityoutputtype.go new file mode 100644 index 000000000000..8231567f8bb1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityoutputtype.go @@ -0,0 +1,9 @@ +package activity + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActivityOutputType struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityparameter.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityparameter.go new file mode 100644 index 000000000000..c999f5e94e0b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityparameter.go @@ -0,0 +1,17 @@ +package activity + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActivityParameter struct { + Description *string `json:"description,omitempty"` + IsDynamic *bool `json:"isDynamic,omitempty"` + IsMandatory *bool `json:"isMandatory,omitempty"` + Name *string `json:"name,omitempty"` + Position *int64 `json:"position,omitempty"` + Type *string `json:"type,omitempty"` + ValidationSet *[]ActivityParameterValidationSet `json:"validationSet,omitempty"` + ValueFromPipeline *bool `json:"valueFromPipeline,omitempty"` + ValueFromPipelineByPropertyName *bool `json:"valueFromPipelineByPropertyName,omitempty"` + ValueFromRemainingArguments *bool `json:"valueFromRemainingArguments,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityparameterset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityparameterset.go new file mode 100644 index 000000000000..f79c0e2f9b25 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityparameterset.go @@ -0,0 +1,9 @@ +package activity + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActivityParameterSet struct { + Name *string `json:"name,omitempty"` + Parameters *[]ActivityParameter `json:"parameters,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityparametervalidationset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityparametervalidationset.go new file mode 100644 index 000000000000..42a0fcd1e00c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityparametervalidationset.go @@ -0,0 +1,8 @@ +package activity + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActivityParameterValidationSet struct { + MemberValue *string `json:"memberValue,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityproperties.go new file mode 100644 index 000000000000..cfb044661569 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/model_activityproperties.go @@ -0,0 +1,43 @@ +package activity + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActivityProperties struct { + CreationTime *string `json:"creationTime,omitempty"` + Definition *string `json:"definition,omitempty"` + Description *string `json:"description,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + OutputTypes *[]ActivityOutputType `json:"outputTypes,omitempty"` + ParameterSets *[]ActivityParameterSet `json:"parameterSets,omitempty"` +} + +func (o *ActivityProperties) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *ActivityProperties) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *ActivityProperties) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *ActivityProperties) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/predicates.go new file mode 100644 index 000000000000..8e0d9fda2082 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/predicates.go @@ -0,0 +1,22 @@ +package activity + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActivityOperationPredicate struct { + Id *string + Name *string +} + +func (p ActivityOperationPredicate) Matches(input Activity) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/version.go new file mode 100644 index 000000000000..f4df6fbd25fd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity/version.go @@ -0,0 +1,12 @@ +package activity + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/activity/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/client.go new file mode 100644 index 000000000000..1f1de71693ec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/client.go @@ -0,0 +1,325 @@ +package v2022_08_08 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/automationaccount" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/certificate" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/connection" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/connectiontype" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/credential" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscconfiguration" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscnodeconfiguration" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworker" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job" + "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/jobstream" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/module" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package" + "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" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/schedule" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrol" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages" + "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/variable" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +type Client struct { + Activity *activity.ActivityClient + AutomationAccount *automationaccount.AutomationAccountClient + Certificate *certificate.CertificateClient + Connection *connection.ConnectionClient + ConnectionType *connectiontype.ConnectionTypeClient + Credential *credential.CredentialClient + DscConfiguration *dscconfiguration.DscConfigurationClient + DscNodeConfiguration *dscnodeconfiguration.DscNodeConfigurationClient + HybridRunbookWorker *hybridrunbookworker.HybridRunbookWorkerClient + HybridRunbookWorkerGroup *hybridrunbookworkergroup.HybridRunbookWorkerGroupClient + Job *job.JobClient + JobSchedule *jobschedule.JobScheduleClient + JobStream *jobstream.JobStreamClient + LinkedWorkspace *linkedworkspace.LinkedWorkspaceClient + ListKeys *listkeys.ListKeysClient + Module *module.ModuleClient + ObjectDataTypes *objectdatatypes.ObjectDataTypesClient + Operations *operations.OperationsClient + Python2Package *python2package.Python2PackageClient + Python3Package *python3package.Python3PackageClient + Runbook *runbook.RunbookClient + RunbookDraft *runbookdraft.RunbookDraftClient + Schedule *schedule.ScheduleClient + SoftwareUpdateConfigurationMachineRun *softwareupdateconfigurationmachinerun.SoftwareUpdateConfigurationMachineRunClient + SoftwareUpdateConfigurationRun *softwareupdateconfigurationrun.SoftwareUpdateConfigurationRunClient + SourceControl *sourcecontrol.SourceControlClient + SourceControlSyncJob *sourcecontrolsyncjob.SourceControlSyncJobClient + SourceControlSyncJobStreams *sourcecontrolsyncjobstreams.SourceControlSyncJobStreamsClient + Statistics *statistics.StatisticsClient + TestJob *testjob.TestJobClient + TestJobStream *testjobstream.TestJobStreamClient + TypeFields *typefields.TypeFieldsClient + Usages *usages.UsagesClient + Variable *variable.VariableClient +} + +func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { + activityClient, err := activity.NewActivityClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Activity client: %+v", err) + } + configureFunc(activityClient.Client) + + automationAccountClient, err := automationaccount.NewAutomationAccountClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AutomationAccount client: %+v", err) + } + configureFunc(automationAccountClient.Client) + + certificateClient, err := certificate.NewCertificateClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Certificate client: %+v", err) + } + configureFunc(certificateClient.Client) + + connectionClient, err := connection.NewConnectionClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Connection client: %+v", err) + } + configureFunc(connectionClient.Client) + + connectionTypeClient, err := connectiontype.NewConnectionTypeClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ConnectionType client: %+v", err) + } + configureFunc(connectionTypeClient.Client) + + credentialClient, err := credential.NewCredentialClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Credential client: %+v", err) + } + configureFunc(credentialClient.Client) + + dscConfigurationClient, err := dscconfiguration.NewDscConfigurationClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DscConfiguration client: %+v", err) + } + configureFunc(dscConfigurationClient.Client) + + dscNodeConfigurationClient, err := dscnodeconfiguration.NewDscNodeConfigurationClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DscNodeConfiguration client: %+v", err) + } + configureFunc(dscNodeConfigurationClient.Client) + + hybridRunbookWorkerClient, err := hybridrunbookworker.NewHybridRunbookWorkerClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building HybridRunbookWorker client: %+v", err) + } + configureFunc(hybridRunbookWorkerClient.Client) + + hybridRunbookWorkerGroupClient, err := hybridrunbookworkergroup.NewHybridRunbookWorkerGroupClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building HybridRunbookWorkerGroup client: %+v", err) + } + configureFunc(hybridRunbookWorkerGroupClient.Client) + + jobClient, err := job.NewJobClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Job client: %+v", err) + } + configureFunc(jobClient.Client) + + jobScheduleClient, err := jobschedule.NewJobScheduleClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building JobSchedule client: %+v", err) + } + configureFunc(jobScheduleClient.Client) + + jobStreamClient, err := jobstream.NewJobStreamClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building JobStream client: %+v", err) + } + configureFunc(jobStreamClient.Client) + + linkedWorkspaceClient, err := linkedworkspace.NewLinkedWorkspaceClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building LinkedWorkspace client: %+v", err) + } + configureFunc(linkedWorkspaceClient.Client) + + listKeysClient, err := listkeys.NewListKeysClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ListKeys client: %+v", err) + } + configureFunc(listKeysClient.Client) + + moduleClient, err := module.NewModuleClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Module client: %+v", err) + } + configureFunc(moduleClient.Client) + + objectDataTypesClient, err := objectdatatypes.NewObjectDataTypesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ObjectDataTypes client: %+v", err) + } + configureFunc(objectDataTypesClient.Client) + + operationsClient, err := operations.NewOperationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Operations client: %+v", err) + } + configureFunc(operationsClient.Client) + + python2PackageClient, err := python2package.NewPython2PackageClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Python2Package client: %+v", err) + } + configureFunc(python2PackageClient.Client) + + python3PackageClient, err := python3package.NewPython3PackageClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Python3Package client: %+v", err) + } + configureFunc(python3PackageClient.Client) + + runbookClient, err := runbook.NewRunbookClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Runbook client: %+v", err) + } + configureFunc(runbookClient.Client) + + runbookDraftClient, err := runbookdraft.NewRunbookDraftClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building RunbookDraft client: %+v", err) + } + configureFunc(runbookDraftClient.Client) + + scheduleClient, err := schedule.NewScheduleClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Schedule client: %+v", err) + } + configureFunc(scheduleClient.Client) + + softwareUpdateConfigurationMachineRunClient, err := softwareupdateconfigurationmachinerun.NewSoftwareUpdateConfigurationMachineRunClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SoftwareUpdateConfigurationMachineRun client: %+v", err) + } + configureFunc(softwareUpdateConfigurationMachineRunClient.Client) + + softwareUpdateConfigurationRunClient, err := softwareupdateconfigurationrun.NewSoftwareUpdateConfigurationRunClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SoftwareUpdateConfigurationRun client: %+v", err) + } + configureFunc(softwareUpdateConfigurationRunClient.Client) + + sourceControlClient, err := sourcecontrol.NewSourceControlClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SourceControl client: %+v", err) + } + configureFunc(sourceControlClient.Client) + + sourceControlSyncJobClient, err := sourcecontrolsyncjob.NewSourceControlSyncJobClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SourceControlSyncJob client: %+v", err) + } + configureFunc(sourceControlSyncJobClient.Client) + + sourceControlSyncJobStreamsClient, err := sourcecontrolsyncjobstreams.NewSourceControlSyncJobStreamsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SourceControlSyncJobStreams client: %+v", err) + } + configureFunc(sourceControlSyncJobStreamsClient.Client) + + statisticsClient, err := statistics.NewStatisticsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Statistics client: %+v", err) + } + configureFunc(statisticsClient.Client) + + testJobClient, err := testjob.NewTestJobClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building TestJob client: %+v", err) + } + configureFunc(testJobClient.Client) + + testJobStreamClient, err := testjobstream.NewTestJobStreamClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building TestJobStream client: %+v", err) + } + configureFunc(testJobStreamClient.Client) + + typeFieldsClient, err := typefields.NewTypeFieldsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building TypeFields client: %+v", err) + } + configureFunc(typeFieldsClient.Client) + + usagesClient, err := usages.NewUsagesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Usages client: %+v", err) + } + configureFunc(usagesClient.Client) + + variableClient, err := variable.NewVariableClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Variable client: %+v", err) + } + configureFunc(variableClient.Client) + + return &Client{ + Activity: activityClient, + AutomationAccount: automationAccountClient, + Certificate: certificateClient, + Connection: connectionClient, + ConnectionType: connectionTypeClient, + Credential: credentialClient, + DscConfiguration: dscConfigurationClient, + DscNodeConfiguration: dscNodeConfigurationClient, + HybridRunbookWorker: hybridRunbookWorkerClient, + HybridRunbookWorkerGroup: hybridRunbookWorkerGroupClient, + Job: jobClient, + JobSchedule: jobScheduleClient, + JobStream: jobStreamClient, + LinkedWorkspace: linkedWorkspaceClient, + ListKeys: listKeysClient, + Module: moduleClient, + ObjectDataTypes: objectDataTypesClient, + Operations: operationsClient, + Python2Package: python2PackageClient, + Python3Package: python3PackageClient, + Runbook: runbookClient, + RunbookDraft: runbookDraftClient, + Schedule: scheduleClient, + SoftwareUpdateConfigurationMachineRun: softwareUpdateConfigurationMachineRunClient, + SoftwareUpdateConfigurationRun: softwareUpdateConfigurationRunClient, + SourceControl: sourceControlClient, + SourceControlSyncJob: sourceControlSyncJobClient, + SourceControlSyncJobStreams: sourceControlSyncJobStreamsClient, + Statistics: statisticsClient, + TestJob: testJobClient, + TestJobStream: testJobStreamClient, + TypeFields: typeFieldsClient, + Usages: usagesClient, + Variable: variableClient, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/README.md similarity index 96% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/README.md index 42d0d2e0a328..3303a53039b7 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup` Documentation -The `hybridrunbookworkergroup` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2021-06-22`). +The `hybridrunbookworkergroup` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). 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/2021-06-22/hybridrunbookworkergroup" +import "github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup" ``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/client.go new file mode 100644 index 000000000000..f5ebfd7b744f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/client.go @@ -0,0 +1,26 @@ +package hybridrunbookworkergroup + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridRunbookWorkerGroupClient struct { + Client *resourcemanager.Client +} + +func NewHybridRunbookWorkerGroupClientWithBaseURI(sdkApi sdkEnv.Api) (*HybridRunbookWorkerGroupClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "hybridrunbookworkergroup", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating HybridRunbookWorkerGroupClient: %+v", err) + } + + return &HybridRunbookWorkerGroupClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/constants.go similarity index 68% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/constants.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/constants.go index c54f881afbd6..29c63eaced89 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/constants.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/constants.go @@ -1,6 +1,10 @@ package hybridrunbookworkergroup -import "strings" +import ( + "encoding/json" + "fmt" + "strings" +) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -19,6 +23,19 @@ func PossibleValuesForGroupTypeEnum() []string { } } +func (s *GroupTypeEnum) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGroupTypeEnum(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parseGroupTypeEnum(input string) (*GroupTypeEnum, error) { vals := map[string]GroupTypeEnum{ "system": GroupTypeEnumSystem, diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/id_automationaccount.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/id_automationaccount.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/id_automationaccount.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/id_hybridrunbookworkergroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/id_hybridrunbookworkergroup.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/id_hybridrunbookworkergroup.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/id_hybridrunbookworkergroup.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_create.go new file mode 100644 index 000000000000..feb0eadc9d17 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_create.go @@ -0,0 +1,56 @@ +package hybridrunbookworkergroup + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *HybridRunbookWorkerGroup +} + +// Create ... +func (c HybridRunbookWorkerGroupClient) Create(ctx context.Context, id HybridRunbookWorkerGroupId, input HybridRunbookWorkerGroupCreateOrUpdateParameters) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_delete.go new file mode 100644 index 000000000000..75f191229c28 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_delete.go @@ -0,0 +1,46 @@ +package hybridrunbookworkergroup + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c HybridRunbookWorkerGroupClient) Delete(ctx context.Context, id HybridRunbookWorkerGroupId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_get.go new file mode 100644 index 000000000000..3f4086ef19c6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_get.go @@ -0,0 +1,51 @@ +package hybridrunbookworkergroup + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *HybridRunbookWorkerGroup +} + +// Get ... +func (c HybridRunbookWorkerGroupClient) Get(ctx context.Context, id HybridRunbookWorkerGroupId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_listbyautomationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_listbyautomationaccount.go new file mode 100644 index 000000000000..b4c8dd886949 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_listbyautomationaccount.go @@ -0,0 +1,117 @@ +package hybridrunbookworkergroup + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByAutomationAccountOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]HybridRunbookWorkerGroup +} + +type ListByAutomationAccountCompleteResult struct { + Items []HybridRunbookWorkerGroup +} + +type ListByAutomationAccountOperationOptions struct { + Filter *string +} + +func DefaultListByAutomationAccountOperationOptions() ListByAutomationAccountOperationOptions { + return ListByAutomationAccountOperationOptions{} +} + +func (o ListByAutomationAccountOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListByAutomationAccountOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListByAutomationAccountOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + return &out +} + +// ListByAutomationAccount ... +func (c HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions) (result ListByAutomationAccountOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/hybridRunbookWorkerGroups", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]HybridRunbookWorkerGroup `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByAutomationAccountComplete retrieves all the results into a single object +func (c HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions) (ListByAutomationAccountCompleteResult, error) { + return c.ListByAutomationAccountCompleteMatchingPredicate(ctx, id, options, HybridRunbookWorkerGroupOperationPredicate{}) +} + +// ListByAutomationAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HybridRunbookWorkerGroupClient) ListByAutomationAccountCompleteMatchingPredicate(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions, predicate HybridRunbookWorkerGroupOperationPredicate) (result ListByAutomationAccountCompleteResult, err error) { + items := make([]HybridRunbookWorkerGroup, 0) + + resp, err := c.ListByAutomationAccount(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByAutomationAccountCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_update.go new file mode 100644 index 000000000000..356855a98f69 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/method_update.go @@ -0,0 +1,55 @@ +package hybridrunbookworkergroup + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *HybridRunbookWorkerGroup +} + +// Update ... +func (c HybridRunbookWorkerGroupClient) Update(ctx context.Context, id HybridRunbookWorkerGroupId, input HybridRunbookWorkerGroupCreateOrUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroup.go new file mode 100644 index 000000000000..07a7155e35ca --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroup.go @@ -0,0 +1,16 @@ +package hybridrunbookworkergroup + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridRunbookWorkerGroup struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *HybridRunbookWorkerGroupProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroupcreateorupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroupcreateorupdateparameters.go new file mode 100644 index 000000000000..95da5375270b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroupcreateorupdateparameters.go @@ -0,0 +1,9 @@ +package hybridrunbookworkergroup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridRunbookWorkerGroupCreateOrUpdateParameters struct { + Name *string `json:"name,omitempty"` + Properties *HybridRunbookWorkerGroupCreateOrUpdateProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/model_hybridrunbookworkergroupcreateorupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroupcreateorupdateproperties.go similarity index 81% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/model_hybridrunbookworkergroupcreateorupdateparameters.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroupcreateorupdateproperties.go index c521a458e7cd..07094308076a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/model_hybridrunbookworkergroupcreateorupdateparameters.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroupcreateorupdateproperties.go @@ -3,6 +3,6 @@ package hybridrunbookworkergroup // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type HybridRunbookWorkerGroupCreateOrUpdateParameters struct { +type HybridRunbookWorkerGroupCreateOrUpdateProperties struct { Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroupproperties.go new file mode 100644 index 000000000000..172eb26d8c14 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_hybridrunbookworkergroupproperties.go @@ -0,0 +1,9 @@ +package hybridrunbookworkergroup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridRunbookWorkerGroupProperties struct { + Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` + GroupType *GroupTypeEnum `json:"groupType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/model_runascredentialassociationproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_runascredentialassociationproperty.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/model_runascredentialassociationproperty.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/model_runascredentialassociationproperty.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/predicates.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/predicates.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/version.go similarity index 89% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/version.go index f77fc5794a8c..2c336d81831d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup/version.go @@ -5,7 +5,7 @@ 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 = "2021-06-22" +const defaultApiVersion = "2022-08-08" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/hybridrunbookworkergroup/%s", defaultApiVersion) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/README.md new file mode 100644 index 000000000000..0e99bf90114d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/README.md @@ -0,0 +1,154 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job` Documentation + +The `job` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/job" +``` + + +### Client Initialization + +```go +client := job.NewJobClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `JobClient.Create` + +```go +ctx := context.TODO() +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobValue") + +payload := job.JobCreateParameters{ + // ... +} + + +read, err := client.Create(ctx, id, payload, job.DefaultCreateOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `JobClient.Get` + +```go +ctx := context.TODO() +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobValue") + +read, err := client.Get(ctx, id, job.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `JobClient.GetOutput` + +```go +ctx := context.TODO() +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobValue") + +read, err := client.GetOutput(ctx, id, job.DefaultGetOutputOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `JobClient.GetRunbookContent` + +```go +ctx := context.TODO() +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobValue") + +read, err := client.GetRunbookContent(ctx, id, job.DefaultGetRunbookContentOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `JobClient.ListByAutomationAccount` + +```go +ctx := context.TODO() +id := job.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +// alternatively `client.ListByAutomationAccount(ctx, id, job.DefaultListByAutomationAccountOperationOptions())` can be used to do batched pagination +items, err := client.ListByAutomationAccountComplete(ctx, id, job.DefaultListByAutomationAccountOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `JobClient.Resume` + +```go +ctx := context.TODO() +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobValue") + +read, err := client.Resume(ctx, id, job.DefaultResumeOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `JobClient.Stop` + +```go +ctx := context.TODO() +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobValue") + +read, err := client.Stop(ctx, id, job.DefaultStopOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `JobClient.Suspend` + +```go +ctx := context.TODO() +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobValue") + +read, err := client.Suspend(ctx, id, job.DefaultSuspendOperationOptions()) +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/2022-08-08/job/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/client.go new file mode 100644 index 000000000000..4736df084cf2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/client.go @@ -0,0 +1,26 @@ +package job + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobClient struct { + Client *resourcemanager.Client +} + +func NewJobClientWithBaseURI(sdkApi sdkEnv.Api) (*JobClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "job", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating JobClient: %+v", err) + } + + return &JobClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/constants.go new file mode 100644 index 000000000000..cf4703a8323c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/constants.go @@ -0,0 +1,131 @@ +package job + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobProvisioningState string + +const ( + JobProvisioningStateFailed JobProvisioningState = "Failed" + JobProvisioningStateProcessing JobProvisioningState = "Processing" + JobProvisioningStateSucceeded JobProvisioningState = "Succeeded" + JobProvisioningStateSuspended JobProvisioningState = "Suspended" +) + +func PossibleValuesForJobProvisioningState() []string { + return []string{ + string(JobProvisioningStateFailed), + string(JobProvisioningStateProcessing), + string(JobProvisioningStateSucceeded), + string(JobProvisioningStateSuspended), + } +} + +func (s *JobProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseJobProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseJobProvisioningState(input string) (*JobProvisioningState, error) { + vals := map[string]JobProvisioningState{ + "failed": JobProvisioningStateFailed, + "processing": JobProvisioningStateProcessing, + "succeeded": JobProvisioningStateSucceeded, + "suspended": JobProvisioningStateSuspended, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := JobProvisioningState(input) + return &out, nil +} + +type JobStatus string + +const ( + JobStatusActivating JobStatus = "Activating" + JobStatusBlocked JobStatus = "Blocked" + JobStatusCompleted JobStatus = "Completed" + JobStatusDisconnected JobStatus = "Disconnected" + JobStatusFailed JobStatus = "Failed" + JobStatusNew JobStatus = "New" + JobStatusRemoving JobStatus = "Removing" + JobStatusResuming JobStatus = "Resuming" + JobStatusRunning JobStatus = "Running" + JobStatusStopped JobStatus = "Stopped" + JobStatusStopping JobStatus = "Stopping" + JobStatusSuspended JobStatus = "Suspended" + JobStatusSuspending JobStatus = "Suspending" +) + +func PossibleValuesForJobStatus() []string { + return []string{ + string(JobStatusActivating), + string(JobStatusBlocked), + string(JobStatusCompleted), + string(JobStatusDisconnected), + string(JobStatusFailed), + string(JobStatusNew), + string(JobStatusRemoving), + string(JobStatusResuming), + string(JobStatusRunning), + string(JobStatusStopped), + string(JobStatusStopping), + string(JobStatusSuspended), + string(JobStatusSuspending), + } +} + +func (s *JobStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseJobStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseJobStatus(input string) (*JobStatus, error) { + vals := map[string]JobStatus{ + "activating": JobStatusActivating, + "blocked": JobStatusBlocked, + "completed": JobStatusCompleted, + "disconnected": JobStatusDisconnected, + "failed": JobStatusFailed, + "new": JobStatusNew, + "removing": JobStatusRemoving, + "resuming": JobStatusResuming, + "running": JobStatusRunning, + "stopped": JobStatusStopped, + "stopping": JobStatusStopping, + "suspended": JobStatusSuspended, + "suspending": JobStatusSuspending, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := JobStatus(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/id_automationaccount.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/id_automationaccount.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/id_automationaccount.go index 8a8b18b7895f..92931d6f6349 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/id_automationaccount.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/id_automationaccount.go @@ -1,4 +1,4 @@ -package runbook +package job import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/id_job.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/id_job.go new file mode 100644 index 000000000000..fbadf9f6a121 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/id_job.go @@ -0,0 +1,140 @@ +package job + +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 = JobId{} + +// JobId is a struct representing the Resource ID for a Job +type JobId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + JobName string +} + +// NewJobID returns a new JobId struct +func NewJobID(subscriptionId string, resourceGroupName string, automationAccountName string, jobName string) JobId { + return JobId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + JobName: jobName, + } +} + +// ParseJobID parses 'input' into a JobId +func ParseJobID(input string) (*JobId, error) { + parser := resourceids.NewParserFromResourceIdType(JobId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := JobId{} + + 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) + } + + if id.JobName, ok = parsed.Parsed["jobName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "jobName", *parsed) + } + + return &id, nil +} + +// ParseJobIDInsensitively parses 'input' case-insensitively into a JobId +// note: this method should only be used for API response data and not user input +func ParseJobIDInsensitively(input string) (*JobId, error) { + parser := resourceids.NewParserFromResourceIdType(JobId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := JobId{} + + 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) + } + + if id.JobName, ok = parsed.Parsed["jobName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "jobName", *parsed) + } + + return &id, nil +} + +// ValidateJobID checks that 'input' can be parsed as a Job ID +func ValidateJobID(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 := ParseJobID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Job ID +func (id JobId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/jobs/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.JobName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Job ID +func (id JobId) 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"), + resourceids.StaticSegment("staticJobs", "jobs", "jobs"), + resourceids.UserSpecifiedSegment("jobName", "jobValue"), + } +} + +// String returns a human-readable description of this Job ID +func (id JobId) 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), + fmt.Sprintf("Job Name: %q", id.JobName), + } + return fmt.Sprintf("Job (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_create.go new file mode 100644 index 000000000000..75343bacd2bb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_create.go @@ -0,0 +1,84 @@ +package job + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Job +} + +type CreateOperationOptions struct { + ClientRequestId *string +} + +func DefaultCreateOperationOptions() CreateOperationOptions { + return CreateOperationOptions{} +} + +func (o CreateOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o CreateOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o CreateOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// Create ... +func (c JobClient) Create(ctx context.Context, id JobId, input JobCreateParameters, options CreateOperationOptions) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_get.go new file mode 100644 index 000000000000..e1f174ccff0f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_get.go @@ -0,0 +1,80 @@ +package job + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *Job +} + +type GetOperationOptions struct { + ClientRequestId *string +} + +func DefaultGetOperationOptions() GetOperationOptions { + return GetOperationOptions{} +} + +func (o GetOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o GetOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o GetOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// Get ... +func (c JobClient) Get(ctx context.Context, id JobId, options GetOperationOptions) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_getoutput.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_getoutput.go new file mode 100644 index 000000000000..0b0c141ea8c4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_getoutput.go @@ -0,0 +1,80 @@ +package job + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOutputOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *string +} + +type GetOutputOperationOptions struct { + ClientRequestId *string +} + +func DefaultGetOutputOperationOptions() GetOutputOperationOptions { + return GetOutputOperationOptions{} +} + +func (o GetOutputOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o GetOutputOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o GetOutputOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// GetOutput ... +func (c JobClient) GetOutput(ctx context.Context, id JobId, options GetOutputOperationOptions) (result GetOutputOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "text/plain", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/output", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_getrunbookcontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_getrunbookcontent.go new file mode 100644 index 000000000000..f714ca003712 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_getrunbookcontent.go @@ -0,0 +1,80 @@ +package job + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetRunbookContentOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *string +} + +type GetRunbookContentOperationOptions struct { + ClientRequestId *string +} + +func DefaultGetRunbookContentOperationOptions() GetRunbookContentOperationOptions { + return GetRunbookContentOperationOptions{} +} + +func (o GetRunbookContentOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o GetRunbookContentOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o GetRunbookContentOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// GetRunbookContent ... +func (c JobClient) GetRunbookContent(ctx context.Context, id JobId, options GetRunbookContentOperationOptions) (result GetRunbookContentOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "text/powershell", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/runbookContent", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_listbyautomationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_listbyautomationaccount.go new file mode 100644 index 000000000000..5183f42b29ce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_listbyautomationaccount.go @@ -0,0 +1,120 @@ +package job + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByAutomationAccountOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]JobCollectionItem +} + +type ListByAutomationAccountCompleteResult struct { + Items []JobCollectionItem +} + +type ListByAutomationAccountOperationOptions struct { + ClientRequestId *string + Filter *string +} + +func DefaultListByAutomationAccountOperationOptions() ListByAutomationAccountOperationOptions { + return ListByAutomationAccountOperationOptions{} +} + +func (o ListByAutomationAccountOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o ListByAutomationAccountOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListByAutomationAccountOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + return &out +} + +// ListByAutomationAccount ... +func (c JobClient) ListByAutomationAccount(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions) (result ListByAutomationAccountOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/jobs", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]JobCollectionItem `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByAutomationAccountComplete retrieves all the results into a single object +func (c JobClient) ListByAutomationAccountComplete(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions) (ListByAutomationAccountCompleteResult, error) { + return c.ListByAutomationAccountCompleteMatchingPredicate(ctx, id, options, JobCollectionItemOperationPredicate{}) +} + +// ListByAutomationAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c JobClient) ListByAutomationAccountCompleteMatchingPredicate(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions, predicate JobCollectionItemOperationPredicate) (result ListByAutomationAccountCompleteResult, err error) { + items := make([]JobCollectionItem, 0) + + resp, err := c.ListByAutomationAccount(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByAutomationAccountCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_resume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_resume.go new file mode 100644 index 000000000000..7dfd7fcfc04c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_resume.go @@ -0,0 +1,75 @@ +package job + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResumeOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +type ResumeOperationOptions struct { + ClientRequestId *string +} + +func DefaultResumeOperationOptions() ResumeOperationOptions { + return ResumeOperationOptions{} +} + +func (o ResumeOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o ResumeOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ResumeOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// Resume ... +func (c JobClient) Resume(ctx context.Context, id JobId, options ResumeOperationOptions) (result ResumeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/resume", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_stop.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_stop.go new file mode 100644 index 000000000000..f92de573246a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_stop.go @@ -0,0 +1,75 @@ +package job + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StopOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +type StopOperationOptions struct { + ClientRequestId *string +} + +func DefaultStopOperationOptions() StopOperationOptions { + return StopOperationOptions{} +} + +func (o StopOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o StopOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o StopOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// Stop ... +func (c JobClient) Stop(ctx context.Context, id JobId, options StopOperationOptions) (result StopOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/stop", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_suspend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_suspend.go new file mode 100644 index 000000000000..cb2010871f9a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/method_suspend.go @@ -0,0 +1,75 @@ +package job + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SuspendOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +type SuspendOperationOptions struct { + ClientRequestId *string +} + +func DefaultSuspendOperationOptions() SuspendOperationOptions { + return SuspendOperationOptions{} +} + +func (o SuspendOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o SuspendOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o SuspendOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// Suspend ... +func (c JobClient) Suspend(ctx context.Context, id JobId, options SuspendOperationOptions) (result SuspendOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/suspend", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_job.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_job.go new file mode 100644 index 000000000000..a0298ecb061b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_job.go @@ -0,0 +1,11 @@ +package job + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Job struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *JobProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcollectionitem.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcollectionitem.go new file mode 100644 index 000000000000..caf5d341d9c4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcollectionitem.go @@ -0,0 +1,11 @@ +package job + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobCollectionItem struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties JobCollectionItemProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcollectionitemproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcollectionitemproperties.go new file mode 100644 index 000000000000..cb50f32fa3b6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcollectionitemproperties.go @@ -0,0 +1,70 @@ +package job + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobCollectionItemProperties struct { + CreationTime *string `json:"creationTime,omitempty"` + EndTime *string `json:"endTime,omitempty"` + JobId *string `json:"jobId,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + RunOn *string `json:"runOn,omitempty"` + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + StartTime *string `json:"startTime,omitempty"` + Status *JobStatus `json:"status,omitempty"` +} + +func (o *JobCollectionItemProperties) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobCollectionItemProperties) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *JobCollectionItemProperties) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobCollectionItemProperties) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *JobCollectionItemProperties) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobCollectionItemProperties) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} + +func (o *JobCollectionItemProperties) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobCollectionItemProperties) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcreateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcreateparameters.go new file mode 100644 index 000000000000..d9de5c235c5b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcreateparameters.go @@ -0,0 +1,8 @@ +package job + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobCreateParameters struct { + Properties JobCreateProperties `json:"properties"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcreateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcreateproperties.go new file mode 100644 index 000000000000..2f3851a06452 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobcreateproperties.go @@ -0,0 +1,10 @@ +package job + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobCreateProperties struct { + Parameters *map[string]string `json:"parameters,omitempty"` + RunOn *string `json:"runOn,omitempty"` + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobproperties.go new file mode 100644 index 000000000000..9b84dd00d067 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_jobproperties.go @@ -0,0 +1,87 @@ +package job + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobProperties struct { + CreationTime *string `json:"creationTime,omitempty"` + EndTime *string `json:"endTime,omitempty"` + Exception *string `json:"exception,omitempty"` + JobId *string `json:"jobId,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + LastStatusModifiedTime *string `json:"lastStatusModifiedTime,omitempty"` + Parameters *map[string]string `json:"parameters,omitempty"` + ProvisioningState *JobProvisioningState `json:"provisioningState,omitempty"` + RunOn *string `json:"runOn,omitempty"` + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + StartTime *string `json:"startTime,omitempty"` + StartedBy *string `json:"startedBy,omitempty"` + Status *JobStatus `json:"status,omitempty"` + StatusDetails *string `json:"statusDetails,omitempty"` +} + +func (o *JobProperties) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobProperties) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *JobProperties) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobProperties) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *JobProperties) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobProperties) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} + +func (o *JobProperties) GetLastStatusModifiedTimeAsTime() (*time.Time, error) { + if o.LastStatusModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastStatusModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobProperties) SetLastStatusModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastStatusModifiedTime = &formatted +} + +func (o *JobProperties) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobProperties) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_runbookassociationproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_runbookassociationproperty.go new file mode 100644 index 000000000000..c2aaa95948fb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/model_runbookassociationproperty.go @@ -0,0 +1,8 @@ +package job + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RunbookAssociationProperty struct { + Name *string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/predicates.go new file mode 100644 index 000000000000..91845f0c1646 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/predicates.go @@ -0,0 +1,27 @@ +package job + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobCollectionItemOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p JobCollectionItemOperationPredicate) Matches(input JobCollectionItem) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/version.go new file mode 100644 index 000000000000..f5196d884fbe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job/version.go @@ -0,0 +1,12 @@ +package job + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/job/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/README.md new file mode 100644 index 000000000000..4076a3ebaf48 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream` Documentation + +The `jobstream` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/jobstream" +``` + + +### Client Initialization + +```go +client := jobstream.NewJobStreamClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `JobStreamClient.Get` + +```go +ctx := context.TODO() +id := jobstream.NewStreamID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobValue", "jobStreamIdValue") + +read, err := client.Get(ctx, id, jobstream.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `JobStreamClient.ListByJob` + +```go +ctx := context.TODO() +id := jobstream.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobValue") + +// alternatively `client.ListByJob(ctx, id, jobstream.DefaultListByJobOperationOptions())` can be used to do batched pagination +items, err := client.ListByJobComplete(ctx, id, jobstream.DefaultListByJobOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/client.go new file mode 100644 index 000000000000..880cfb481130 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/client.go @@ -0,0 +1,26 @@ +package jobstream + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobStreamClient struct { + Client *resourcemanager.Client +} + +func NewJobStreamClientWithBaseURI(sdkApi sdkEnv.Api) (*JobStreamClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "jobstream", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating JobStreamClient: %+v", err) + } + + return &JobStreamClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/constants.go new file mode 100644 index 000000000000..8133acbad2bc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/constants.go @@ -0,0 +1,66 @@ +package jobstream + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobStreamType string + +const ( + JobStreamTypeAny JobStreamType = "Any" + JobStreamTypeDebug JobStreamType = "Debug" + JobStreamTypeError JobStreamType = "Error" + JobStreamTypeOutput JobStreamType = "Output" + JobStreamTypeProgress JobStreamType = "Progress" + JobStreamTypeVerbose JobStreamType = "Verbose" + JobStreamTypeWarning JobStreamType = "Warning" +) + +func PossibleValuesForJobStreamType() []string { + return []string{ + string(JobStreamTypeAny), + string(JobStreamTypeDebug), + string(JobStreamTypeError), + string(JobStreamTypeOutput), + string(JobStreamTypeProgress), + string(JobStreamTypeVerbose), + string(JobStreamTypeWarning), + } +} + +func (s *JobStreamType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseJobStreamType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseJobStreamType(input string) (*JobStreamType, error) { + vals := map[string]JobStreamType{ + "any": JobStreamTypeAny, + "debug": JobStreamTypeDebug, + "error": JobStreamTypeError, + "output": JobStreamTypeOutput, + "progress": JobStreamTypeProgress, + "verbose": JobStreamTypeVerbose, + "warning": JobStreamTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := JobStreamType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/id_job.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/id_job.go new file mode 100644 index 000000000000..0d8282be25cb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/id_job.go @@ -0,0 +1,140 @@ +package jobstream + +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 = JobId{} + +// JobId is a struct representing the Resource ID for a Job +type JobId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + JobName string +} + +// NewJobID returns a new JobId struct +func NewJobID(subscriptionId string, resourceGroupName string, automationAccountName string, jobName string) JobId { + return JobId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + JobName: jobName, + } +} + +// ParseJobID parses 'input' into a JobId +func ParseJobID(input string) (*JobId, error) { + parser := resourceids.NewParserFromResourceIdType(JobId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := JobId{} + + 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) + } + + if id.JobName, ok = parsed.Parsed["jobName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "jobName", *parsed) + } + + return &id, nil +} + +// ParseJobIDInsensitively parses 'input' case-insensitively into a JobId +// note: this method should only be used for API response data and not user input +func ParseJobIDInsensitively(input string) (*JobId, error) { + parser := resourceids.NewParserFromResourceIdType(JobId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := JobId{} + + 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) + } + + if id.JobName, ok = parsed.Parsed["jobName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "jobName", *parsed) + } + + return &id, nil +} + +// ValidateJobID checks that 'input' can be parsed as a Job ID +func ValidateJobID(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 := ParseJobID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Job ID +func (id JobId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/jobs/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.JobName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Job ID +func (id JobId) 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"), + resourceids.StaticSegment("staticJobs", "jobs", "jobs"), + resourceids.UserSpecifiedSegment("jobName", "jobValue"), + } +} + +// String returns a human-readable description of this Job ID +func (id JobId) 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), + fmt.Sprintf("Job Name: %q", id.JobName), + } + return fmt.Sprintf("Job (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/id_stream.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/id_stream.go new file mode 100644 index 000000000000..2cbff7b6794a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/id_stream.go @@ -0,0 +1,153 @@ +package jobstream + +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 = StreamId{} + +// StreamId is a struct representing the Resource ID for a Stream +type StreamId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + JobName string + JobStreamId string +} + +// NewStreamID returns a new StreamId struct +func NewStreamID(subscriptionId string, resourceGroupName string, automationAccountName string, jobName string, jobStreamId string) StreamId { + return StreamId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + JobName: jobName, + JobStreamId: jobStreamId, + } +} + +// ParseStreamID parses 'input' into a StreamId +func ParseStreamID(input string) (*StreamId, error) { + parser := resourceids.NewParserFromResourceIdType(StreamId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := StreamId{} + + 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) + } + + if id.JobName, ok = parsed.Parsed["jobName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "jobName", *parsed) + } + + if id.JobStreamId, ok = parsed.Parsed["jobStreamId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "jobStreamId", *parsed) + } + + return &id, nil +} + +// ParseStreamIDInsensitively parses 'input' case-insensitively into a StreamId +// note: this method should only be used for API response data and not user input +func ParseStreamIDInsensitively(input string) (*StreamId, error) { + parser := resourceids.NewParserFromResourceIdType(StreamId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := StreamId{} + + 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) + } + + if id.JobName, ok = parsed.Parsed["jobName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "jobName", *parsed) + } + + if id.JobStreamId, ok = parsed.Parsed["jobStreamId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "jobStreamId", *parsed) + } + + return &id, nil +} + +// ValidateStreamID checks that 'input' can be parsed as a Stream ID +func ValidateStreamID(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 := ParseStreamID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Stream ID +func (id StreamId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/jobs/%s/streams/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.JobName, id.JobStreamId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Stream ID +func (id StreamId) 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"), + resourceids.StaticSegment("staticJobs", "jobs", "jobs"), + resourceids.UserSpecifiedSegment("jobName", "jobValue"), + resourceids.StaticSegment("staticStreams", "streams", "streams"), + resourceids.UserSpecifiedSegment("jobStreamId", "jobStreamIdValue"), + } +} + +// String returns a human-readable description of this Stream ID +func (id StreamId) 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), + fmt.Sprintf("Job Name: %q", id.JobName), + fmt.Sprintf("Job Stream: %q", id.JobStreamId), + } + return fmt.Sprintf("Stream (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/method_get.go new file mode 100644 index 000000000000..35bddca1bf2c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/method_get.go @@ -0,0 +1,80 @@ +package jobstream + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *JobStream +} + +type GetOperationOptions struct { + ClientRequestId *string +} + +func DefaultGetOperationOptions() GetOperationOptions { + return GetOperationOptions{} +} + +func (o GetOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o GetOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o GetOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// Get ... +func (c JobStreamClient) Get(ctx context.Context, id StreamId, options GetOperationOptions) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/method_listbyjob.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/method_listbyjob.go new file mode 100644 index 000000000000..bbfe53e4c51e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/method_listbyjob.go @@ -0,0 +1,120 @@ +package jobstream + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByJobOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]JobStream +} + +type ListByJobCompleteResult struct { + Items []JobStream +} + +type ListByJobOperationOptions struct { + ClientRequestId *string + Filter *string +} + +func DefaultListByJobOperationOptions() ListByJobOperationOptions { + return ListByJobOperationOptions{} +} + +func (o ListByJobOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o ListByJobOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListByJobOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + return &out +} + +// ListByJob ... +func (c JobStreamClient) ListByJob(ctx context.Context, id JobId, options ListByJobOperationOptions) (result ListByJobOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/streams", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]JobStream `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByJobComplete retrieves all the results into a single object +func (c JobStreamClient) ListByJobComplete(ctx context.Context, id JobId, options ListByJobOperationOptions) (ListByJobCompleteResult, error) { + return c.ListByJobCompleteMatchingPredicate(ctx, id, options, JobStreamOperationPredicate{}) +} + +// ListByJobCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c JobStreamClient) ListByJobCompleteMatchingPredicate(ctx context.Context, id JobId, options ListByJobOperationOptions, predicate JobStreamOperationPredicate) (result ListByJobCompleteResult, err error) { + items := make([]JobStream, 0) + + resp, err := c.ListByJob(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByJobCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/model_jobstream.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/model_jobstream.go new file mode 100644 index 000000000000..e128a620fde3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/model_jobstream.go @@ -0,0 +1,9 @@ +package jobstream + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobStream struct { + Id *string `json:"id,omitempty"` + Properties *JobStreamProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/model_jobstreamproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/model_jobstreamproperties.go new file mode 100644 index 000000000000..d104d8be795e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/model_jobstreamproperties.go @@ -0,0 +1,31 @@ +package jobstream + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobStreamProperties struct { + JobStreamId *string `json:"jobStreamId,omitempty"` + StreamText *string `json:"streamText,omitempty"` + StreamType *JobStreamType `json:"streamType,omitempty"` + Summary *string `json:"summary,omitempty"` + Time *string `json:"time,omitempty"` + Value *map[string]interface{} `json:"value,omitempty"` +} + +func (o *JobStreamProperties) GetTimeAsTime() (*time.Time, error) { + if o.Time == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobStreamProperties) SetTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Time = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/predicates.go new file mode 100644 index 000000000000..2efb3ab546cc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/predicates.go @@ -0,0 +1,17 @@ +package jobstream + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobStreamOperationPredicate struct { + Id *string +} + +func (p JobStreamOperationPredicate) Matches(input JobStream) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/version.go new file mode 100644 index 000000000000..ea312904d46c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/jobstream/version.go @@ -0,0 +1,12 @@ +package jobstream + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/jobstream/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/README.md new file mode 100644 index 000000000000..337dd6c009df --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/README.md @@ -0,0 +1,36 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace` Documentation + +The `linkedworkspace` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/linkedworkspace" +``` + + +### Client Initialization + +```go +client := linkedworkspace.NewLinkedWorkspaceClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `LinkedWorkspaceClient.Get` + +```go +ctx := context.TODO() +id := linkedworkspace.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 +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/client.go new file mode 100644 index 000000000000..265eab060514 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/client.go @@ -0,0 +1,26 @@ +package linkedworkspace + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinkedWorkspaceClient struct { + Client *resourcemanager.Client +} + +func NewLinkedWorkspaceClientWithBaseURI(sdkApi sdkEnv.Api) (*LinkedWorkspaceClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "linkedworkspace", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating LinkedWorkspaceClient: %+v", err) + } + + return &LinkedWorkspaceClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/id_automationaccount.go new file mode 100644 index 000000000000..deddffb8d5a2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/id_automationaccount.go @@ -0,0 +1,127 @@ +package linkedworkspace + +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/2022-08-08/linkedworkspace/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/method_get.go new file mode 100644 index 000000000000..8c6a3c03fb5f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/method_get.go @@ -0,0 +1,52 @@ +package linkedworkspace + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *LinkedWorkspace +} + +// Get ... +func (c LinkedWorkspaceClient) Get(ctx context.Context, id AutomationAccountId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/linkedWorkspace", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/model_linkedworkspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/model_linkedworkspace.go new file mode 100644 index 000000000000..384fb9284bc9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/model_linkedworkspace.go @@ -0,0 +1,8 @@ +package linkedworkspace + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinkedWorkspace struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/version.go new file mode 100644 index 000000000000..b0d3c5e0e5cb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace/version.go @@ -0,0 +1,12 @@ +package linkedworkspace + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/linkedworkspace/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/README.md new file mode 100644 index 000000000000..09f93d0ac71d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/README.md @@ -0,0 +1,36 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys` Documentation + +The `listkeys` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/listkeys" +``` + + +### Client Initialization + +```go +client := listkeys.NewListKeysClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ListKeysClient.KeysListByAutomationAccount` + +```go +ctx := context.TODO() +id := listkeys.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +read, err := client.KeysListByAutomationAccount(ctx, id) +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/2022-08-08/listkeys/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/client.go new file mode 100644 index 000000000000..ae0d6b6f1b97 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/client.go @@ -0,0 +1,26 @@ +package listkeys + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListKeysClient struct { + Client *resourcemanager.Client +} + +func NewListKeysClientWithBaseURI(sdkApi sdkEnv.Api) (*ListKeysClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "listkeys", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ListKeysClient: %+v", err) + } + + return &ListKeysClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/constants.go new file mode 100644 index 000000000000..12ca75406797 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/constants.go @@ -0,0 +1,92 @@ +package listkeys + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutomationKeyName string + +const ( + AutomationKeyNamePrimary AutomationKeyName = "Primary" + AutomationKeyNameSecondary AutomationKeyName = "Secondary" +) + +func PossibleValuesForAutomationKeyName() []string { + return []string{ + string(AutomationKeyNamePrimary), + string(AutomationKeyNameSecondary), + } +} + +func (s *AutomationKeyName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAutomationKeyName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAutomationKeyName(input string) (*AutomationKeyName, error) { + vals := map[string]AutomationKeyName{ + "primary": AutomationKeyNamePrimary, + "secondary": AutomationKeyNameSecondary, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AutomationKeyName(input) + return &out, nil +} + +type AutomationKeyPermissions string + +const ( + AutomationKeyPermissionsFull AutomationKeyPermissions = "Full" + AutomationKeyPermissionsRead AutomationKeyPermissions = "Read" +) + +func PossibleValuesForAutomationKeyPermissions() []string { + return []string{ + string(AutomationKeyPermissionsFull), + string(AutomationKeyPermissionsRead), + } +} + +func (s *AutomationKeyPermissions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAutomationKeyPermissions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAutomationKeyPermissions(input string) (*AutomationKeyPermissions, error) { + vals := map[string]AutomationKeyPermissions{ + "full": AutomationKeyPermissionsFull, + "read": AutomationKeyPermissionsRead, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AutomationKeyPermissions(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/id_automationaccount.go new file mode 100644 index 000000000000..5f70ed146f51 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/id_automationaccount.go @@ -0,0 +1,127 @@ +package listkeys + +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/2022-08-08/listkeys/method_keyslistbyautomationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/method_keyslistbyautomationaccount.go new file mode 100644 index 000000000000..a48d89c7910a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/method_keyslistbyautomationaccount.go @@ -0,0 +1,52 @@ +package listkeys + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeysListByAutomationAccountOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *KeyListResult +} + +// KeysListByAutomationAccount ... +func (c ListKeysClient) KeysListByAutomationAccount(ctx context.Context, id AutomationAccountId) (result KeysListByAutomationAccountOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listKeys", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/model_key.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/model_key.go new file mode 100644 index 000000000000..98ea2120325e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/model_key.go @@ -0,0 +1,10 @@ +package listkeys + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Key struct { + KeyName *AutomationKeyName `json:"KeyName,omitempty"` + Permissions *AutomationKeyPermissions `json:"Permissions,omitempty"` + Value *string `json:"Value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/model_keylistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/model_keylistresult.go new file mode 100644 index 000000000000..de7ff47c2f37 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/model_keylistresult.go @@ -0,0 +1,8 @@ +package listkeys + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyListResult struct { + Keys *[]Key `json:"keys,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/version.go new file mode 100644 index 000000000000..25664a34381f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys/version.go @@ -0,0 +1,12 @@ +package listkeys + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/listkeys/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/README.md new file mode 100644 index 000000000000..4804ae829282 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/README.md @@ -0,0 +1,52 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes` Documentation + +The `objectdatatypes` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/objectdatatypes" +``` + + +### Client Initialization + +```go +client := objectdatatypes.NewObjectDataTypesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ObjectDataTypesClient.ListFieldsByModuleAndType` + +```go +ctx := context.TODO() +id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "moduleValue", "objectDataTypeValue") + +read, err := client.ListFieldsByModuleAndType(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ObjectDataTypesClient.ListFieldsByType` + +```go +ctx := context.TODO() +id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "objectDataTypeValue") + +read, err := client.ListFieldsByType(ctx, id) +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/2022-08-08/objectdatatypes/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/client.go new file mode 100644 index 000000000000..7d8a79e54081 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/client.go @@ -0,0 +1,26 @@ +package objectdatatypes + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ObjectDataTypesClient struct { + Client *resourcemanager.Client +} + +func NewObjectDataTypesClientWithBaseURI(sdkApi sdkEnv.Api) (*ObjectDataTypesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "objectdatatypes", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ObjectDataTypesClient: %+v", err) + } + + return &ObjectDataTypesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype.go new file mode 100644 index 000000000000..f4b6295f3382 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype.go @@ -0,0 +1,153 @@ +package objectdatatypes + +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 = ModuleObjectDataTypeId{} + +// ModuleObjectDataTypeId is a struct representing the Resource ID for a Module Object Data Type +type ModuleObjectDataTypeId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + ModuleName string + ObjectDataTypeName string +} + +// NewModuleObjectDataTypeID returns a new ModuleObjectDataTypeId struct +func NewModuleObjectDataTypeID(subscriptionId string, resourceGroupName string, automationAccountName string, moduleName string, objectDataTypeName string) ModuleObjectDataTypeId { + return ModuleObjectDataTypeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + ModuleName: moduleName, + ObjectDataTypeName: objectDataTypeName, + } +} + +// ParseModuleObjectDataTypeID parses 'input' into a ModuleObjectDataTypeId +func ParseModuleObjectDataTypeID(input string) (*ModuleObjectDataTypeId, error) { + parser := resourceids.NewParserFromResourceIdType(ModuleObjectDataTypeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ModuleObjectDataTypeId{} + + 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) + } + + if id.ModuleName, ok = parsed.Parsed["moduleName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "moduleName", *parsed) + } + + if id.ObjectDataTypeName, ok = parsed.Parsed["objectDataTypeName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "objectDataTypeName", *parsed) + } + + return &id, nil +} + +// ParseModuleObjectDataTypeIDInsensitively parses 'input' case-insensitively into a ModuleObjectDataTypeId +// note: this method should only be used for API response data and not user input +func ParseModuleObjectDataTypeIDInsensitively(input string) (*ModuleObjectDataTypeId, error) { + parser := resourceids.NewParserFromResourceIdType(ModuleObjectDataTypeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ModuleObjectDataTypeId{} + + 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) + } + + if id.ModuleName, ok = parsed.Parsed["moduleName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "moduleName", *parsed) + } + + if id.ObjectDataTypeName, ok = parsed.Parsed["objectDataTypeName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "objectDataTypeName", *parsed) + } + + return &id, nil +} + +// ValidateModuleObjectDataTypeID checks that 'input' can be parsed as a Module Object Data Type ID +func ValidateModuleObjectDataTypeID(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 := ParseModuleObjectDataTypeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Module Object Data Type ID +func (id ModuleObjectDataTypeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/modules/%s/objectDataTypes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.ModuleName, id.ObjectDataTypeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Module Object Data Type ID +func (id ModuleObjectDataTypeId) 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"), + resourceids.StaticSegment("staticModules", "modules", "modules"), + resourceids.UserSpecifiedSegment("moduleName", "moduleValue"), + resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeValue"), + } +} + +// String returns a human-readable description of this Module Object Data Type ID +func (id ModuleObjectDataTypeId) 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), + fmt.Sprintf("Module Name: %q", id.ModuleName), + fmt.Sprintf("Object Data Type Name: %q", id.ObjectDataTypeName), + } + return fmt.Sprintf("Module Object Data Type (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype.go new file mode 100644 index 000000000000..1272d15447b7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype.go @@ -0,0 +1,140 @@ +package objectdatatypes + +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 = ObjectDataTypeId{} + +// ObjectDataTypeId is a struct representing the Resource ID for a Object Data Type +type ObjectDataTypeId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + ObjectDataTypeName string +} + +// NewObjectDataTypeID returns a new ObjectDataTypeId struct +func NewObjectDataTypeID(subscriptionId string, resourceGroupName string, automationAccountName string, objectDataTypeName string) ObjectDataTypeId { + return ObjectDataTypeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + ObjectDataTypeName: objectDataTypeName, + } +} + +// ParseObjectDataTypeID parses 'input' into a ObjectDataTypeId +func ParseObjectDataTypeID(input string) (*ObjectDataTypeId, error) { + parser := resourceids.NewParserFromResourceIdType(ObjectDataTypeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ObjectDataTypeId{} + + 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) + } + + if id.ObjectDataTypeName, ok = parsed.Parsed["objectDataTypeName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "objectDataTypeName", *parsed) + } + + return &id, nil +} + +// ParseObjectDataTypeIDInsensitively parses 'input' case-insensitively into a ObjectDataTypeId +// note: this method should only be used for API response data and not user input +func ParseObjectDataTypeIDInsensitively(input string) (*ObjectDataTypeId, error) { + parser := resourceids.NewParserFromResourceIdType(ObjectDataTypeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ObjectDataTypeId{} + + 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) + } + + if id.ObjectDataTypeName, ok = parsed.Parsed["objectDataTypeName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "objectDataTypeName", *parsed) + } + + return &id, nil +} + +// ValidateObjectDataTypeID checks that 'input' can be parsed as a Object Data Type ID +func ValidateObjectDataTypeID(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 := ParseObjectDataTypeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Object Data Type ID +func (id ObjectDataTypeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/objectDataTypes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.ObjectDataTypeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Object Data Type ID +func (id ObjectDataTypeId) 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"), + resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeValue"), + } +} + +// String returns a human-readable description of this Object Data Type ID +func (id ObjectDataTypeId) 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), + fmt.Sprintf("Object Data Type Name: %q", id.ObjectDataTypeName), + } + return fmt.Sprintf("Object Data Type (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/method_listfieldsbymoduleandtype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/method_listfieldsbymoduleandtype.go new file mode 100644 index 000000000000..d9da56761a1a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/method_listfieldsbymoduleandtype.go @@ -0,0 +1,52 @@ +package objectdatatypes + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListFieldsByModuleAndTypeOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *TypeFieldListResult +} + +// ListFieldsByModuleAndType ... +func (c ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Context, id ModuleObjectDataTypeId) (result ListFieldsByModuleAndTypeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/fields", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/method_listfieldsbytype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/method_listfieldsbytype.go new file mode 100644 index 000000000000..412857b3c9e8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/method_listfieldsbytype.go @@ -0,0 +1,52 @@ +package objectdatatypes + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListFieldsByTypeOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *TypeFieldListResult +} + +// ListFieldsByType ... +func (c ObjectDataTypesClient) ListFieldsByType(ctx context.Context, id ObjectDataTypeId) (result ListFieldsByTypeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/fields", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/model_typefield.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/model_typefield.go new file mode 100644 index 000000000000..676a477228fe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/model_typefield.go @@ -0,0 +1,9 @@ +package objectdatatypes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TypeField struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/model_typefieldlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/model_typefieldlistresult.go new file mode 100644 index 000000000000..b30231c51532 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/model_typefieldlistresult.go @@ -0,0 +1,8 @@ +package objectdatatypes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TypeFieldListResult struct { + Value *[]TypeField `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/version.go new file mode 100644 index 000000000000..b1329b14c9b1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes/version.go @@ -0,0 +1,12 @@ +package objectdatatypes + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/objectdatatypes/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/README.md new file mode 100644 index 000000000000..63751f91b9cb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/README.md @@ -0,0 +1,41 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations` Documentation + +The `operations` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/operations" +``` + + +### Client Initialization + +```go +client := operations.NewOperationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `OperationsClient.ConvertGraphRunbookContent` + +```go +ctx := context.TODO() +id := operations.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +payload := operations.GraphicalRunbookContent{ + // ... +} + + +read, err := client.ConvertGraphRunbookContent(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/2022-08-08/operations/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/client.go new file mode 100644 index 000000000000..304a17c8d483 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/client.go @@ -0,0 +1,26 @@ +package operations + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OperationsClient struct { + Client *resourcemanager.Client +} + +func NewOperationsClientWithBaseURI(sdkApi sdkEnv.Api) (*OperationsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "operations", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating OperationsClient: %+v", err) + } + + return &OperationsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/constants.go new file mode 100644 index 000000000000..189c1209b616 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/constants.go @@ -0,0 +1,51 @@ +package operations + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GraphRunbookType string + +const ( + GraphRunbookTypeGraphPowerShell GraphRunbookType = "GraphPowerShell" + GraphRunbookTypeGraphPowerShellWorkflow GraphRunbookType = "GraphPowerShellWorkflow" +) + +func PossibleValuesForGraphRunbookType() []string { + return []string{ + string(GraphRunbookTypeGraphPowerShell), + string(GraphRunbookTypeGraphPowerShellWorkflow), + } +} + +func (s *GraphRunbookType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGraphRunbookType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGraphRunbookType(input string) (*GraphRunbookType, error) { + vals := map[string]GraphRunbookType{ + "graphpowershell": GraphRunbookTypeGraphPowerShell, + "graphpowershellworkflow": GraphRunbookTypeGraphPowerShellWorkflow, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GraphRunbookType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/id_automationaccount.go new file mode 100644 index 000000000000..8c56596bd3f8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/id_automationaccount.go @@ -0,0 +1,127 @@ +package operations + +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/2022-08-08/operations/method_convertgraphrunbookcontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/method_convertgraphrunbookcontent.go new file mode 100644 index 000000000000..6667e1332dfa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/method_convertgraphrunbookcontent.go @@ -0,0 +1,56 @@ +package operations + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConvertGraphRunbookContentOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *GraphicalRunbookContent +} + +// ConvertGraphRunbookContent ... +func (c OperationsClient) ConvertGraphRunbookContent(ctx context.Context, id AutomationAccountId, input GraphicalRunbookContent) (result ConvertGraphRunbookContentOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/convertGraphRunbookContent", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/model_graphicalrunbookcontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/model_graphicalrunbookcontent.go new file mode 100644 index 000000000000..232ac710473a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/model_graphicalrunbookcontent.go @@ -0,0 +1,9 @@ +package operations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GraphicalRunbookContent struct { + GraphRunbookJson *string `json:"graphRunbookJson,omitempty"` + RawContent *RawGraphicalRunbookContent `json:"rawContent,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/model_rawgraphicalrunbookcontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/model_rawgraphicalrunbookcontent.go new file mode 100644 index 000000000000..c7d067122ec7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/model_rawgraphicalrunbookcontent.go @@ -0,0 +1,10 @@ +package operations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RawGraphicalRunbookContent struct { + RunbookDefinition *string `json:"runbookDefinition,omitempty"` + RunbookType *GraphRunbookType `json:"runbookType,omitempty"` + SchemaVersion *string `json:"schemaVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/version.go new file mode 100644 index 000000000000..1ea8c9953c05 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations/version.go @@ -0,0 +1,12 @@ +package operations + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/operations/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/README.md new file mode 100644 index 000000000000..e25108673270 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/README.md @@ -0,0 +1,111 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package` Documentation + +The `python2package` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/python2package" +``` + + +### Client Initialization + +```go +client := python2package.NewPython2PackageClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `Python2PackageClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "python2PackageValue") + +payload := python2package.PythonPackageCreateParameters{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `Python2PackageClient.Delete` + +```go +ctx := context.TODO() +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "python2PackageValue") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `Python2PackageClient.Get` + +```go +ctx := context.TODO() +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "python2PackageValue") + +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: `Python2PackageClient.ListByAutomationAccount` + +```go +ctx := context.TODO() +id := python2package.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +// alternatively `client.ListByAutomationAccount(ctx, id)` can be used to do batched pagination +items, err := client.ListByAutomationAccountComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `Python2PackageClient.Update` + +```go +ctx := context.TODO() +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "python2PackageValue") + +payload := python2package.PythonPackageUpdateParameters{ + // ... +} + + +read, err := client.Update(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/2022-08-08/python2package/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/client.go new file mode 100644 index 000000000000..d152b292bb45 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/client.go @@ -0,0 +1,26 @@ +package python2package + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Python2PackageClient struct { + Client *resourcemanager.Client +} + +func NewPython2PackageClientWithBaseURI(sdkApi sdkEnv.Api) (*Python2PackageClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "python2package", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating Python2PackageClient: %+v", err) + } + + return &Python2PackageClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/constants.go new file mode 100644 index 000000000000..263cbee66bfc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/constants.go @@ -0,0 +1,93 @@ +package python2package + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ModuleProvisioningState string + +const ( + ModuleProvisioningStateActivitiesStored ModuleProvisioningState = "ActivitiesStored" + ModuleProvisioningStateCancelled ModuleProvisioningState = "Cancelled" + ModuleProvisioningStateConnectionTypeImported ModuleProvisioningState = "ConnectionTypeImported" + ModuleProvisioningStateContentDownloaded ModuleProvisioningState = "ContentDownloaded" + ModuleProvisioningStateContentRetrieved ModuleProvisioningState = "ContentRetrieved" + ModuleProvisioningStateContentStored ModuleProvisioningState = "ContentStored" + ModuleProvisioningStateContentValidated ModuleProvisioningState = "ContentValidated" + ModuleProvisioningStateCreated ModuleProvisioningState = "Created" + ModuleProvisioningStateCreating ModuleProvisioningState = "Creating" + ModuleProvisioningStateFailed ModuleProvisioningState = "Failed" + ModuleProvisioningStateModuleDataStored ModuleProvisioningState = "ModuleDataStored" + ModuleProvisioningStateModuleImportRunbookComplete ModuleProvisioningState = "ModuleImportRunbookComplete" + ModuleProvisioningStateRunningImportModuleRunbook ModuleProvisioningState = "RunningImportModuleRunbook" + ModuleProvisioningStateStartingImportModuleRunbook ModuleProvisioningState = "StartingImportModuleRunbook" + ModuleProvisioningStateSucceeded ModuleProvisioningState = "Succeeded" + ModuleProvisioningStateUpdating ModuleProvisioningState = "Updating" +) + +func PossibleValuesForModuleProvisioningState() []string { + return []string{ + string(ModuleProvisioningStateActivitiesStored), + string(ModuleProvisioningStateCancelled), + string(ModuleProvisioningStateConnectionTypeImported), + string(ModuleProvisioningStateContentDownloaded), + string(ModuleProvisioningStateContentRetrieved), + string(ModuleProvisioningStateContentStored), + string(ModuleProvisioningStateContentValidated), + string(ModuleProvisioningStateCreated), + string(ModuleProvisioningStateCreating), + string(ModuleProvisioningStateFailed), + string(ModuleProvisioningStateModuleDataStored), + string(ModuleProvisioningStateModuleImportRunbookComplete), + string(ModuleProvisioningStateRunningImportModuleRunbook), + string(ModuleProvisioningStateStartingImportModuleRunbook), + string(ModuleProvisioningStateSucceeded), + string(ModuleProvisioningStateUpdating), + } +} + +func (s *ModuleProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseModuleProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseModuleProvisioningState(input string) (*ModuleProvisioningState, error) { + vals := map[string]ModuleProvisioningState{ + "activitiesstored": ModuleProvisioningStateActivitiesStored, + "cancelled": ModuleProvisioningStateCancelled, + "connectiontypeimported": ModuleProvisioningStateConnectionTypeImported, + "contentdownloaded": ModuleProvisioningStateContentDownloaded, + "contentretrieved": ModuleProvisioningStateContentRetrieved, + "contentstored": ModuleProvisioningStateContentStored, + "contentvalidated": ModuleProvisioningStateContentValidated, + "created": ModuleProvisioningStateCreated, + "creating": ModuleProvisioningStateCreating, + "failed": ModuleProvisioningStateFailed, + "moduledatastored": ModuleProvisioningStateModuleDataStored, + "moduleimportrunbookcomplete": ModuleProvisioningStateModuleImportRunbookComplete, + "runningimportmodulerunbook": ModuleProvisioningStateRunningImportModuleRunbook, + "startingimportmodulerunbook": ModuleProvisioningStateStartingImportModuleRunbook, + "succeeded": ModuleProvisioningStateSucceeded, + "updating": ModuleProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ModuleProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/id_automationaccount.go new file mode 100644 index 000000000000..d768add2e385 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/id_automationaccount.go @@ -0,0 +1,127 @@ +package python2package + +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/2022-08-08/python2package/id_python2package.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/id_python2package.go new file mode 100644 index 000000000000..8ed4fe6bda2f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/id_python2package.go @@ -0,0 +1,140 @@ +package python2package + +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 = Python2PackageId{} + +// Python2PackageId is a struct representing the Resource ID for a Python 2 Package +type Python2PackageId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + Python2PackageName string +} + +// NewPython2PackageID returns a new Python2PackageId struct +func NewPython2PackageID(subscriptionId string, resourceGroupName string, automationAccountName string, python2PackageName string) Python2PackageId { + return Python2PackageId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + Python2PackageName: python2PackageName, + } +} + +// ParsePython2PackageID parses 'input' into a Python2PackageId +func ParsePython2PackageID(input string) (*Python2PackageId, error) { + parser := resourceids.NewParserFromResourceIdType(Python2PackageId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := Python2PackageId{} + + 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) + } + + if id.Python2PackageName, ok = parsed.Parsed["python2PackageName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "python2PackageName", *parsed) + } + + return &id, nil +} + +// ParsePython2PackageIDInsensitively parses 'input' case-insensitively into a Python2PackageId +// note: this method should only be used for API response data and not user input +func ParsePython2PackageIDInsensitively(input string) (*Python2PackageId, error) { + parser := resourceids.NewParserFromResourceIdType(Python2PackageId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := Python2PackageId{} + + 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) + } + + if id.Python2PackageName, ok = parsed.Parsed["python2PackageName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "python2PackageName", *parsed) + } + + return &id, nil +} + +// ValidatePython2PackageID checks that 'input' can be parsed as a Python 2 Package ID +func ValidatePython2PackageID(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 := ParsePython2PackageID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Python 2 Package ID +func (id Python2PackageId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/python2Packages/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.Python2PackageName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Python 2 Package ID +func (id Python2PackageId) 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"), + resourceids.StaticSegment("staticPython2Packages", "python2Packages", "python2Packages"), + resourceids.UserSpecifiedSegment("python2PackageName", "python2PackageValue"), + } +} + +// String returns a human-readable description of this Python 2 Package ID +func (id Python2PackageId) 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), + fmt.Sprintf("Python 2 Package Name: %q", id.Python2PackageName), + } + return fmt.Sprintf("Python 2 Package (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_createorupdate.go new file mode 100644 index 000000000000..8a42d5249627 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_createorupdate.go @@ -0,0 +1,56 @@ +package python2package + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Module +} + +// CreateOrUpdate ... +func (c Python2PackageClient) CreateOrUpdate(ctx context.Context, id Python2PackageId, input PythonPackageCreateParameters) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_delete.go new file mode 100644 index 000000000000..13fe1a293ad5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_delete.go @@ -0,0 +1,46 @@ +package python2package + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c Python2PackageClient) Delete(ctx context.Context, id Python2PackageId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_get.go new file mode 100644 index 000000000000..940f3b4cef09 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_get.go @@ -0,0 +1,51 @@ +package python2package + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *Module +} + +// Get ... +func (c Python2PackageClient) Get(ctx context.Context, id Python2PackageId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_listbyautomationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_listbyautomationaccount.go new file mode 100644 index 000000000000..fabce99317a4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_listbyautomationaccount.go @@ -0,0 +1,89 @@ +package python2package + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByAutomationAccountOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Module +} + +type ListByAutomationAccountCompleteResult struct { + Items []Module +} + +// ListByAutomationAccount ... +func (c Python2PackageClient) ListByAutomationAccount(ctx context.Context, id AutomationAccountId) (result ListByAutomationAccountOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/python2Packages", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Module `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByAutomationAccountComplete retrieves all the results into a single object +func (c Python2PackageClient) ListByAutomationAccountComplete(ctx context.Context, id AutomationAccountId) (ListByAutomationAccountCompleteResult, error) { + return c.ListByAutomationAccountCompleteMatchingPredicate(ctx, id, ModuleOperationPredicate{}) +} + +// ListByAutomationAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c Python2PackageClient) ListByAutomationAccountCompleteMatchingPredicate(ctx context.Context, id AutomationAccountId, predicate ModuleOperationPredicate) (result ListByAutomationAccountCompleteResult, err error) { + items := make([]Module, 0) + + resp, err := c.ListByAutomationAccount(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByAutomationAccountCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_update.go new file mode 100644 index 000000000000..2feef3fe0be4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/method_update.go @@ -0,0 +1,55 @@ +package python2package + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Module +} + +// Update ... +func (c Python2PackageClient) Update(ctx context.Context, id Python2PackageId, input PythonPackageUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_contenthash.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_contenthash.go new file mode 100644 index 000000000000..423e65a56e19 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_contenthash.go @@ -0,0 +1,9 @@ +package python2package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ContentHash struct { + Algorithm string `json:"algorithm"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_contentlink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_contentlink.go new file mode 100644 index 000000000000..b1eeef1506b6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_contentlink.go @@ -0,0 +1,10 @@ +package python2package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ContentLink struct { + ContentHash *ContentHash `json:"contentHash,omitempty"` + Uri *string `json:"uri,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_module.go similarity index 82% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbook.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_module.go index 151256c8e879..0c2b09246c6f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbook.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_module.go @@ -1,14 +1,14 @@ -package runbook +package python2package // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type Runbook struct { +type Module struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Location *string `json:"location,omitempty"` Name *string `json:"name,omitempty"` - Properties *RunbookProperties `json:"properties,omitempty"` + Properties *ModuleProperties `json:"properties,omitempty"` Tags *map[string]string `json:"tags,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_moduleerrorinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_moduleerrorinfo.go new file mode 100644 index 000000000000..02e9be3bf513 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_moduleerrorinfo.go @@ -0,0 +1,9 @@ +package python2package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ModuleErrorInfo struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_moduleproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_moduleproperties.go new file mode 100644 index 000000000000..a8ff72eb52d6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_moduleproperties.go @@ -0,0 +1,48 @@ +package python2package + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ModuleProperties struct { + ActivityCount *int64 `json:"activityCount,omitempty"` + ContentLink *ContentLink `json:"contentLink,omitempty"` + CreationTime *string `json:"creationTime,omitempty"` + Description *string `json:"description,omitempty"` + Error *ModuleErrorInfo `json:"error,omitempty"` + IsComposite *bool `json:"isComposite,omitempty"` + IsGlobal *bool `json:"isGlobal,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ProvisioningState *ModuleProvisioningState `json:"provisioningState,omitempty"` + SizeInBytes *int64 `json:"sizeInBytes,omitempty"` + Version *string `json:"version,omitempty"` +} + +func (o *ModuleProperties) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *ModuleProperties) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *ModuleProperties) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *ModuleProperties) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_pythonpackagecreateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_pythonpackagecreateparameters.go new file mode 100644 index 000000000000..e836b779a480 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_pythonpackagecreateparameters.go @@ -0,0 +1,9 @@ +package python2package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PythonPackageCreateParameters struct { + Properties PythonPackageCreateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_pythonpackagecreateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_pythonpackagecreateproperties.go new file mode 100644 index 000000000000..4fbaaf3bec2a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_pythonpackagecreateproperties.go @@ -0,0 +1,8 @@ +package python2package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PythonPackageCreateProperties struct { + ContentLink ContentLink `json:"contentLink"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_pythonpackageupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_pythonpackageupdateparameters.go new file mode 100644 index 000000000000..c4d5332b4b61 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/model_pythonpackageupdateparameters.go @@ -0,0 +1,8 @@ +package python2package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PythonPackageUpdateParameters struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/predicates.go similarity index 85% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/predicates.go index cc576c7b42f0..12dda736df24 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/predicates.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/predicates.go @@ -1,9 +1,9 @@ -package runbook +package python2package // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type RunbookOperationPredicate struct { +type ModuleOperationPredicate struct { Etag *string Id *string Location *string @@ -11,7 +11,7 @@ type RunbookOperationPredicate struct { Type *string } -func (p RunbookOperationPredicate) Matches(input Runbook) bool { +func (p ModuleOperationPredicate) Matches(input Module) bool { if p.Etag != nil && (input.Etag == nil || *p.Etag != *input.Etag) { return false diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/version.go new file mode 100644 index 000000000000..b152ed6c4aba --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package/version.go @@ -0,0 +1,12 @@ +package python2package + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/python2package/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/README.md new file mode 100644 index 000000000000..34e5385a25e3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/README.md @@ -0,0 +1,111 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package` Documentation + +The `python3package` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/python3package" +``` + + +### Client Initialization + +```go +client := python3package.NewPython3PackageClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `Python3PackageClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "python3PackageValue") + +payload := python3package.PythonPackageCreateParameters{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `Python3PackageClient.Delete` + +```go +ctx := context.TODO() +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "python3PackageValue") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `Python3PackageClient.Get` + +```go +ctx := context.TODO() +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "python3PackageValue") + +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: `Python3PackageClient.ListByAutomationAccount` + +```go +ctx := context.TODO() +id := python3package.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +// alternatively `client.ListByAutomationAccount(ctx, id)` can be used to do batched pagination +items, err := client.ListByAutomationAccountComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `Python3PackageClient.Update` + +```go +ctx := context.TODO() +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "python3PackageValue") + +payload := python3package.PythonPackageUpdateParameters{ + // ... +} + + +read, err := client.Update(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/2022-08-08/python3package/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/client.go new file mode 100644 index 000000000000..e65813a98ad0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/client.go @@ -0,0 +1,26 @@ +package python3package + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Python3PackageClient struct { + Client *resourcemanager.Client +} + +func NewPython3PackageClientWithBaseURI(sdkApi sdkEnv.Api) (*Python3PackageClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "python3package", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating Python3PackageClient: %+v", err) + } + + return &Python3PackageClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/constants.go new file mode 100644 index 000000000000..9569b81b7464 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/constants.go @@ -0,0 +1,93 @@ +package python3package + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ModuleProvisioningState string + +const ( + ModuleProvisioningStateActivitiesStored ModuleProvisioningState = "ActivitiesStored" + ModuleProvisioningStateCancelled ModuleProvisioningState = "Cancelled" + ModuleProvisioningStateConnectionTypeImported ModuleProvisioningState = "ConnectionTypeImported" + ModuleProvisioningStateContentDownloaded ModuleProvisioningState = "ContentDownloaded" + ModuleProvisioningStateContentRetrieved ModuleProvisioningState = "ContentRetrieved" + ModuleProvisioningStateContentStored ModuleProvisioningState = "ContentStored" + ModuleProvisioningStateContentValidated ModuleProvisioningState = "ContentValidated" + ModuleProvisioningStateCreated ModuleProvisioningState = "Created" + ModuleProvisioningStateCreating ModuleProvisioningState = "Creating" + ModuleProvisioningStateFailed ModuleProvisioningState = "Failed" + ModuleProvisioningStateModuleDataStored ModuleProvisioningState = "ModuleDataStored" + ModuleProvisioningStateModuleImportRunbookComplete ModuleProvisioningState = "ModuleImportRunbookComplete" + ModuleProvisioningStateRunningImportModuleRunbook ModuleProvisioningState = "RunningImportModuleRunbook" + ModuleProvisioningStateStartingImportModuleRunbook ModuleProvisioningState = "StartingImportModuleRunbook" + ModuleProvisioningStateSucceeded ModuleProvisioningState = "Succeeded" + ModuleProvisioningStateUpdating ModuleProvisioningState = "Updating" +) + +func PossibleValuesForModuleProvisioningState() []string { + return []string{ + string(ModuleProvisioningStateActivitiesStored), + string(ModuleProvisioningStateCancelled), + string(ModuleProvisioningStateConnectionTypeImported), + string(ModuleProvisioningStateContentDownloaded), + string(ModuleProvisioningStateContentRetrieved), + string(ModuleProvisioningStateContentStored), + string(ModuleProvisioningStateContentValidated), + string(ModuleProvisioningStateCreated), + string(ModuleProvisioningStateCreating), + string(ModuleProvisioningStateFailed), + string(ModuleProvisioningStateModuleDataStored), + string(ModuleProvisioningStateModuleImportRunbookComplete), + string(ModuleProvisioningStateRunningImportModuleRunbook), + string(ModuleProvisioningStateStartingImportModuleRunbook), + string(ModuleProvisioningStateSucceeded), + string(ModuleProvisioningStateUpdating), + } +} + +func (s *ModuleProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseModuleProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseModuleProvisioningState(input string) (*ModuleProvisioningState, error) { + vals := map[string]ModuleProvisioningState{ + "activitiesstored": ModuleProvisioningStateActivitiesStored, + "cancelled": ModuleProvisioningStateCancelled, + "connectiontypeimported": ModuleProvisioningStateConnectionTypeImported, + "contentdownloaded": ModuleProvisioningStateContentDownloaded, + "contentretrieved": ModuleProvisioningStateContentRetrieved, + "contentstored": ModuleProvisioningStateContentStored, + "contentvalidated": ModuleProvisioningStateContentValidated, + "created": ModuleProvisioningStateCreated, + "creating": ModuleProvisioningStateCreating, + "failed": ModuleProvisioningStateFailed, + "moduledatastored": ModuleProvisioningStateModuleDataStored, + "moduleimportrunbookcomplete": ModuleProvisioningStateModuleImportRunbookComplete, + "runningimportmodulerunbook": ModuleProvisioningStateRunningImportModuleRunbook, + "startingimportmodulerunbook": ModuleProvisioningStateStartingImportModuleRunbook, + "succeeded": ModuleProvisioningStateSucceeded, + "updating": ModuleProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ModuleProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/id_automationaccount.go new file mode 100644 index 000000000000..f6805805bf70 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/id_automationaccount.go @@ -0,0 +1,127 @@ +package python3package + +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/2022-08-08/python3package/id_python3package.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/id_python3package.go new file mode 100644 index 000000000000..b94e1868e970 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/id_python3package.go @@ -0,0 +1,140 @@ +package python3package + +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 = Python3PackageId{} + +// Python3PackageId is a struct representing the Resource ID for a Python 3 Package +type Python3PackageId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + Python3PackageName string +} + +// NewPython3PackageID returns a new Python3PackageId struct +func NewPython3PackageID(subscriptionId string, resourceGroupName string, automationAccountName string, python3PackageName string) Python3PackageId { + return Python3PackageId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + Python3PackageName: python3PackageName, + } +} + +// ParsePython3PackageID parses 'input' into a Python3PackageId +func ParsePython3PackageID(input string) (*Python3PackageId, error) { + parser := resourceids.NewParserFromResourceIdType(Python3PackageId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := Python3PackageId{} + + 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) + } + + if id.Python3PackageName, ok = parsed.Parsed["python3PackageName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "python3PackageName", *parsed) + } + + return &id, nil +} + +// ParsePython3PackageIDInsensitively parses 'input' case-insensitively into a Python3PackageId +// note: this method should only be used for API response data and not user input +func ParsePython3PackageIDInsensitively(input string) (*Python3PackageId, error) { + parser := resourceids.NewParserFromResourceIdType(Python3PackageId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := Python3PackageId{} + + 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) + } + + if id.Python3PackageName, ok = parsed.Parsed["python3PackageName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "python3PackageName", *parsed) + } + + return &id, nil +} + +// ValidatePython3PackageID checks that 'input' can be parsed as a Python 3 Package ID +func ValidatePython3PackageID(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 := ParsePython3PackageID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Python 3 Package ID +func (id Python3PackageId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/python3Packages/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.Python3PackageName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Python 3 Package ID +func (id Python3PackageId) 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"), + resourceids.StaticSegment("staticPython3Packages", "python3Packages", "python3Packages"), + resourceids.UserSpecifiedSegment("python3PackageName", "python3PackageValue"), + } +} + +// String returns a human-readable description of this Python 3 Package ID +func (id Python3PackageId) 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), + fmt.Sprintf("Python 3 Package Name: %q", id.Python3PackageName), + } + return fmt.Sprintf("Python 3 Package (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_createorupdate.go new file mode 100644 index 000000000000..49082f0bfebc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_createorupdate.go @@ -0,0 +1,56 @@ +package python3package + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Module +} + +// CreateOrUpdate ... +func (c Python3PackageClient) CreateOrUpdate(ctx context.Context, id Python3PackageId, input PythonPackageCreateParameters) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_delete.go new file mode 100644 index 000000000000..b40b6bdda130 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_delete.go @@ -0,0 +1,47 @@ +package python3package + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c Python3PackageClient) Delete(ctx context.Context, id Python3PackageId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_get.go new file mode 100644 index 000000000000..7e4042b358b7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_get.go @@ -0,0 +1,51 @@ +package python3package + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *Module +} + +// Get ... +func (c Python3PackageClient) Get(ctx context.Context, id Python3PackageId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_listbyautomationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_listbyautomationaccount.go new file mode 100644 index 000000000000..3afbe8ec35d8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_listbyautomationaccount.go @@ -0,0 +1,89 @@ +package python3package + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByAutomationAccountOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Module +} + +type ListByAutomationAccountCompleteResult struct { + Items []Module +} + +// ListByAutomationAccount ... +func (c Python3PackageClient) ListByAutomationAccount(ctx context.Context, id AutomationAccountId) (result ListByAutomationAccountOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/python3Packages", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Module `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByAutomationAccountComplete retrieves all the results into a single object +func (c Python3PackageClient) ListByAutomationAccountComplete(ctx context.Context, id AutomationAccountId) (ListByAutomationAccountCompleteResult, error) { + return c.ListByAutomationAccountCompleteMatchingPredicate(ctx, id, ModuleOperationPredicate{}) +} + +// ListByAutomationAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c Python3PackageClient) ListByAutomationAccountCompleteMatchingPredicate(ctx context.Context, id AutomationAccountId, predicate ModuleOperationPredicate) (result ListByAutomationAccountCompleteResult, err error) { + items := make([]Module, 0) + + resp, err := c.ListByAutomationAccount(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByAutomationAccountCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_update.go new file mode 100644 index 000000000000..c2aa43d27a42 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/method_update.go @@ -0,0 +1,55 @@ +package python3package + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Module +} + +// Update ... +func (c Python3PackageClient) Update(ctx context.Context, id Python3PackageId, input PythonPackageUpdateParameters) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_contenthash.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_contenthash.go new file mode 100644 index 000000000000..c7fbe24d2625 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_contenthash.go @@ -0,0 +1,9 @@ +package python3package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ContentHash struct { + Algorithm string `json:"algorithm"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_contentlink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_contentlink.go new file mode 100644 index 000000000000..267929ccf46c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_contentlink.go @@ -0,0 +1,10 @@ +package python3package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ContentLink struct { + ContentHash *ContentHash `json:"contentHash,omitempty"` + Uri *string `json:"uri,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_module.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_module.go new file mode 100644 index 000000000000..e0d651a03477 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_module.go @@ -0,0 +1,14 @@ +package python3package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Module struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ModuleProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_moduleerrorinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_moduleerrorinfo.go new file mode 100644 index 000000000000..5220039a7f2c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_moduleerrorinfo.go @@ -0,0 +1,9 @@ +package python3package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ModuleErrorInfo struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_moduleproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_moduleproperties.go new file mode 100644 index 000000000000..8dfd7275d32f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_moduleproperties.go @@ -0,0 +1,48 @@ +package python3package + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ModuleProperties struct { + ActivityCount *int64 `json:"activityCount,omitempty"` + ContentLink *ContentLink `json:"contentLink,omitempty"` + CreationTime *string `json:"creationTime,omitempty"` + Description *string `json:"description,omitempty"` + Error *ModuleErrorInfo `json:"error,omitempty"` + IsComposite *bool `json:"isComposite,omitempty"` + IsGlobal *bool `json:"isGlobal,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ProvisioningState *ModuleProvisioningState `json:"provisioningState,omitempty"` + SizeInBytes *int64 `json:"sizeInBytes,omitempty"` + Version *string `json:"version,omitempty"` +} + +func (o *ModuleProperties) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *ModuleProperties) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *ModuleProperties) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *ModuleProperties) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_pythonpackagecreateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_pythonpackagecreateparameters.go new file mode 100644 index 000000000000..054c5df7cf28 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_pythonpackagecreateparameters.go @@ -0,0 +1,9 @@ +package python3package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PythonPackageCreateParameters struct { + Properties PythonPackageCreateProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_pythonpackagecreateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_pythonpackagecreateproperties.go new file mode 100644 index 000000000000..1e024412db1d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_pythonpackagecreateproperties.go @@ -0,0 +1,8 @@ +package python3package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PythonPackageCreateProperties struct { + ContentLink ContentLink `json:"contentLink"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_pythonpackageupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_pythonpackageupdateparameters.go new file mode 100644 index 000000000000..035846ff9bfc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/model_pythonpackageupdateparameters.go @@ -0,0 +1,8 @@ +package python3package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PythonPackageUpdateParameters struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/predicates.go new file mode 100644 index 000000000000..1bf023128163 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/predicates.go @@ -0,0 +1,37 @@ +package python3package + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ModuleOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p ModuleOperationPredicate) Matches(input Module) bool { + + if p.Etag != nil && (input.Etag == nil || *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && (input.Location == nil || *p.Location != *input.Location) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/version.go new file mode 100644 index 000000000000..36af2fad991d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package/version.go @@ -0,0 +1,12 @@ +package python3package + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/python3package/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/README.md new file mode 100644 index 000000000000..cda587f38df4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/README.md @@ -0,0 +1,81 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft` Documentation + +The `runbookdraft` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/runbookdraft" +``` + + +### Client Initialization + +```go +client := runbookdraft.NewRunbookDraftClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `RunbookDraftClient.Get` + +```go +ctx := context.TODO() +id := runbookdraft.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") + +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: `RunbookDraftClient.GetContent` + +```go +ctx := context.TODO() +id := runbookdraft.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") + +read, err := client.GetContent(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RunbookDraftClient.ReplaceContent` + +```go +ctx := context.TODO() +id := runbookdraft.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") +var payload []byte + +if err := client.ReplaceContentThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `RunbookDraftClient.UndoEdit` + +```go +ctx := context.TODO() +id := runbookdraft.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") + +read, err := client.UndoEdit(ctx, id) +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/2022-08-08/runbookdraft/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/client.go new file mode 100644 index 000000000000..1a93df24d0c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/client.go @@ -0,0 +1,26 @@ +package runbookdraft + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RunbookDraftClient struct { + Client *resourcemanager.Client +} + +func NewRunbookDraftClientWithBaseURI(sdkApi sdkEnv.Api) (*RunbookDraftClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "runbookdraft", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating RunbookDraftClient: %+v", err) + } + + return &RunbookDraftClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/constants.go new file mode 100644 index 000000000000..7262f8c36698 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/constants.go @@ -0,0 +1,186 @@ +package runbookdraft + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HTTPStatusCode string + +const ( + HTTPStatusCodeAccepted HTTPStatusCode = "Accepted" + HTTPStatusCodeAmbiguous HTTPStatusCode = "Ambiguous" + HTTPStatusCodeBadGateway HTTPStatusCode = "BadGateway" + HTTPStatusCodeBadRequest HTTPStatusCode = "BadRequest" + HTTPStatusCodeConflict HTTPStatusCode = "Conflict" + HTTPStatusCodeContinue HTTPStatusCode = "Continue" + HTTPStatusCodeCreated HTTPStatusCode = "Created" + HTTPStatusCodeExpectationFailed HTTPStatusCode = "ExpectationFailed" + HTTPStatusCodeForbidden HTTPStatusCode = "Forbidden" + HTTPStatusCodeFound HTTPStatusCode = "Found" + HTTPStatusCodeGatewayTimeout HTTPStatusCode = "GatewayTimeout" + HTTPStatusCodeGone HTTPStatusCode = "Gone" + HTTPStatusCodeHTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" + HTTPStatusCodeInternalServerError HTTPStatusCode = "InternalServerError" + HTTPStatusCodeLengthRequired HTTPStatusCode = "LengthRequired" + HTTPStatusCodeMethodNotAllowed HTTPStatusCode = "MethodNotAllowed" + HTTPStatusCodeMoved HTTPStatusCode = "Moved" + HTTPStatusCodeMovedPermanently HTTPStatusCode = "MovedPermanently" + HTTPStatusCodeMultipleChoices HTTPStatusCode = "MultipleChoices" + HTTPStatusCodeNoContent HTTPStatusCode = "NoContent" + HTTPStatusCodeNonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" + HTTPStatusCodeNotAcceptable HTTPStatusCode = "NotAcceptable" + HTTPStatusCodeNotFound HTTPStatusCode = "NotFound" + HTTPStatusCodeNotImplemented HTTPStatusCode = "NotImplemented" + HTTPStatusCodeNotModified HTTPStatusCode = "NotModified" + HTTPStatusCodeOK HTTPStatusCode = "OK" + HTTPStatusCodePartialContent HTTPStatusCode = "PartialContent" + HTTPStatusCodePaymentRequired HTTPStatusCode = "PaymentRequired" + HTTPStatusCodePreconditionFailed HTTPStatusCode = "PreconditionFailed" + HTTPStatusCodeProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" + HTTPStatusCodeRedirect HTTPStatusCode = "Redirect" + HTTPStatusCodeRedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" + HTTPStatusCodeRedirectMethod HTTPStatusCode = "RedirectMethod" + HTTPStatusCodeRequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" + HTTPStatusCodeRequestTimeout HTTPStatusCode = "RequestTimeout" + HTTPStatusCodeRequestUriTooLong HTTPStatusCode = "RequestUriTooLong" + HTTPStatusCodeRequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" + HTTPStatusCodeResetContent HTTPStatusCode = "ResetContent" + HTTPStatusCodeSeeOther HTTPStatusCode = "SeeOther" + HTTPStatusCodeServiceUnavailable HTTPStatusCode = "ServiceUnavailable" + HTTPStatusCodeSwitchingProtocols HTTPStatusCode = "SwitchingProtocols" + HTTPStatusCodeTemporaryRedirect HTTPStatusCode = "TemporaryRedirect" + HTTPStatusCodeUnauthorized HTTPStatusCode = "Unauthorized" + HTTPStatusCodeUnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" + HTTPStatusCodeUnused HTTPStatusCode = "Unused" + HTTPStatusCodeUpgradeRequired HTTPStatusCode = "UpgradeRequired" + HTTPStatusCodeUseProxy HTTPStatusCode = "UseProxy" +) + +func PossibleValuesForHTTPStatusCode() []string { + return []string{ + string(HTTPStatusCodeAccepted), + string(HTTPStatusCodeAmbiguous), + string(HTTPStatusCodeBadGateway), + string(HTTPStatusCodeBadRequest), + string(HTTPStatusCodeConflict), + string(HTTPStatusCodeContinue), + string(HTTPStatusCodeCreated), + string(HTTPStatusCodeExpectationFailed), + string(HTTPStatusCodeForbidden), + string(HTTPStatusCodeFound), + string(HTTPStatusCodeGatewayTimeout), + string(HTTPStatusCodeGone), + string(HTTPStatusCodeHTTPVersionNotSupported), + string(HTTPStatusCodeInternalServerError), + string(HTTPStatusCodeLengthRequired), + string(HTTPStatusCodeMethodNotAllowed), + string(HTTPStatusCodeMoved), + string(HTTPStatusCodeMovedPermanently), + string(HTTPStatusCodeMultipleChoices), + string(HTTPStatusCodeNoContent), + string(HTTPStatusCodeNonAuthoritativeInformation), + string(HTTPStatusCodeNotAcceptable), + string(HTTPStatusCodeNotFound), + string(HTTPStatusCodeNotImplemented), + string(HTTPStatusCodeNotModified), + string(HTTPStatusCodeOK), + string(HTTPStatusCodePartialContent), + string(HTTPStatusCodePaymentRequired), + string(HTTPStatusCodePreconditionFailed), + string(HTTPStatusCodeProxyAuthenticationRequired), + string(HTTPStatusCodeRedirect), + string(HTTPStatusCodeRedirectKeepVerb), + string(HTTPStatusCodeRedirectMethod), + string(HTTPStatusCodeRequestEntityTooLarge), + string(HTTPStatusCodeRequestTimeout), + string(HTTPStatusCodeRequestUriTooLong), + string(HTTPStatusCodeRequestedRangeNotSatisfiable), + string(HTTPStatusCodeResetContent), + string(HTTPStatusCodeSeeOther), + string(HTTPStatusCodeServiceUnavailable), + string(HTTPStatusCodeSwitchingProtocols), + string(HTTPStatusCodeTemporaryRedirect), + string(HTTPStatusCodeUnauthorized), + string(HTTPStatusCodeUnsupportedMediaType), + string(HTTPStatusCodeUnused), + string(HTTPStatusCodeUpgradeRequired), + string(HTTPStatusCodeUseProxy), + } +} + +func (s *HTTPStatusCode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHTTPStatusCode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHTTPStatusCode(input string) (*HTTPStatusCode, error) { + vals := map[string]HTTPStatusCode{ + "accepted": HTTPStatusCodeAccepted, + "ambiguous": HTTPStatusCodeAmbiguous, + "badgateway": HTTPStatusCodeBadGateway, + "badrequest": HTTPStatusCodeBadRequest, + "conflict": HTTPStatusCodeConflict, + "continue": HTTPStatusCodeContinue, + "created": HTTPStatusCodeCreated, + "expectationfailed": HTTPStatusCodeExpectationFailed, + "forbidden": HTTPStatusCodeForbidden, + "found": HTTPStatusCodeFound, + "gatewaytimeout": HTTPStatusCodeGatewayTimeout, + "gone": HTTPStatusCodeGone, + "httpversionnotsupported": HTTPStatusCodeHTTPVersionNotSupported, + "internalservererror": HTTPStatusCodeInternalServerError, + "lengthrequired": HTTPStatusCodeLengthRequired, + "methodnotallowed": HTTPStatusCodeMethodNotAllowed, + "moved": HTTPStatusCodeMoved, + "movedpermanently": HTTPStatusCodeMovedPermanently, + "multiplechoices": HTTPStatusCodeMultipleChoices, + "nocontent": HTTPStatusCodeNoContent, + "nonauthoritativeinformation": HTTPStatusCodeNonAuthoritativeInformation, + "notacceptable": HTTPStatusCodeNotAcceptable, + "notfound": HTTPStatusCodeNotFound, + "notimplemented": HTTPStatusCodeNotImplemented, + "notmodified": HTTPStatusCodeNotModified, + "ok": HTTPStatusCodeOK, + "partialcontent": HTTPStatusCodePartialContent, + "paymentrequired": HTTPStatusCodePaymentRequired, + "preconditionfailed": HTTPStatusCodePreconditionFailed, + "proxyauthenticationrequired": HTTPStatusCodeProxyAuthenticationRequired, + "redirect": HTTPStatusCodeRedirect, + "redirectkeepverb": HTTPStatusCodeRedirectKeepVerb, + "redirectmethod": HTTPStatusCodeRedirectMethod, + "requestentitytoolarge": HTTPStatusCodeRequestEntityTooLarge, + "requesttimeout": HTTPStatusCodeRequestTimeout, + "requesturitoolong": HTTPStatusCodeRequestUriTooLong, + "requestedrangenotsatisfiable": HTTPStatusCodeRequestedRangeNotSatisfiable, + "resetcontent": HTTPStatusCodeResetContent, + "seeother": HTTPStatusCodeSeeOther, + "serviceunavailable": HTTPStatusCodeServiceUnavailable, + "switchingprotocols": HTTPStatusCodeSwitchingProtocols, + "temporaryredirect": HTTPStatusCodeTemporaryRedirect, + "unauthorized": HTTPStatusCodeUnauthorized, + "unsupportedmediatype": HTTPStatusCodeUnsupportedMediaType, + "unused": HTTPStatusCodeUnused, + "upgraderequired": HTTPStatusCodeUpgradeRequired, + "useproxy": HTTPStatusCodeUseProxy, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HTTPStatusCode(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/id_runbook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/id_runbook.go new file mode 100644 index 000000000000..65a6774ab352 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/id_runbook.go @@ -0,0 +1,140 @@ +package runbookdraft + +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 = RunbookId{} + +// RunbookId is a struct representing the Resource ID for a Runbook +type RunbookId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + RunbookName string +} + +// NewRunbookID returns a new RunbookId struct +func NewRunbookID(subscriptionId string, resourceGroupName string, automationAccountName string, runbookName string) RunbookId { + return RunbookId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + RunbookName: runbookName, + } +} + +// ParseRunbookID parses 'input' into a RunbookId +func ParseRunbookID(input string) (*RunbookId, error) { + parser := resourceids.NewParserFromResourceIdType(RunbookId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RunbookId{} + + 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) + } + + if id.RunbookName, ok = parsed.Parsed["runbookName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "runbookName", *parsed) + } + + return &id, nil +} + +// ParseRunbookIDInsensitively parses 'input' case-insensitively into a RunbookId +// note: this method should only be used for API response data and not user input +func ParseRunbookIDInsensitively(input string) (*RunbookId, error) { + parser := resourceids.NewParserFromResourceIdType(RunbookId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RunbookId{} + + 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) + } + + if id.RunbookName, ok = parsed.Parsed["runbookName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "runbookName", *parsed) + } + + return &id, nil +} + +// ValidateRunbookID checks that 'input' can be parsed as a Runbook ID +func ValidateRunbookID(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 := ParseRunbookID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Runbook ID +func (id RunbookId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/runbooks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.RunbookName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Runbook ID +func (id RunbookId) 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"), + resourceids.StaticSegment("staticRunbooks", "runbooks", "runbooks"), + resourceids.UserSpecifiedSegment("runbookName", "runbookValue"), + } +} + +// String returns a human-readable description of this Runbook ID +func (id RunbookId) 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), + fmt.Sprintf("Runbook Name: %q", id.RunbookName), + } + return fmt.Sprintf("Runbook (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_get.go new file mode 100644 index 000000000000..db6ff829c024 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_get.go @@ -0,0 +1,52 @@ +package runbookdraft + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *RunbookDraft +} + +// Get ... +func (c RunbookDraftClient) Get(ctx context.Context, id RunbookId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/draft", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_getcontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_getcontent.go new file mode 100644 index 000000000000..16a0744b86e1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_getcontent.go @@ -0,0 +1,52 @@ +package runbookdraft + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetContentOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]byte +} + +// GetContent ... +func (c RunbookDraftClient) GetContent(ctx context.Context, id RunbookId) (result GetContentOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "text/powershell", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/draft/content", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_replacecontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_replacecontent.go new file mode 100644 index 000000000000..bac3dac2665a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_replacecontent.go @@ -0,0 +1,74 @@ +package runbookdraft + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplaceContentOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ReplaceContent ... +func (c RunbookDraftClient) ReplaceContent(ctx context.Context, id RunbookId, input []byte) (result ReplaceContentOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "text/powershell", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/draft/content", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ReplaceContentThenPoll performs ReplaceContent then polls until it's completed +func (c RunbookDraftClient) ReplaceContentThenPoll(ctx context.Context, id RunbookId, input []byte) error { + result, err := c.ReplaceContent(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ReplaceContent: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ReplaceContent: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_undoedit.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_undoedit.go new file mode 100644 index 000000000000..5441fddf937e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/method_undoedit.go @@ -0,0 +1,52 @@ +package runbookdraft + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UndoEditOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RunbookDraftUndoEditResult +} + +// UndoEdit ... +func (c RunbookDraftClient) UndoEdit(ctx context.Context, id RunbookId) (result UndoEditOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/draft/undoEdit", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_contenthash.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_contenthash.go similarity index 92% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_contenthash.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_contenthash.go index 017efc1b0c13..f79f7deb2083 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_contenthash.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_contenthash.go @@ -1,4 +1,4 @@ -package runbook +package runbookdraft // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_contentlink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_contentlink.go similarity index 94% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_contentlink.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_contentlink.go index 2656e468716e..b65930b907f6 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_contentlink.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_contentlink.go @@ -1,4 +1,4 @@ -package runbook +package runbookdraft // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookdraft.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_runbookdraft.go similarity index 98% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookdraft.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_runbookdraft.go index a0686cd6c00d..7ffd4d6610ea 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookdraft.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_runbookdraft.go @@ -1,4 +1,4 @@ -package runbook +package runbookdraft import ( "time" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_runbookdraftundoeditresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_runbookdraftundoeditresult.go new file mode 100644 index 000000000000..9b8bd3204e13 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_runbookdraftundoeditresult.go @@ -0,0 +1,9 @@ +package runbookdraft + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RunbookDraftUndoEditResult struct { + RequestId *string `json:"requestId,omitempty"` + StatusCode *HTTPStatusCode `json:"statusCode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookparameter.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_runbookparameter.go similarity index 94% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookparameter.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_runbookparameter.go index e7dc9b847595..fdbe40c50530 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/model_runbookparameter.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/model_runbookparameter.go @@ -1,4 +1,4 @@ -package runbook +package runbookdraft // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/version.go new file mode 100644 index 000000000000..c71acda3640b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/runbookdraft/version.go @@ -0,0 +1,12 @@ +package runbookdraft + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/runbookdraft/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/README.md new file mode 100644 index 000000000000..1808ced1d6db --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/README.md @@ -0,0 +1,52 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun` Documentation + +The `softwareupdateconfigurationmachinerun` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/softwareupdateconfigurationmachinerun" +``` + + +### Client Initialization + +```go +client := softwareupdateconfigurationmachinerun.NewSoftwareUpdateConfigurationMachineRunClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SoftwareUpdateConfigurationMachineRunClient.SoftwareUpdateConfigurationMachineRunsGetById` + +```go +ctx := context.TODO() +id := softwareupdateconfigurationmachinerun.NewSoftwareUpdateConfigurationMachineRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "softwareUpdateConfigurationMachineRunIdValue") + +read, err := client.SoftwareUpdateConfigurationMachineRunsGetById(ctx, id, softwareupdateconfigurationmachinerun.DefaultSoftwareUpdateConfigurationMachineRunsGetByIdOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SoftwareUpdateConfigurationMachineRunClient.SoftwareUpdateConfigurationMachineRunsList` + +```go +ctx := context.TODO() +id := softwareupdateconfigurationmachinerun.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +read, err := client.SoftwareUpdateConfigurationMachineRunsList(ctx, id, softwareupdateconfigurationmachinerun.DefaultSoftwareUpdateConfigurationMachineRunsListOperationOptions()) +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/2022-08-08/softwareupdateconfigurationmachinerun/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/client.go new file mode 100644 index 000000000000..fd31306b48dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/client.go @@ -0,0 +1,26 @@ +package softwareupdateconfigurationmachinerun + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationMachineRunClient struct { + Client *resourcemanager.Client +} + +func NewSoftwareUpdateConfigurationMachineRunClientWithBaseURI(sdkApi sdkEnv.Api) (*SoftwareUpdateConfigurationMachineRunClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "softwareupdateconfigurationmachinerun", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating SoftwareUpdateConfigurationMachineRunClient: %+v", err) + } + + return &SoftwareUpdateConfigurationMachineRunClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/id_automationaccount.go new file mode 100644 index 000000000000..d1a5f3929b52 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/id_automationaccount.go @@ -0,0 +1,127 @@ +package softwareupdateconfigurationmachinerun + +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/2022-08-08/softwareupdateconfigurationmachinerun/id_softwareupdateconfigurationmachinerun.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/id_softwareupdateconfigurationmachinerun.go new file mode 100644 index 000000000000..514e494e501c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/id_softwareupdateconfigurationmachinerun.go @@ -0,0 +1,140 @@ +package softwareupdateconfigurationmachinerun + +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 = SoftwareUpdateConfigurationMachineRunId{} + +// SoftwareUpdateConfigurationMachineRunId is a struct representing the Resource ID for a Software Update Configuration Machine Run +type SoftwareUpdateConfigurationMachineRunId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + SoftwareUpdateConfigurationMachineRunId string +} + +// NewSoftwareUpdateConfigurationMachineRunID returns a new SoftwareUpdateConfigurationMachineRunId struct +func NewSoftwareUpdateConfigurationMachineRunID(subscriptionId string, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationMachineRunId string) SoftwareUpdateConfigurationMachineRunId { + return SoftwareUpdateConfigurationMachineRunId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + SoftwareUpdateConfigurationMachineRunId: softwareUpdateConfigurationMachineRunId, + } +} + +// ParseSoftwareUpdateConfigurationMachineRunID parses 'input' into a SoftwareUpdateConfigurationMachineRunId +func ParseSoftwareUpdateConfigurationMachineRunID(input string) (*SoftwareUpdateConfigurationMachineRunId, error) { + parser := resourceids.NewParserFromResourceIdType(SoftwareUpdateConfigurationMachineRunId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SoftwareUpdateConfigurationMachineRunId{} + + 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) + } + + if id.SoftwareUpdateConfigurationMachineRunId, ok = parsed.Parsed["softwareUpdateConfigurationMachineRunId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "softwareUpdateConfigurationMachineRunId", *parsed) + } + + return &id, nil +} + +// ParseSoftwareUpdateConfigurationMachineRunIDInsensitively parses 'input' case-insensitively into a SoftwareUpdateConfigurationMachineRunId +// note: this method should only be used for API response data and not user input +func ParseSoftwareUpdateConfigurationMachineRunIDInsensitively(input string) (*SoftwareUpdateConfigurationMachineRunId, error) { + parser := resourceids.NewParserFromResourceIdType(SoftwareUpdateConfigurationMachineRunId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SoftwareUpdateConfigurationMachineRunId{} + + 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) + } + + if id.SoftwareUpdateConfigurationMachineRunId, ok = parsed.Parsed["softwareUpdateConfigurationMachineRunId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "softwareUpdateConfigurationMachineRunId", *parsed) + } + + return &id, nil +} + +// ValidateSoftwareUpdateConfigurationMachineRunID checks that 'input' can be parsed as a Software Update Configuration Machine Run ID +func ValidateSoftwareUpdateConfigurationMachineRunID(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 := ParseSoftwareUpdateConfigurationMachineRunID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Software Update Configuration Machine Run ID +func (id SoftwareUpdateConfigurationMachineRunId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/softwareUpdateConfigurationMachineRuns/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.SoftwareUpdateConfigurationMachineRunId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Software Update Configuration Machine Run ID +func (id SoftwareUpdateConfigurationMachineRunId) 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"), + resourceids.StaticSegment("staticSoftwareUpdateConfigurationMachineRuns", "softwareUpdateConfigurationMachineRuns", "softwareUpdateConfigurationMachineRuns"), + resourceids.UserSpecifiedSegment("softwareUpdateConfigurationMachineRunId", "softwareUpdateConfigurationMachineRunIdValue"), + } +} + +// String returns a human-readable description of this Software Update Configuration Machine Run ID +func (id SoftwareUpdateConfigurationMachineRunId) 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), + fmt.Sprintf("Software Update Configuration Machine Run: %q", id.SoftwareUpdateConfigurationMachineRunId), + } + return fmt.Sprintf("Software Update Configuration Machine Run (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/method_softwareupdateconfigurationmachinerunsgetbyid.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/method_softwareupdateconfigurationmachinerunsgetbyid.go new file mode 100644 index 000000000000..d60def7349cb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/method_softwareupdateconfigurationmachinerunsgetbyid.go @@ -0,0 +1,80 @@ +package softwareupdateconfigurationmachinerun + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationMachineRunsGetByIdOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SoftwareUpdateConfigurationMachineRun +} + +type SoftwareUpdateConfigurationMachineRunsGetByIdOperationOptions struct { + ClientRequestId *string +} + +func DefaultSoftwareUpdateConfigurationMachineRunsGetByIdOperationOptions() SoftwareUpdateConfigurationMachineRunsGetByIdOperationOptions { + return SoftwareUpdateConfigurationMachineRunsGetByIdOperationOptions{} +} + +func (o SoftwareUpdateConfigurationMachineRunsGetByIdOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o SoftwareUpdateConfigurationMachineRunsGetByIdOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o SoftwareUpdateConfigurationMachineRunsGetByIdOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// SoftwareUpdateConfigurationMachineRunsGetById ... +func (c SoftwareUpdateConfigurationMachineRunClient) SoftwareUpdateConfigurationMachineRunsGetById(ctx context.Context, id SoftwareUpdateConfigurationMachineRunId, options SoftwareUpdateConfigurationMachineRunsGetByIdOperationOptions) (result SoftwareUpdateConfigurationMachineRunsGetByIdOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/method_softwareupdateconfigurationmachinerunslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/method_softwareupdateconfigurationmachinerunslist.go new file mode 100644 index 000000000000..83cdac6b458d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/method_softwareupdateconfigurationmachinerunslist.go @@ -0,0 +1,91 @@ +package softwareupdateconfigurationmachinerun + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationMachineRunsListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SoftwareUpdateConfigurationMachineRunListResult +} + +type SoftwareUpdateConfigurationMachineRunsListOperationOptions struct { + ClientRequestId *string + Filter *string + Skip *string + Top *string +} + +func DefaultSoftwareUpdateConfigurationMachineRunsListOperationOptions() SoftwareUpdateConfigurationMachineRunsListOperationOptions { + return SoftwareUpdateConfigurationMachineRunsListOperationOptions{} +} + +func (o SoftwareUpdateConfigurationMachineRunsListOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o SoftwareUpdateConfigurationMachineRunsListOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o SoftwareUpdateConfigurationMachineRunsListOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + if o.Skip != nil { + out.Append("$skip", fmt.Sprintf("%v", *o.Skip)) + } + if o.Top != nil { + out.Append("$top", fmt.Sprintf("%v", *o.Top)) + } + return &out +} + +// SoftwareUpdateConfigurationMachineRunsList ... +func (c SoftwareUpdateConfigurationMachineRunClient) SoftwareUpdateConfigurationMachineRunsList(ctx context.Context, id AutomationAccountId, options SoftwareUpdateConfigurationMachineRunsListOperationOptions) (result SoftwareUpdateConfigurationMachineRunsListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/softwareUpdateConfigurationMachineRuns", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_errorresponse.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_errorresponse.go new file mode 100644 index 000000000000..135b3479d5c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_errorresponse.go @@ -0,0 +1,9 @@ +package softwareupdateconfigurationmachinerun + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ErrorResponse struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_jobnavigation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_jobnavigation.go new file mode 100644 index 000000000000..87af5c814a4c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_jobnavigation.go @@ -0,0 +1,8 @@ +package softwareupdateconfigurationmachinerun + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobNavigation struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_softwareupdateconfigurationmachinerun.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_softwareupdateconfigurationmachinerun.go new file mode 100644 index 000000000000..61aae511beb0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_softwareupdateconfigurationmachinerun.go @@ -0,0 +1,10 @@ +package softwareupdateconfigurationmachinerun + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationMachineRun struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *UpdateConfigurationMachineRunProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_softwareupdateconfigurationmachinerunlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_softwareupdateconfigurationmachinerunlistresult.go new file mode 100644 index 000000000000..f4a909f89c18 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_softwareupdateconfigurationmachinerunlistresult.go @@ -0,0 +1,9 @@ +package softwareupdateconfigurationmachinerun + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationMachineRunListResult struct { + NextLink *string `json:"nextLink,omitempty"` + Value *[]SoftwareUpdateConfigurationMachineRun `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_updateconfigurationmachinerunproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_updateconfigurationmachinerunproperties.go new file mode 100644 index 000000000000..5d1946578bcb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_updateconfigurationmachinerunproperties.go @@ -0,0 +1,77 @@ +package softwareupdateconfigurationmachinerun + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateConfigurationMachineRunProperties struct { + ConfiguredDuration *string `json:"configuredDuration,omitempty"` + CorrelationId *string `json:"correlationId,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + CreationTime *string `json:"creationTime,omitempty"` + EndTime *string `json:"endTime,omitempty"` + Error *ErrorResponse `json:"error,omitempty"` + Job *JobNavigation `json:"job,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + OsType *string `json:"osType,omitempty"` + SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` + SourceComputerId *string `json:"sourceComputerId,omitempty"` + StartTime *string `json:"startTime,omitempty"` + Status *string `json:"status,omitempty"` + TargetComputer *string `json:"targetComputer,omitempty"` + TargetComputerType *string `json:"targetComputerType,omitempty"` +} + +func (o *UpdateConfigurationMachineRunProperties) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpdateConfigurationMachineRunProperties) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *UpdateConfigurationMachineRunProperties) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpdateConfigurationMachineRunProperties) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *UpdateConfigurationMachineRunProperties) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpdateConfigurationMachineRunProperties) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} + +func (o *UpdateConfigurationMachineRunProperties) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpdateConfigurationMachineRunProperties) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_updateconfigurationnavigation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_updateconfigurationnavigation.go new file mode 100644 index 000000000000..37f45f424a63 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/model_updateconfigurationnavigation.go @@ -0,0 +1,8 @@ +package softwareupdateconfigurationmachinerun + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateConfigurationNavigation struct { + Name *string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/version.go new file mode 100644 index 000000000000..6166f44fbb53 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun/version.go @@ -0,0 +1,12 @@ +package softwareupdateconfigurationmachinerun + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/softwareupdateconfigurationmachinerun/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/README.md new file mode 100644 index 000000000000..ebca664570a6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/README.md @@ -0,0 +1,52 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun` Documentation + +The `softwareupdateconfigurationrun` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/softwareupdateconfigurationrun" +``` + + +### Client Initialization + +```go +client := softwareupdateconfigurationrun.NewSoftwareUpdateConfigurationRunClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SoftwareUpdateConfigurationRunClient.SoftwareUpdateConfigurationRunsGetById` + +```go +ctx := context.TODO() +id := softwareupdateconfigurationrun.NewSoftwareUpdateConfigurationRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "softwareUpdateConfigurationRunIdValue") + +read, err := client.SoftwareUpdateConfigurationRunsGetById(ctx, id, softwareupdateconfigurationrun.DefaultSoftwareUpdateConfigurationRunsGetByIdOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SoftwareUpdateConfigurationRunClient.SoftwareUpdateConfigurationRunsList` + +```go +ctx := context.TODO() +id := softwareupdateconfigurationrun.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +read, err := client.SoftwareUpdateConfigurationRunsList(ctx, id, softwareupdateconfigurationrun.DefaultSoftwareUpdateConfigurationRunsListOperationOptions()) +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/2022-08-08/softwareupdateconfigurationrun/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/client.go new file mode 100644 index 000000000000..aa86f6dacdfa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/client.go @@ -0,0 +1,26 @@ +package softwareupdateconfigurationrun + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationRunClient struct { + Client *resourcemanager.Client +} + +func NewSoftwareUpdateConfigurationRunClientWithBaseURI(sdkApi sdkEnv.Api) (*SoftwareUpdateConfigurationRunClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "softwareupdateconfigurationrun", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating SoftwareUpdateConfigurationRunClient: %+v", err) + } + + return &SoftwareUpdateConfigurationRunClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/id_automationaccount.go new file mode 100644 index 000000000000..b3d0b483c659 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/id_automationaccount.go @@ -0,0 +1,127 @@ +package softwareupdateconfigurationrun + +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/2022-08-08/softwareupdateconfigurationrun/id_softwareupdateconfigurationrun.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/id_softwareupdateconfigurationrun.go new file mode 100644 index 000000000000..2fb7b6fd07c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/id_softwareupdateconfigurationrun.go @@ -0,0 +1,140 @@ +package softwareupdateconfigurationrun + +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 = SoftwareUpdateConfigurationRunId{} + +// SoftwareUpdateConfigurationRunId is a struct representing the Resource ID for a Software Update Configuration Run +type SoftwareUpdateConfigurationRunId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + SoftwareUpdateConfigurationRunId string +} + +// NewSoftwareUpdateConfigurationRunID returns a new SoftwareUpdateConfigurationRunId struct +func NewSoftwareUpdateConfigurationRunID(subscriptionId string, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationRunId string) SoftwareUpdateConfigurationRunId { + return SoftwareUpdateConfigurationRunId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + SoftwareUpdateConfigurationRunId: softwareUpdateConfigurationRunId, + } +} + +// ParseSoftwareUpdateConfigurationRunID parses 'input' into a SoftwareUpdateConfigurationRunId +func ParseSoftwareUpdateConfigurationRunID(input string) (*SoftwareUpdateConfigurationRunId, error) { + parser := resourceids.NewParserFromResourceIdType(SoftwareUpdateConfigurationRunId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SoftwareUpdateConfigurationRunId{} + + 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) + } + + if id.SoftwareUpdateConfigurationRunId, ok = parsed.Parsed["softwareUpdateConfigurationRunId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "softwareUpdateConfigurationRunId", *parsed) + } + + return &id, nil +} + +// ParseSoftwareUpdateConfigurationRunIDInsensitively parses 'input' case-insensitively into a SoftwareUpdateConfigurationRunId +// note: this method should only be used for API response data and not user input +func ParseSoftwareUpdateConfigurationRunIDInsensitively(input string) (*SoftwareUpdateConfigurationRunId, error) { + parser := resourceids.NewParserFromResourceIdType(SoftwareUpdateConfigurationRunId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SoftwareUpdateConfigurationRunId{} + + 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) + } + + if id.SoftwareUpdateConfigurationRunId, ok = parsed.Parsed["softwareUpdateConfigurationRunId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "softwareUpdateConfigurationRunId", *parsed) + } + + return &id, nil +} + +// ValidateSoftwareUpdateConfigurationRunID checks that 'input' can be parsed as a Software Update Configuration Run ID +func ValidateSoftwareUpdateConfigurationRunID(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 := ParseSoftwareUpdateConfigurationRunID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Software Update Configuration Run ID +func (id SoftwareUpdateConfigurationRunId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/softwareUpdateConfigurationRuns/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.SoftwareUpdateConfigurationRunId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Software Update Configuration Run ID +func (id SoftwareUpdateConfigurationRunId) 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"), + resourceids.StaticSegment("staticSoftwareUpdateConfigurationRuns", "softwareUpdateConfigurationRuns", "softwareUpdateConfigurationRuns"), + resourceids.UserSpecifiedSegment("softwareUpdateConfigurationRunId", "softwareUpdateConfigurationRunIdValue"), + } +} + +// String returns a human-readable description of this Software Update Configuration Run ID +func (id SoftwareUpdateConfigurationRunId) 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), + fmt.Sprintf("Software Update Configuration Run: %q", id.SoftwareUpdateConfigurationRunId), + } + return fmt.Sprintf("Software Update Configuration Run (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/method_softwareupdateconfigurationrunsgetbyid.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/method_softwareupdateconfigurationrunsgetbyid.go new file mode 100644 index 000000000000..6a354dbe2797 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/method_softwareupdateconfigurationrunsgetbyid.go @@ -0,0 +1,80 @@ +package softwareupdateconfigurationrun + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationRunsGetByIdOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SoftwareUpdateConfigurationRun +} + +type SoftwareUpdateConfigurationRunsGetByIdOperationOptions struct { + ClientRequestId *string +} + +func DefaultSoftwareUpdateConfigurationRunsGetByIdOperationOptions() SoftwareUpdateConfigurationRunsGetByIdOperationOptions { + return SoftwareUpdateConfigurationRunsGetByIdOperationOptions{} +} + +func (o SoftwareUpdateConfigurationRunsGetByIdOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o SoftwareUpdateConfigurationRunsGetByIdOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o SoftwareUpdateConfigurationRunsGetByIdOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// SoftwareUpdateConfigurationRunsGetById ... +func (c SoftwareUpdateConfigurationRunClient) SoftwareUpdateConfigurationRunsGetById(ctx context.Context, id SoftwareUpdateConfigurationRunId, options SoftwareUpdateConfigurationRunsGetByIdOperationOptions) (result SoftwareUpdateConfigurationRunsGetByIdOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/method_softwareupdateconfigurationrunslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/method_softwareupdateconfigurationrunslist.go new file mode 100644 index 000000000000..07e03e04bb21 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/method_softwareupdateconfigurationrunslist.go @@ -0,0 +1,91 @@ +package softwareupdateconfigurationrun + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationRunsListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SoftwareUpdateConfigurationRunListResult +} + +type SoftwareUpdateConfigurationRunsListOperationOptions struct { + ClientRequestId *string + Filter *string + Skip *string + Top *string +} + +func DefaultSoftwareUpdateConfigurationRunsListOperationOptions() SoftwareUpdateConfigurationRunsListOperationOptions { + return SoftwareUpdateConfigurationRunsListOperationOptions{} +} + +func (o SoftwareUpdateConfigurationRunsListOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.ClientRequestId != nil { + out.Append("clientRequestId", fmt.Sprintf("%v", *o.ClientRequestId)) + } + return &out +} + +func (o SoftwareUpdateConfigurationRunsListOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o SoftwareUpdateConfigurationRunsListOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + if o.Skip != nil { + out.Append("$skip", fmt.Sprintf("%v", *o.Skip)) + } + if o.Top != nil { + out.Append("$top", fmt.Sprintf("%v", *o.Top)) + } + return &out +} + +// SoftwareUpdateConfigurationRunsList ... +func (c SoftwareUpdateConfigurationRunClient) SoftwareUpdateConfigurationRunsList(ctx context.Context, id AutomationAccountId, options SoftwareUpdateConfigurationRunsListOperationOptions) (result SoftwareUpdateConfigurationRunsListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/softwareUpdateConfigurationRuns", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationrun.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationrun.go new file mode 100644 index 000000000000..ada9c0e1d6a9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationrun.go @@ -0,0 +1,10 @@ +package softwareupdateconfigurationrun + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationRun struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SoftwareUpdateConfigurationRunProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationrunlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationrunlistresult.go new file mode 100644 index 000000000000..4b165a021a42 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationrunlistresult.go @@ -0,0 +1,9 @@ +package softwareupdateconfigurationrun + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationRunListResult struct { + NextLink *string `json:"nextLink,omitempty"` + Value *[]SoftwareUpdateConfigurationRun `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationrunproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationrunproperties.go new file mode 100644 index 000000000000..84249e069681 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationrunproperties.go @@ -0,0 +1,74 @@ +package softwareupdateconfigurationrun + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationRunProperties struct { + ComputerCount *int64 `json:"computerCount,omitempty"` + ConfiguredDuration *string `json:"configuredDuration,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + CreationTime *string `json:"creationTime,omitempty"` + EndTime *string `json:"endTime,omitempty"` + FailedCount *int64 `json:"failedCount,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + OsType *string `json:"osType,omitempty"` + SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` + StartTime *string `json:"startTime,omitempty"` + Status *string `json:"status,omitempty"` + Tasks *SoftwareUpdateConfigurationRunTasks `json:"tasks,omitempty"` +} + +func (o *SoftwareUpdateConfigurationRunProperties) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SoftwareUpdateConfigurationRunProperties) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *SoftwareUpdateConfigurationRunProperties) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SoftwareUpdateConfigurationRunProperties) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *SoftwareUpdateConfigurationRunProperties) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SoftwareUpdateConfigurationRunProperties) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} + +func (o *SoftwareUpdateConfigurationRunProperties) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SoftwareUpdateConfigurationRunProperties) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationruntaskproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationruntaskproperties.go new file mode 100644 index 000000000000..f7f51c9a6a68 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationruntaskproperties.go @@ -0,0 +1,10 @@ +package softwareupdateconfigurationrun + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationRunTaskProperties struct { + JobId *string `json:"jobId,omitempty"` + Source *string `json:"source,omitempty"` + Status *string `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationruntasks.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationruntasks.go new file mode 100644 index 000000000000..907e4e1904a1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_softwareupdateconfigurationruntasks.go @@ -0,0 +1,9 @@ +package softwareupdateconfigurationrun + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SoftwareUpdateConfigurationRunTasks struct { + PostTask *SoftwareUpdateConfigurationRunTaskProperties `json:"postTask,omitempty"` + PreTask *SoftwareUpdateConfigurationRunTaskProperties `json:"preTask,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_updateconfigurationnavigation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_updateconfigurationnavigation.go new file mode 100644 index 000000000000..61e988e78f29 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/model_updateconfigurationnavigation.go @@ -0,0 +1,8 @@ +package softwareupdateconfigurationrun + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateConfigurationNavigation struct { + Name *string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/version.go new file mode 100644 index 000000000000..612011cc5ddc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun/version.go @@ -0,0 +1,12 @@ +package softwareupdateconfigurationrun + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/softwareupdateconfigurationrun/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/README.md new file mode 100644 index 000000000000..2d42826d5c83 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/README.md @@ -0,0 +1,74 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob` Documentation + +The `sourcecontrolsyncjob` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/sourcecontrolsyncjob" +``` + + +### Client Initialization + +```go +client := sourcecontrolsyncjob.NewSourceControlSyncJobClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SourceControlSyncJobClient.Create` + +```go +ctx := context.TODO() +id := sourcecontrolsyncjob.NewSourceControlSyncJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "sourceControlValue", "sourceControlSyncJobIdValue") + +payload := sourcecontrolsyncjob.SourceControlSyncJobCreateParameters{ + // ... +} + + +read, err := client.Create(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SourceControlSyncJobClient.Get` + +```go +ctx := context.TODO() +id := sourcecontrolsyncjob.NewSourceControlSyncJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "sourceControlValue", "sourceControlSyncJobIdValue") + +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: `SourceControlSyncJobClient.ListByAutomationAccount` + +```go +ctx := context.TODO() +id := sourcecontrolsyncjob.NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "sourceControlValue") + +// alternatively `client.ListByAutomationAccount(ctx, id, sourcecontrolsyncjob.DefaultListByAutomationAccountOperationOptions())` can be used to do batched pagination +items, err := client.ListByAutomationAccountComplete(ctx, id, sourcecontrolsyncjob.DefaultListByAutomationAccountOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/client.go new file mode 100644 index 000000000000..380f8581c8fe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/client.go @@ -0,0 +1,26 @@ +package sourcecontrolsyncjob + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobClient struct { + Client *resourcemanager.Client +} + +func NewSourceControlSyncJobClientWithBaseURI(sdkApi sdkEnv.Api) (*SourceControlSyncJobClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "sourcecontrolsyncjob", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating SourceControlSyncJobClient: %+v", err) + } + + return &SourceControlSyncJobClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/constants.go new file mode 100644 index 000000000000..1adbb0f34448 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/constants.go @@ -0,0 +1,95 @@ +package sourcecontrolsyncjob + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProvisioningState string + +const ( + ProvisioningStateCompleted ProvisioningState = "Completed" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateRunning ProvisioningState = "Running" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCompleted), + string(ProvisioningStateFailed), + string(ProvisioningStateRunning), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "completed": ProvisioningStateCompleted, + "failed": ProvisioningStateFailed, + "running": ProvisioningStateRunning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type SyncType string + +const ( + SyncTypeFullSync SyncType = "FullSync" + SyncTypePartialSync SyncType = "PartialSync" +) + +func PossibleValuesForSyncType() []string { + return []string{ + string(SyncTypeFullSync), + string(SyncTypePartialSync), + } +} + +func (s *SyncType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncType(input string) (*SyncType, error) { + vals := map[string]SyncType{ + "fullsync": SyncTypeFullSync, + "partialsync": SyncTypePartialSync, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/id_sourcecontrol.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/id_sourcecontrol.go new file mode 100644 index 000000000000..62ab03b2ac13 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/id_sourcecontrol.go @@ -0,0 +1,140 @@ +package sourcecontrolsyncjob + +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 = SourceControlId{} + +// SourceControlId is a struct representing the Resource ID for a Source Control +type SourceControlId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + SourceControlName string +} + +// NewSourceControlID returns a new SourceControlId struct +func NewSourceControlID(subscriptionId string, resourceGroupName string, automationAccountName string, sourceControlName string) SourceControlId { + return SourceControlId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + SourceControlName: sourceControlName, + } +} + +// ParseSourceControlID parses 'input' into a SourceControlId +func ParseSourceControlID(input string) (*SourceControlId, error) { + parser := resourceids.NewParserFromResourceIdType(SourceControlId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SourceControlId{} + + 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) + } + + if id.SourceControlName, ok = parsed.Parsed["sourceControlName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlName", *parsed) + } + + return &id, nil +} + +// ParseSourceControlIDInsensitively parses 'input' case-insensitively into a SourceControlId +// note: this method should only be used for API response data and not user input +func ParseSourceControlIDInsensitively(input string) (*SourceControlId, error) { + parser := resourceids.NewParserFromResourceIdType(SourceControlId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SourceControlId{} + + 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) + } + + if id.SourceControlName, ok = parsed.Parsed["sourceControlName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlName", *parsed) + } + + return &id, nil +} + +// ValidateSourceControlID checks that 'input' can be parsed as a Source Control ID +func ValidateSourceControlID(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 := ParseSourceControlID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Source Control ID +func (id SourceControlId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/sourceControls/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.SourceControlName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Source Control ID +func (id SourceControlId) 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"), + resourceids.StaticSegment("staticSourceControls", "sourceControls", "sourceControls"), + resourceids.UserSpecifiedSegment("sourceControlName", "sourceControlValue"), + } +} + +// String returns a human-readable description of this Source Control ID +func (id SourceControlId) 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), + fmt.Sprintf("Source Control Name: %q", id.SourceControlName), + } + return fmt.Sprintf("Source Control (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/id_sourcecontrolsyncjob.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/id_sourcecontrolsyncjob.go new file mode 100644 index 000000000000..3450a4ccc34a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/id_sourcecontrolsyncjob.go @@ -0,0 +1,153 @@ +package sourcecontrolsyncjob + +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 = SourceControlSyncJobId{} + +// SourceControlSyncJobId is a struct representing the Resource ID for a Source Control Sync Job +type SourceControlSyncJobId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + SourceControlName string + SourceControlSyncJobId string +} + +// NewSourceControlSyncJobID returns a new SourceControlSyncJobId struct +func NewSourceControlSyncJobID(subscriptionId string, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobId string) SourceControlSyncJobId { + return SourceControlSyncJobId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + SourceControlName: sourceControlName, + SourceControlSyncJobId: sourceControlSyncJobId, + } +} + +// ParseSourceControlSyncJobID parses 'input' into a SourceControlSyncJobId +func ParseSourceControlSyncJobID(input string) (*SourceControlSyncJobId, error) { + parser := resourceids.NewParserFromResourceIdType(SourceControlSyncJobId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SourceControlSyncJobId{} + + 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) + } + + if id.SourceControlName, ok = parsed.Parsed["sourceControlName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlName", *parsed) + } + + if id.SourceControlSyncJobId, ok = parsed.Parsed["sourceControlSyncJobId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlSyncJobId", *parsed) + } + + return &id, nil +} + +// ParseSourceControlSyncJobIDInsensitively parses 'input' case-insensitively into a SourceControlSyncJobId +// note: this method should only be used for API response data and not user input +func ParseSourceControlSyncJobIDInsensitively(input string) (*SourceControlSyncJobId, error) { + parser := resourceids.NewParserFromResourceIdType(SourceControlSyncJobId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SourceControlSyncJobId{} + + 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) + } + + if id.SourceControlName, ok = parsed.Parsed["sourceControlName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlName", *parsed) + } + + if id.SourceControlSyncJobId, ok = parsed.Parsed["sourceControlSyncJobId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlSyncJobId", *parsed) + } + + return &id, nil +} + +// ValidateSourceControlSyncJobID checks that 'input' can be parsed as a Source Control Sync Job ID +func ValidateSourceControlSyncJobID(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 := ParseSourceControlSyncJobID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Source Control Sync Job ID +func (id SourceControlSyncJobId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/sourceControls/%s/sourceControlSyncJobs/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.SourceControlName, id.SourceControlSyncJobId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Source Control Sync Job ID +func (id SourceControlSyncJobId) 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"), + resourceids.StaticSegment("staticSourceControls", "sourceControls", "sourceControls"), + resourceids.UserSpecifiedSegment("sourceControlName", "sourceControlValue"), + resourceids.StaticSegment("staticSourceControlSyncJobs", "sourceControlSyncJobs", "sourceControlSyncJobs"), + resourceids.UserSpecifiedSegment("sourceControlSyncJobId", "sourceControlSyncJobIdValue"), + } +} + +// String returns a human-readable description of this Source Control Sync Job ID +func (id SourceControlSyncJobId) 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), + fmt.Sprintf("Source Control Name: %q", id.SourceControlName), + fmt.Sprintf("Source Control Sync Job: %q", id.SourceControlSyncJobId), + } + return fmt.Sprintf("Source Control Sync Job (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/method_create.go new file mode 100644 index 000000000000..ce26913515f1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/method_create.go @@ -0,0 +1,55 @@ +package sourcecontrolsyncjob + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SourceControlSyncJob +} + +// Create ... +func (c SourceControlSyncJobClient) Create(ctx context.Context, id SourceControlSyncJobId, input SourceControlSyncJobCreateParameters) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/method_get.go new file mode 100644 index 000000000000..611dcf45ca07 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/method_get.go @@ -0,0 +1,51 @@ +package sourcecontrolsyncjob + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *SourceControlSyncJobById +} + +// Get ... +func (c SourceControlSyncJobClient) Get(ctx context.Context, id SourceControlSyncJobId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/method_listbyautomationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/method_listbyautomationaccount.go new file mode 100644 index 000000000000..e2505ede989d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/method_listbyautomationaccount.go @@ -0,0 +1,117 @@ +package sourcecontrolsyncjob + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByAutomationAccountOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]SourceControlSyncJob +} + +type ListByAutomationAccountCompleteResult struct { + Items []SourceControlSyncJob +} + +type ListByAutomationAccountOperationOptions struct { + Filter *string +} + +func DefaultListByAutomationAccountOperationOptions() ListByAutomationAccountOperationOptions { + return ListByAutomationAccountOperationOptions{} +} + +func (o ListByAutomationAccountOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListByAutomationAccountOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListByAutomationAccountOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + return &out +} + +// ListByAutomationAccount ... +func (c SourceControlSyncJobClient) ListByAutomationAccount(ctx context.Context, id SourceControlId, options ListByAutomationAccountOperationOptions) (result ListByAutomationAccountOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/sourceControlSyncJobs", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]SourceControlSyncJob `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByAutomationAccountComplete retrieves all the results into a single object +func (c SourceControlSyncJobClient) ListByAutomationAccountComplete(ctx context.Context, id SourceControlId, options ListByAutomationAccountOperationOptions) (ListByAutomationAccountCompleteResult, error) { + return c.ListByAutomationAccountCompleteMatchingPredicate(ctx, id, options, SourceControlSyncJobOperationPredicate{}) +} + +// ListByAutomationAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c SourceControlSyncJobClient) ListByAutomationAccountCompleteMatchingPredicate(ctx context.Context, id SourceControlId, options ListByAutomationAccountOperationOptions, predicate SourceControlSyncJobOperationPredicate) (result ListByAutomationAccountCompleteResult, err error) { + items := make([]SourceControlSyncJob, 0) + + resp, err := c.ListByAutomationAccount(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByAutomationAccountCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjob.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjob.go new file mode 100644 index 000000000000..5223c0c3e3ed --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjob.go @@ -0,0 +1,11 @@ +package sourcecontrolsyncjob + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJob struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SourceControlSyncJobProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobbyid.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobbyid.go new file mode 100644 index 000000000000..af8c70b9dc3d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobbyid.go @@ -0,0 +1,9 @@ +package sourcecontrolsyncjob + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobById struct { + Id *string `json:"id,omitempty"` + Properties *SourceControlSyncJobByIdProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobbyidproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobbyidproperties.go new file mode 100644 index 000000000000..f1dc1847fe4c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobbyidproperties.go @@ -0,0 +1,56 @@ +package sourcecontrolsyncjob + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobByIdProperties struct { + CreationTime *string `json:"creationTime,omitempty"` + EndTime *string `json:"endTime,omitempty"` + Exception *string `json:"exception,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceControlSyncJobId *string `json:"sourceControlSyncJobId,omitempty"` + StartTime *string `json:"startTime,omitempty"` + SyncType *SyncType `json:"syncType,omitempty"` +} + +func (o *SourceControlSyncJobByIdProperties) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SourceControlSyncJobByIdProperties) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *SourceControlSyncJobByIdProperties) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SourceControlSyncJobByIdProperties) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *SourceControlSyncJobByIdProperties) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SourceControlSyncJobByIdProperties) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobcreateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobcreateparameters.go new file mode 100644 index 000000000000..db90156aec97 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobcreateparameters.go @@ -0,0 +1,8 @@ +package sourcecontrolsyncjob + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobCreateParameters struct { + Properties SourceControlSyncJobCreateProperties `json:"properties"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobcreateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobcreateproperties.go new file mode 100644 index 000000000000..9072a9ad1ffb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobcreateproperties.go @@ -0,0 +1,8 @@ +package sourcecontrolsyncjob + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobCreateProperties struct { + CommitId string `json:"commitId"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobproperties.go new file mode 100644 index 000000000000..f619374c8b40 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/model_sourcecontrolsyncjobproperties.go @@ -0,0 +1,55 @@ +package sourcecontrolsyncjob + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobProperties struct { + CreationTime *string `json:"creationTime,omitempty"` + EndTime *string `json:"endTime,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceControlSyncJobId *string `json:"sourceControlSyncJobId,omitempty"` + StartTime *string `json:"startTime,omitempty"` + SyncType *SyncType `json:"syncType,omitempty"` +} + +func (o *SourceControlSyncJobProperties) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SourceControlSyncJobProperties) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *SourceControlSyncJobProperties) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SourceControlSyncJobProperties) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *SourceControlSyncJobProperties) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SourceControlSyncJobProperties) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/predicates.go new file mode 100644 index 000000000000..3f9ee7d46ae2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/predicates.go @@ -0,0 +1,27 @@ +package sourcecontrolsyncjob + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p SourceControlSyncJobOperationPredicate) Matches(input SourceControlSyncJob) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/version.go new file mode 100644 index 000000000000..993a1378399a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob/version.go @@ -0,0 +1,12 @@ +package sourcecontrolsyncjob + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/sourcecontrolsyncjob/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/README.md new file mode 100644 index 000000000000..625aa7c230fd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams` Documentation + +The `sourcecontrolsyncjobstreams` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/sourcecontrolsyncjobstreams" +``` + + +### Client Initialization + +```go +client := sourcecontrolsyncjobstreams.NewSourceControlSyncJobStreamsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SourceControlSyncJobStreamsClient.Get` + +```go +ctx := context.TODO() +id := sourcecontrolsyncjobstreams.NewSourceControlSyncJobStreamID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "sourceControlValue", "sourceControlSyncJobIdValue", "streamIdValue") + +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: `SourceControlSyncJobStreamsClient.ListBySyncJob` + +```go +ctx := context.TODO() +id := sourcecontrolsyncjobstreams.NewSourceControlSyncJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "sourceControlValue", "sourceControlSyncJobIdValue") + +// alternatively `client.ListBySyncJob(ctx, id, sourcecontrolsyncjobstreams.DefaultListBySyncJobOperationOptions())` can be used to do batched pagination +items, err := client.ListBySyncJobComplete(ctx, id, sourcecontrolsyncjobstreams.DefaultListBySyncJobOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/client.go new file mode 100644 index 000000000000..4e689c48c4f0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/client.go @@ -0,0 +1,26 @@ +package sourcecontrolsyncjobstreams + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobStreamsClient struct { + Client *resourcemanager.Client +} + +func NewSourceControlSyncJobStreamsClientWithBaseURI(sdkApi sdkEnv.Api) (*SourceControlSyncJobStreamsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "sourcecontrolsyncjobstreams", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating SourceControlSyncJobStreamsClient: %+v", err) + } + + return &SourceControlSyncJobStreamsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/constants.go new file mode 100644 index 000000000000..7a32ddef272e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/constants.go @@ -0,0 +1,51 @@ +package sourcecontrolsyncjobstreams + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StreamType string + +const ( + StreamTypeError StreamType = "Error" + StreamTypeOutput StreamType = "Output" +) + +func PossibleValuesForStreamType() []string { + return []string{ + string(StreamTypeError), + string(StreamTypeOutput), + } +} + +func (s *StreamType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseStreamType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseStreamType(input string) (*StreamType, error) { + vals := map[string]StreamType{ + "error": StreamTypeError, + "output": StreamTypeOutput, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StreamType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/id_sourcecontrolsyncjob.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/id_sourcecontrolsyncjob.go new file mode 100644 index 000000000000..d31cfb976879 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/id_sourcecontrolsyncjob.go @@ -0,0 +1,153 @@ +package sourcecontrolsyncjobstreams + +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 = SourceControlSyncJobId{} + +// SourceControlSyncJobId is a struct representing the Resource ID for a Source Control Sync Job +type SourceControlSyncJobId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + SourceControlName string + SourceControlSyncJobId string +} + +// NewSourceControlSyncJobID returns a new SourceControlSyncJobId struct +func NewSourceControlSyncJobID(subscriptionId string, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobId string) SourceControlSyncJobId { + return SourceControlSyncJobId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + SourceControlName: sourceControlName, + SourceControlSyncJobId: sourceControlSyncJobId, + } +} + +// ParseSourceControlSyncJobID parses 'input' into a SourceControlSyncJobId +func ParseSourceControlSyncJobID(input string) (*SourceControlSyncJobId, error) { + parser := resourceids.NewParserFromResourceIdType(SourceControlSyncJobId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SourceControlSyncJobId{} + + 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) + } + + if id.SourceControlName, ok = parsed.Parsed["sourceControlName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlName", *parsed) + } + + if id.SourceControlSyncJobId, ok = parsed.Parsed["sourceControlSyncJobId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlSyncJobId", *parsed) + } + + return &id, nil +} + +// ParseSourceControlSyncJobIDInsensitively parses 'input' case-insensitively into a SourceControlSyncJobId +// note: this method should only be used for API response data and not user input +func ParseSourceControlSyncJobIDInsensitively(input string) (*SourceControlSyncJobId, error) { + parser := resourceids.NewParserFromResourceIdType(SourceControlSyncJobId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SourceControlSyncJobId{} + + 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) + } + + if id.SourceControlName, ok = parsed.Parsed["sourceControlName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlName", *parsed) + } + + if id.SourceControlSyncJobId, ok = parsed.Parsed["sourceControlSyncJobId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlSyncJobId", *parsed) + } + + return &id, nil +} + +// ValidateSourceControlSyncJobID checks that 'input' can be parsed as a Source Control Sync Job ID +func ValidateSourceControlSyncJobID(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 := ParseSourceControlSyncJobID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Source Control Sync Job ID +func (id SourceControlSyncJobId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/sourceControls/%s/sourceControlSyncJobs/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.SourceControlName, id.SourceControlSyncJobId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Source Control Sync Job ID +func (id SourceControlSyncJobId) 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"), + resourceids.StaticSegment("staticSourceControls", "sourceControls", "sourceControls"), + resourceids.UserSpecifiedSegment("sourceControlName", "sourceControlValue"), + resourceids.StaticSegment("staticSourceControlSyncJobs", "sourceControlSyncJobs", "sourceControlSyncJobs"), + resourceids.UserSpecifiedSegment("sourceControlSyncJobId", "sourceControlSyncJobIdValue"), + } +} + +// String returns a human-readable description of this Source Control Sync Job ID +func (id SourceControlSyncJobId) 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), + fmt.Sprintf("Source Control Name: %q", id.SourceControlName), + fmt.Sprintf("Source Control Sync Job: %q", id.SourceControlSyncJobId), + } + return fmt.Sprintf("Source Control Sync Job (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/id_sourcecontrolsyncjobstream.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/id_sourcecontrolsyncjobstream.go new file mode 100644 index 000000000000..1658914fcd00 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/id_sourcecontrolsyncjobstream.go @@ -0,0 +1,166 @@ +package sourcecontrolsyncjobstreams + +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 = SourceControlSyncJobStreamId{} + +// SourceControlSyncJobStreamId is a struct representing the Resource ID for a Source Control Sync Job Stream +type SourceControlSyncJobStreamId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + SourceControlName string + SourceControlSyncJobId string + StreamId string +} + +// NewSourceControlSyncJobStreamID returns a new SourceControlSyncJobStreamId struct +func NewSourceControlSyncJobStreamID(subscriptionId string, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobId string, streamId string) SourceControlSyncJobStreamId { + return SourceControlSyncJobStreamId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + SourceControlName: sourceControlName, + SourceControlSyncJobId: sourceControlSyncJobId, + StreamId: streamId, + } +} + +// ParseSourceControlSyncJobStreamID parses 'input' into a SourceControlSyncJobStreamId +func ParseSourceControlSyncJobStreamID(input string) (*SourceControlSyncJobStreamId, error) { + parser := resourceids.NewParserFromResourceIdType(SourceControlSyncJobStreamId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SourceControlSyncJobStreamId{} + + 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) + } + + if id.SourceControlName, ok = parsed.Parsed["sourceControlName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlName", *parsed) + } + + if id.SourceControlSyncJobId, ok = parsed.Parsed["sourceControlSyncJobId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlSyncJobId", *parsed) + } + + if id.StreamId, ok = parsed.Parsed["streamId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "streamId", *parsed) + } + + return &id, nil +} + +// ParseSourceControlSyncJobStreamIDInsensitively parses 'input' case-insensitively into a SourceControlSyncJobStreamId +// note: this method should only be used for API response data and not user input +func ParseSourceControlSyncJobStreamIDInsensitively(input string) (*SourceControlSyncJobStreamId, error) { + parser := resourceids.NewParserFromResourceIdType(SourceControlSyncJobStreamId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SourceControlSyncJobStreamId{} + + 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) + } + + if id.SourceControlName, ok = parsed.Parsed["sourceControlName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlName", *parsed) + } + + if id.SourceControlSyncJobId, ok = parsed.Parsed["sourceControlSyncJobId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "sourceControlSyncJobId", *parsed) + } + + if id.StreamId, ok = parsed.Parsed["streamId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "streamId", *parsed) + } + + return &id, nil +} + +// ValidateSourceControlSyncJobStreamID checks that 'input' can be parsed as a Source Control Sync Job Stream ID +func ValidateSourceControlSyncJobStreamID(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 := ParseSourceControlSyncJobStreamID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Source Control Sync Job Stream ID +func (id SourceControlSyncJobStreamId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/sourceControls/%s/sourceControlSyncJobs/%s/streams/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.SourceControlName, id.SourceControlSyncJobId, id.StreamId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Source Control Sync Job Stream ID +func (id SourceControlSyncJobStreamId) 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"), + resourceids.StaticSegment("staticSourceControls", "sourceControls", "sourceControls"), + resourceids.UserSpecifiedSegment("sourceControlName", "sourceControlValue"), + resourceids.StaticSegment("staticSourceControlSyncJobs", "sourceControlSyncJobs", "sourceControlSyncJobs"), + resourceids.UserSpecifiedSegment("sourceControlSyncJobId", "sourceControlSyncJobIdValue"), + resourceids.StaticSegment("staticStreams", "streams", "streams"), + resourceids.UserSpecifiedSegment("streamId", "streamIdValue"), + } +} + +// String returns a human-readable description of this Source Control Sync Job Stream ID +func (id SourceControlSyncJobStreamId) 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), + fmt.Sprintf("Source Control Name: %q", id.SourceControlName), + fmt.Sprintf("Source Control Sync Job: %q", id.SourceControlSyncJobId), + fmt.Sprintf("Stream: %q", id.StreamId), + } + return fmt.Sprintf("Source Control Sync Job Stream (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/method_get.go new file mode 100644 index 000000000000..bde3a3ecbfb0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/method_get.go @@ -0,0 +1,51 @@ +package sourcecontrolsyncjobstreams + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *SourceControlSyncJobStreamById +} + +// Get ... +func (c SourceControlSyncJobStreamsClient) Get(ctx context.Context, id SourceControlSyncJobStreamId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/method_listbysyncjob.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/method_listbysyncjob.go new file mode 100644 index 000000000000..18ed464dd3d9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/method_listbysyncjob.go @@ -0,0 +1,117 @@ +package sourcecontrolsyncjobstreams + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListBySyncJobOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]SourceControlSyncJobStream +} + +type ListBySyncJobCompleteResult struct { + Items []SourceControlSyncJobStream +} + +type ListBySyncJobOperationOptions struct { + Filter *string +} + +func DefaultListBySyncJobOperationOptions() ListBySyncJobOperationOptions { + return ListBySyncJobOperationOptions{} +} + +func (o ListBySyncJobOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListBySyncJobOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListBySyncJobOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + return &out +} + +// ListBySyncJob ... +func (c SourceControlSyncJobStreamsClient) ListBySyncJob(ctx context.Context, id SourceControlSyncJobId, options ListBySyncJobOperationOptions) (result ListBySyncJobOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/streams", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]SourceControlSyncJobStream `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySyncJobComplete retrieves all the results into a single object +func (c SourceControlSyncJobStreamsClient) ListBySyncJobComplete(ctx context.Context, id SourceControlSyncJobId, options ListBySyncJobOperationOptions) (ListBySyncJobCompleteResult, error) { + return c.ListBySyncJobCompleteMatchingPredicate(ctx, id, options, SourceControlSyncJobStreamOperationPredicate{}) +} + +// ListBySyncJobCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c SourceControlSyncJobStreamsClient) ListBySyncJobCompleteMatchingPredicate(ctx context.Context, id SourceControlSyncJobId, options ListBySyncJobOperationOptions, predicate SourceControlSyncJobStreamOperationPredicate) (result ListBySyncJobCompleteResult, err error) { + items := make([]SourceControlSyncJobStream, 0) + + resp, err := c.ListBySyncJob(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListBySyncJobCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstream.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstream.go new file mode 100644 index 000000000000..1125f5a7de1d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstream.go @@ -0,0 +1,9 @@ +package sourcecontrolsyncjobstreams + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobStream struct { + Id *string `json:"id,omitempty"` + Properties *SourceControlSyncJobStreamProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstreambyid.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstreambyid.go new file mode 100644 index 000000000000..48362d113b39 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstreambyid.go @@ -0,0 +1,9 @@ +package sourcecontrolsyncjobstreams + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobStreamById struct { + Id *string `json:"id,omitempty"` + Properties *SourceControlSyncJobStreamByIdProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstreambyidproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstreambyidproperties.go new file mode 100644 index 000000000000..a4b4f95cf7ab --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstreambyidproperties.go @@ -0,0 +1,31 @@ +package sourcecontrolsyncjobstreams + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobStreamByIdProperties struct { + SourceControlSyncJobStreamId *string `json:"sourceControlSyncJobStreamId,omitempty"` + StreamText *string `json:"streamText,omitempty"` + StreamType *StreamType `json:"streamType,omitempty"` + Summary *string `json:"summary,omitempty"` + Time *string `json:"time,omitempty"` + Value *map[string]interface{} `json:"value,omitempty"` +} + +func (o *SourceControlSyncJobStreamByIdProperties) GetTimeAsTime() (*time.Time, error) { + if o.Time == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") +} + +func (o *SourceControlSyncJobStreamByIdProperties) SetTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Time = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstreamproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstreamproperties.go new file mode 100644 index 000000000000..600958f95652 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/model_sourcecontrolsyncjobstreamproperties.go @@ -0,0 +1,29 @@ +package sourcecontrolsyncjobstreams + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobStreamProperties struct { + SourceControlSyncJobStreamId *string `json:"sourceControlSyncJobStreamId,omitempty"` + StreamType *StreamType `json:"streamType,omitempty"` + Summary *string `json:"summary,omitempty"` + Time *string `json:"time,omitempty"` +} + +func (o *SourceControlSyncJobStreamProperties) GetTimeAsTime() (*time.Time, error) { + if o.Time == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") +} + +func (o *SourceControlSyncJobStreamProperties) SetTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Time = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/predicates.go new file mode 100644 index 000000000000..0ec43ded1f9b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/predicates.go @@ -0,0 +1,17 @@ +package sourcecontrolsyncjobstreams + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceControlSyncJobStreamOperationPredicate struct { + Id *string +} + +func (p SourceControlSyncJobStreamOperationPredicate) Matches(input SourceControlSyncJobStream) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/version.go new file mode 100644 index 000000000000..03e1a1d24cff --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams/version.go @@ -0,0 +1,12 @@ +package sourcecontrolsyncjobstreams + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/sourcecontrolsyncjobstreams/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/README.md new file mode 100644 index 000000000000..f0e41fc19dc9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/README.md @@ -0,0 +1,36 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics` Documentation + +The `statistics` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/statistics" +``` + + +### Client Initialization + +```go +client := statistics.NewStatisticsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `StatisticsClient.ListByAutomationAccount` + +```go +ctx := context.TODO() +id := statistics.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +read, err := client.ListByAutomationAccount(ctx, id, statistics.DefaultListByAutomationAccountOperationOptions()) +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/2022-08-08/statistics/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/client.go new file mode 100644 index 000000000000..a7a2c1754acc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/client.go @@ -0,0 +1,26 @@ +package statistics + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StatisticsClient struct { + Client *resourcemanager.Client +} + +func NewStatisticsClientWithBaseURI(sdkApi sdkEnv.Api) (*StatisticsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "statistics", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating StatisticsClient: %+v", err) + } + + return &StatisticsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/id_automationaccount.go new file mode 100644 index 000000000000..acb480c909f3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/id_automationaccount.go @@ -0,0 +1,127 @@ +package statistics + +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/2022-08-08/statistics/method_listbyautomationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/method_listbyautomationaccount.go new file mode 100644 index 000000000000..0639ac24defa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/method_listbyautomationaccount.go @@ -0,0 +1,80 @@ +package statistics + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByAutomationAccountOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StatisticsListResult +} + +type ListByAutomationAccountOperationOptions struct { + Filter *string +} + +func DefaultListByAutomationAccountOperationOptions() ListByAutomationAccountOperationOptions { + return ListByAutomationAccountOperationOptions{} +} + +func (o ListByAutomationAccountOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListByAutomationAccountOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListByAutomationAccountOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + return &out +} + +// ListByAutomationAccount ... +func (c StatisticsClient) ListByAutomationAccount(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions) (result ListByAutomationAccountOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/statistics", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/model_statistics.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/model_statistics.go new file mode 100644 index 000000000000..79c38ec25f1c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/model_statistics.go @@ -0,0 +1,42 @@ +package statistics + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Statistics struct { + CounterProperty *string `json:"counterProperty,omitempty"` + CounterValue *int64 `json:"counterValue,omitempty"` + EndTime *string `json:"endTime,omitempty"` + Id *string `json:"id,omitempty"` + StartTime *string `json:"startTime,omitempty"` +} + +func (o *Statistics) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *Statistics) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *Statistics) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *Statistics) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/model_statisticslistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/model_statisticslistresult.go new file mode 100644 index 000000000000..6a194f453056 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/model_statisticslistresult.go @@ -0,0 +1,8 @@ +package statistics + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StatisticsListResult struct { + Value *[]Statistics `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/version.go new file mode 100644 index 000000000000..2508bf76e436 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics/version.go @@ -0,0 +1,12 @@ +package statistics + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/statistics/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/README.md new file mode 100644 index 000000000000..e6239f204b3d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/README.md @@ -0,0 +1,105 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob` Documentation + +The `testjob` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/testjob" +``` + + +### Client Initialization + +```go +client := testjob.NewTestJobClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `TestJobClient.Create` + +```go +ctx := context.TODO() +id := testjob.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") + +payload := testjob.TestJobCreateParameters{ + // ... +} + + +read, err := client.Create(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `TestJobClient.Get` + +```go +ctx := context.TODO() +id := testjob.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") + +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: `TestJobClient.Resume` + +```go +ctx := context.TODO() +id := testjob.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") + +read, err := client.Resume(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `TestJobClient.Stop` + +```go +ctx := context.TODO() +id := testjob.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") + +read, err := client.Stop(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `TestJobClient.Suspend` + +```go +ctx := context.TODO() +id := testjob.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") + +read, err := client.Suspend(ctx, id) +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/2022-08-08/testjob/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/client.go new file mode 100644 index 000000000000..948c5b62e0b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/client.go @@ -0,0 +1,26 @@ +package testjob + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TestJobClient struct { + Client *resourcemanager.Client +} + +func NewTestJobClientWithBaseURI(sdkApi sdkEnv.Api) (*TestJobClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "testjob", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating TestJobClient: %+v", err) + } + + return &TestJobClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/id_runbook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/id_runbook.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/id_runbook.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/id_runbook.go index 2adace8bd11b..5ea2c22ce962 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/id_runbook.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/id_runbook.go @@ -1,4 +1,4 @@ -package runbook +package testjob import ( "fmt" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_create.go new file mode 100644 index 000000000000..f27072af0b52 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_create.go @@ -0,0 +1,56 @@ +package testjob + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *TestJob +} + +// Create ... +func (c TestJobClient) Create(ctx context.Context, id RunbookId, input TestJobCreateParameters) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/draft/testJob", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_get.go new file mode 100644 index 000000000000..7dc936a7f254 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_get.go @@ -0,0 +1,52 @@ +package testjob + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *TestJob +} + +// Get ... +func (c TestJobClient) Get(ctx context.Context, id RunbookId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/draft/testJob", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_resume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_resume.go new file mode 100644 index 000000000000..ad04f42831e9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_resume.go @@ -0,0 +1,47 @@ +package testjob + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResumeOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Resume ... +func (c TestJobClient) Resume(ctx context.Context, id RunbookId) (result ResumeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/draft/testJob/resume", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_stop.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_stop.go new file mode 100644 index 000000000000..2089e452fe45 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_stop.go @@ -0,0 +1,47 @@ +package testjob + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StopOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Stop ... +func (c TestJobClient) Stop(ctx context.Context, id RunbookId) (result StopOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/draft/testJob/stop", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_suspend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_suspend.go new file mode 100644 index 000000000000..1318f68564ff --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/method_suspend.go @@ -0,0 +1,47 @@ +package testjob + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SuspendOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Suspend ... +func (c TestJobClient) Suspend(ctx context.Context, id RunbookId) (result SuspendOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/draft/testJob/suspend", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/model_testjob.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/model_testjob.go new file mode 100644 index 000000000000..e4b857d7c96d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/model_testjob.go @@ -0,0 +1,84 @@ +package testjob + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TestJob struct { + CreationTime *string `json:"creationTime,omitempty"` + EndTime *string `json:"endTime,omitempty"` + Exception *string `json:"exception,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + LastStatusModifiedTime *string `json:"lastStatusModifiedTime,omitempty"` + LogActivityTrace *int64 `json:"logActivityTrace,omitempty"` + Parameters *map[string]string `json:"parameters,omitempty"` + RunOn *string `json:"runOn,omitempty"` + StartTime *string `json:"startTime,omitempty"` + Status *string `json:"status,omitempty"` + StatusDetails *string `json:"statusDetails,omitempty"` +} + +func (o *TestJob) GetCreationTimeAsTime() (*time.Time, error) { + if o.CreationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *TestJob) SetCreationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTime = &formatted +} + +func (o *TestJob) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *TestJob) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *TestJob) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *TestJob) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} + +func (o *TestJob) GetLastStatusModifiedTimeAsTime() (*time.Time, error) { + if o.LastStatusModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastStatusModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *TestJob) SetLastStatusModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastStatusModifiedTime = &formatted +} + +func (o *TestJob) GetStartTimeAsTime() (*time.Time, error) { + if o.StartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *TestJob) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/model_testjobcreateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/model_testjobcreateparameters.go new file mode 100644 index 000000000000..ce9a0bbd8de8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/model_testjobcreateparameters.go @@ -0,0 +1,9 @@ +package testjob + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TestJobCreateParameters struct { + Parameters *map[string]string `json:"parameters,omitempty"` + RunOn *string `json:"runOn,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/version.go similarity index 64% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/version.go index 21e80754253c..572efa7a81d4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob/version.go @@ -1,12 +1,12 @@ -package runbook +package testjob 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" +const defaultApiVersion = "2022-08-08" func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/runbook/%s", defaultApiVersion) + return fmt.Sprintf("hashicorp/go-azure-sdk/testjob/%s", defaultApiVersion) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/README.md new file mode 100644 index 000000000000..2f2b678577b9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream` Documentation + +The `testjobstream` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/testjobstream" +``` + + +### Client Initialization + +```go +client := testjobstream.NewTestJobStreamClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `TestJobStreamClient.Get` + +```go +ctx := context.TODO() +id := testjobstream.NewTestJobStreamID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue", "jobStreamIdValue") + +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: `TestJobStreamClient.ListByTestJob` + +```go +ctx := context.TODO() +id := testjobstream.NewRunbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "runbookValue") + +// alternatively `client.ListByTestJob(ctx, id, testjobstream.DefaultListByTestJobOperationOptions())` can be used to do batched pagination +items, err := client.ListByTestJobComplete(ctx, id, testjobstream.DefaultListByTestJobOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/client.go new file mode 100644 index 000000000000..b14681e53c29 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/client.go @@ -0,0 +1,26 @@ +package testjobstream + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TestJobStreamClient struct { + Client *resourcemanager.Client +} + +func NewTestJobStreamClientWithBaseURI(sdkApi sdkEnv.Api) (*TestJobStreamClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "testjobstream", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating TestJobStreamClient: %+v", err) + } + + return &TestJobStreamClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/constants.go new file mode 100644 index 000000000000..d2f12e89494c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/constants.go @@ -0,0 +1,66 @@ +package testjobstream + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobStreamType string + +const ( + JobStreamTypeAny JobStreamType = "Any" + JobStreamTypeDebug JobStreamType = "Debug" + JobStreamTypeError JobStreamType = "Error" + JobStreamTypeOutput JobStreamType = "Output" + JobStreamTypeProgress JobStreamType = "Progress" + JobStreamTypeVerbose JobStreamType = "Verbose" + JobStreamTypeWarning JobStreamType = "Warning" +) + +func PossibleValuesForJobStreamType() []string { + return []string{ + string(JobStreamTypeAny), + string(JobStreamTypeDebug), + string(JobStreamTypeError), + string(JobStreamTypeOutput), + string(JobStreamTypeProgress), + string(JobStreamTypeVerbose), + string(JobStreamTypeWarning), + } +} + +func (s *JobStreamType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseJobStreamType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseJobStreamType(input string) (*JobStreamType, error) { + vals := map[string]JobStreamType{ + "any": JobStreamTypeAny, + "debug": JobStreamTypeDebug, + "error": JobStreamTypeError, + "output": JobStreamTypeOutput, + "progress": JobStreamTypeProgress, + "verbose": JobStreamTypeVerbose, + "warning": JobStreamTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := JobStreamType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/id_runbook.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/id_runbook.go new file mode 100644 index 000000000000..b9602d1e0749 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/id_runbook.go @@ -0,0 +1,140 @@ +package testjobstream + +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 = RunbookId{} + +// RunbookId is a struct representing the Resource ID for a Runbook +type RunbookId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + RunbookName string +} + +// NewRunbookID returns a new RunbookId struct +func NewRunbookID(subscriptionId string, resourceGroupName string, automationAccountName string, runbookName string) RunbookId { + return RunbookId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + RunbookName: runbookName, + } +} + +// ParseRunbookID parses 'input' into a RunbookId +func ParseRunbookID(input string) (*RunbookId, error) { + parser := resourceids.NewParserFromResourceIdType(RunbookId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RunbookId{} + + 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) + } + + if id.RunbookName, ok = parsed.Parsed["runbookName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "runbookName", *parsed) + } + + return &id, nil +} + +// ParseRunbookIDInsensitively parses 'input' case-insensitively into a RunbookId +// note: this method should only be used for API response data and not user input +func ParseRunbookIDInsensitively(input string) (*RunbookId, error) { + parser := resourceids.NewParserFromResourceIdType(RunbookId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := RunbookId{} + + 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) + } + + if id.RunbookName, ok = parsed.Parsed["runbookName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "runbookName", *parsed) + } + + return &id, nil +} + +// ValidateRunbookID checks that 'input' can be parsed as a Runbook ID +func ValidateRunbookID(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 := ParseRunbookID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Runbook ID +func (id RunbookId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/runbooks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.RunbookName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Runbook ID +func (id RunbookId) 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"), + resourceids.StaticSegment("staticRunbooks", "runbooks", "runbooks"), + resourceids.UserSpecifiedSegment("runbookName", "runbookValue"), + } +} + +// String returns a human-readable description of this Runbook ID +func (id RunbookId) 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), + fmt.Sprintf("Runbook Name: %q", id.RunbookName), + } + return fmt.Sprintf("Runbook (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/id_testjobstream.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/id_testjobstream.go new file mode 100644 index 000000000000..7cfa557b55b2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/id_testjobstream.go @@ -0,0 +1,155 @@ +package testjobstream + +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 = TestJobStreamId{} + +// TestJobStreamId is a struct representing the Resource ID for a Test Job Stream +type TestJobStreamId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + RunbookName string + JobStreamId string +} + +// NewTestJobStreamID returns a new TestJobStreamId struct +func NewTestJobStreamID(subscriptionId string, resourceGroupName string, automationAccountName string, runbookName string, jobStreamId string) TestJobStreamId { + return TestJobStreamId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + RunbookName: runbookName, + JobStreamId: jobStreamId, + } +} + +// ParseTestJobStreamID parses 'input' into a TestJobStreamId +func ParseTestJobStreamID(input string) (*TestJobStreamId, error) { + parser := resourceids.NewParserFromResourceIdType(TestJobStreamId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TestJobStreamId{} + + 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) + } + + if id.RunbookName, ok = parsed.Parsed["runbookName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "runbookName", *parsed) + } + + if id.JobStreamId, ok = parsed.Parsed["jobStreamId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "jobStreamId", *parsed) + } + + return &id, nil +} + +// ParseTestJobStreamIDInsensitively parses 'input' case-insensitively into a TestJobStreamId +// note: this method should only be used for API response data and not user input +func ParseTestJobStreamIDInsensitively(input string) (*TestJobStreamId, error) { + parser := resourceids.NewParserFromResourceIdType(TestJobStreamId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TestJobStreamId{} + + 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) + } + + if id.RunbookName, ok = parsed.Parsed["runbookName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "runbookName", *parsed) + } + + if id.JobStreamId, ok = parsed.Parsed["jobStreamId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "jobStreamId", *parsed) + } + + return &id, nil +} + +// ValidateTestJobStreamID checks that 'input' can be parsed as a Test Job Stream ID +func ValidateTestJobStreamID(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 := ParseTestJobStreamID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Test Job Stream ID +func (id TestJobStreamId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/runbooks/%s/draft/testJob/streams/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.RunbookName, id.JobStreamId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Test Job Stream ID +func (id TestJobStreamId) 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"), + resourceids.StaticSegment("staticRunbooks", "runbooks", "runbooks"), + resourceids.UserSpecifiedSegment("runbookName", "runbookValue"), + resourceids.StaticSegment("staticDraft", "draft", "draft"), + resourceids.StaticSegment("staticTestJob", "testJob", "testJob"), + resourceids.StaticSegment("staticStreams", "streams", "streams"), + resourceids.UserSpecifiedSegment("jobStreamId", "jobStreamIdValue"), + } +} + +// String returns a human-readable description of this Test Job Stream ID +func (id TestJobStreamId) 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), + fmt.Sprintf("Runbook Name: %q", id.RunbookName), + fmt.Sprintf("Job Stream: %q", id.JobStreamId), + } + return fmt.Sprintf("Test Job Stream (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/method_get.go new file mode 100644 index 000000000000..40f95e3bb194 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/method_get.go @@ -0,0 +1,51 @@ +package testjobstream + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// 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 + OData *odata.OData + Model *JobStream +} + +// Get ... +func (c TestJobStreamClient) Get(ctx context.Context, id TestJobStreamId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/method_listbytestjob.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/method_listbytestjob.go new file mode 100644 index 000000000000..e4996175fdb1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/method_listbytestjob.go @@ -0,0 +1,117 @@ +package testjobstream + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByTestJobOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]JobStream +} + +type ListByTestJobCompleteResult struct { + Items []JobStream +} + +type ListByTestJobOperationOptions struct { + Filter *string +} + +func DefaultListByTestJobOperationOptions() ListByTestJobOperationOptions { + return ListByTestJobOperationOptions{} +} + +func (o ListByTestJobOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListByTestJobOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListByTestJobOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + return &out +} + +// ListByTestJob ... +func (c TestJobStreamClient) ListByTestJob(ctx context.Context, id RunbookId, options ListByTestJobOperationOptions) (result ListByTestJobOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/draft/testJob/streams", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]JobStream `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByTestJobComplete retrieves all the results into a single object +func (c TestJobStreamClient) ListByTestJobComplete(ctx context.Context, id RunbookId, options ListByTestJobOperationOptions) (ListByTestJobCompleteResult, error) { + return c.ListByTestJobCompleteMatchingPredicate(ctx, id, options, JobStreamOperationPredicate{}) +} + +// ListByTestJobCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c TestJobStreamClient) ListByTestJobCompleteMatchingPredicate(ctx context.Context, id RunbookId, options ListByTestJobOperationOptions, predicate JobStreamOperationPredicate) (result ListByTestJobCompleteResult, err error) { + items := make([]JobStream, 0) + + resp, err := c.ListByTestJob(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByTestJobCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/model_jobstream.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/model_jobstream.go new file mode 100644 index 000000000000..010deb74685b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/model_jobstream.go @@ -0,0 +1,9 @@ +package testjobstream + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobStream struct { + Id *string `json:"id,omitempty"` + Properties *JobStreamProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/model_jobstreamproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/model_jobstreamproperties.go new file mode 100644 index 000000000000..2f63c6050f69 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/model_jobstreamproperties.go @@ -0,0 +1,31 @@ +package testjobstream + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobStreamProperties struct { + JobStreamId *string `json:"jobStreamId,omitempty"` + StreamText *string `json:"streamText,omitempty"` + StreamType *JobStreamType `json:"streamType,omitempty"` + Summary *string `json:"summary,omitempty"` + Time *string `json:"time,omitempty"` + Value *map[string]interface{} `json:"value,omitempty"` +} + +func (o *JobStreamProperties) GetTimeAsTime() (*time.Time, error) { + if o.Time == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") +} + +func (o *JobStreamProperties) SetTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Time = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/predicates.go new file mode 100644 index 000000000000..15b9ad787f06 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/predicates.go @@ -0,0 +1,17 @@ +package testjobstream + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JobStreamOperationPredicate struct { + Id *string +} + +func (p JobStreamOperationPredicate) Matches(input JobStream) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/version.go new file mode 100644 index 000000000000..700d65cbcc5a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream/version.go @@ -0,0 +1,12 @@ +package testjobstream + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/testjobstream/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/README.md new file mode 100644 index 000000000000..0c9bb15c9711 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/README.md @@ -0,0 +1,36 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields` Documentation + +The `typefields` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/typefields" +``` + + +### Client Initialization + +```go +client := typefields.NewTypeFieldsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `TypeFieldsClient.FieldsListByType` + +```go +ctx := context.TODO() +id := typefields.NewTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "moduleValue", "typeValue") + +read, err := client.FieldsListByType(ctx, id) +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/2022-08-08/typefields/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/client.go new file mode 100644 index 000000000000..e235fbc854fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/client.go @@ -0,0 +1,26 @@ +package typefields + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TypeFieldsClient struct { + Client *resourcemanager.Client +} + +func NewTypeFieldsClientWithBaseURI(sdkApi sdkEnv.Api) (*TypeFieldsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "typefields", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating TypeFieldsClient: %+v", err) + } + + return &TypeFieldsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/id_type.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/id_type.go new file mode 100644 index 000000000000..494728e37cc9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/id_type.go @@ -0,0 +1,153 @@ +package typefields + +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 = TypeId{} + +// TypeId is a struct representing the Resource ID for a Type +type TypeId struct { + SubscriptionId string + ResourceGroupName string + AutomationAccountName string + ModuleName string + TypeName string +} + +// NewTypeID returns a new TypeId struct +func NewTypeID(subscriptionId string, resourceGroupName string, automationAccountName string, moduleName string, typeName string) TypeId { + return TypeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutomationAccountName: automationAccountName, + ModuleName: moduleName, + TypeName: typeName, + } +} + +// ParseTypeID parses 'input' into a TypeId +func ParseTypeID(input string) (*TypeId, error) { + parser := resourceids.NewParserFromResourceIdType(TypeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TypeId{} + + 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) + } + + if id.ModuleName, ok = parsed.Parsed["moduleName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "moduleName", *parsed) + } + + if id.TypeName, ok = parsed.Parsed["typeName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "typeName", *parsed) + } + + return &id, nil +} + +// ParseTypeIDInsensitively parses 'input' case-insensitively into a TypeId +// note: this method should only be used for API response data and not user input +func ParseTypeIDInsensitively(input string) (*TypeId, error) { + parser := resourceids.NewParserFromResourceIdType(TypeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := TypeId{} + + 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) + } + + if id.ModuleName, ok = parsed.Parsed["moduleName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "moduleName", *parsed) + } + + if id.TypeName, ok = parsed.Parsed["typeName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "typeName", *parsed) + } + + return &id, nil +} + +// ValidateTypeID checks that 'input' can be parsed as a Type ID +func ValidateTypeID(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 := ParseTypeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Type ID +func (id TypeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Automation/automationAccounts/%s/modules/%s/types/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName, id.ModuleName, id.TypeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Type ID +func (id TypeId) 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"), + resourceids.StaticSegment("staticModules", "modules", "modules"), + resourceids.UserSpecifiedSegment("moduleName", "moduleValue"), + resourceids.StaticSegment("staticTypes", "types", "types"), + resourceids.UserSpecifiedSegment("typeName", "typeValue"), + } +} + +// String returns a human-readable description of this Type ID +func (id TypeId) 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), + fmt.Sprintf("Module Name: %q", id.ModuleName), + fmt.Sprintf("Type Name: %q", id.TypeName), + } + return fmt.Sprintf("Type (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/method_fieldslistbytype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/method_fieldslistbytype.go new file mode 100644 index 000000000000..a68e19d527b3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/method_fieldslistbytype.go @@ -0,0 +1,52 @@ +package typefields + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FieldsListByTypeOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *TypeFieldListResult +} + +// FieldsListByType ... +func (c TypeFieldsClient) FieldsListByType(ctx context.Context, id TypeId) (result FieldsListByTypeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/fields", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/model_typefield.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/model_typefield.go new file mode 100644 index 000000000000..8229e7fdf692 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/model_typefield.go @@ -0,0 +1,9 @@ +package typefields + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TypeField struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/model_typefieldlistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/model_typefieldlistresult.go new file mode 100644 index 000000000000..2f5a148ec499 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/model_typefieldlistresult.go @@ -0,0 +1,8 @@ +package typefields + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TypeFieldListResult struct { + Value *[]TypeField `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/version.go new file mode 100644 index 000000000000..580224056876 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields/version.go @@ -0,0 +1,12 @@ +package typefields + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/typefields/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/README.md new file mode 100644 index 000000000000..6ea121bd3d97 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/README.md @@ -0,0 +1,36 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages` Documentation + +The `usages` SDK allows for interaction with the Azure Resource Manager Service `automation` (API Version `2022-08-08`). + +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/2022-08-08/usages" +``` + + +### Client Initialization + +```go +client := usages.NewUsagesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `UsagesClient.ListByAutomationAccount` + +```go +ctx := context.TODO() +id := usages.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue") + +read, err := client.ListByAutomationAccount(ctx, id) +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/2022-08-08/usages/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/client.go new file mode 100644 index 000000000000..772d6a5be35b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/client.go @@ -0,0 +1,26 @@ +package usages + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UsagesClient struct { + Client *resourcemanager.Client +} + +func NewUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*UsagesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "usages", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating UsagesClient: %+v", err) + } + + return &UsagesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/id_automationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/id_automationaccount.go new file mode 100644 index 000000000000..92d03475dfcc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/id_automationaccount.go @@ -0,0 +1,127 @@ +package usages + +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/2022-08-08/usages/method_listbyautomationaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/method_listbyautomationaccount.go new file mode 100644 index 000000000000..30704980f711 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/method_listbyautomationaccount.go @@ -0,0 +1,52 @@ +package usages + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByAutomationAccountOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *UsageListResult +} + +// ListByAutomationAccount ... +func (c UsagesClient) ListByAutomationAccount(ctx context.Context, id AutomationAccountId) (result ListByAutomationAccountOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/usages", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/model_usage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/model_usage.go new file mode 100644 index 000000000000..70812763c05f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/model_usage.go @@ -0,0 +1,13 @@ +package usages + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Usage struct { + CurrentValue *float64 `json:"currentValue,omitempty"` + Id *string `json:"id,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Name *UsageCounterName `json:"name,omitempty"` + ThrottleStatus *string `json:"throttleStatus,omitempty"` + Unit *string `json:"unit,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/model_usagecountername.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/model_usagecountername.go new file mode 100644 index 000000000000..22360d2a6deb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/model_usagecountername.go @@ -0,0 +1,9 @@ +package usages + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UsageCounterName struct { + LocalizedValue *string `json:"localizedValue,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/model_usagelistresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/model_usagelistresult.go new file mode 100644 index 000000000000..1dfe407e3148 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/model_usagelistresult.go @@ -0,0 +1,8 @@ +package usages + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UsageListResult struct { + Value *[]Usage `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/version.go new file mode 100644 index 000000000000..5aa2c60ce1c6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages/version.go @@ -0,0 +1,12 @@ +package usages + +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 = "2022-08-08" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/usages/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 084d3cf2902a..4c2b36ed1a18 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -198,11 +198,11 @@ 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/runbook 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/2021-06-22/automationaccount -github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08 +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/activity github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/automationaccount github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/certificate github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/connection @@ -211,11 +211,30 @@ github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/credent github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscconfiguration github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscnodeconfiguration github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworker +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/hybridrunbookworkergroup +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job 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/jobstream +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/linkedworkspace +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/listkeys github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/module +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/objectdatatypes +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/operations +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python2package +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/python3package 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 github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/schedule +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationmachinerun +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/softwareupdateconfigurationrun github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrol +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjob +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/sourcecontrolsyncjobstreams +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/statistics +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjob +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/testjobstream +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/typefields +github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/usages github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/variable github.com/hashicorp/go-azure-sdk/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-03-01