Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automation: update sdk of remain resources to 2022-08-08 #22989

Merged
merged 4 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions internal/services/automation/automation_account_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Loading