Skip to content

Commit

Permalink
New Resource: azurerm_lab_service_schedule (#19977)
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-yechenwei authored Jan 17, 2023
1 parent f3c1fac commit f6682eb
Show file tree
Hide file tree
Showing 27 changed files with 1,948 additions and 8 deletions.
18 changes: 12 additions & 6 deletions internal/services/labservice/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package client
import (
"github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2022-08-01/lab"
"github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2022-08-01/labplan"
"github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2022-08-01/schedule"
"github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2022-08-01/user"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
LabClient *lab.LabClient
LabPlanClient *labplan.LabPlanClient
UserClient *user.UserClient
LabClient *lab.LabClient
LabPlanClient *labplan.LabPlanClient
ScheduleClient *schedule.ScheduleClient
UserClient *user.UserClient
}

func NewClient(o *common.ClientOptions) *Client {
Expand All @@ -20,12 +22,16 @@ func NewClient(o *common.ClientOptions) *Client {
LabPlanClient := labplan.NewLabPlanClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&LabPlanClient.Client, o.ResourceManagerAuthorizer)

ScheduleClient := schedule.NewScheduleClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&ScheduleClient.Client, o.ResourceManagerAuthorizer)

UserClient := user.NewUserClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&UserClient.Client, o.ResourceManagerAuthorizer)

return &Client{
LabClient: &LabClient,
LabPlanClient: &LabPlanClient,
UserClient: &UserClient,
LabClient: &LabClient,
LabPlanClient: &LabPlanClient,
ScheduleClient: &ScheduleClient,
UserClient: &UserClient,
}
}
2 changes: 1 addition & 1 deletion internal/services/labservice/lab_service_lab_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ func flattenAutoShutdownProfile(input lab.AutoShutdownProfile) []AutoShutdown {
shutdownWhenNotConnectedEnabled := input.ShutdownWhenNotConnected != nil && *input.ShutdownWhenNotConnected != lab.EnableStateDisabled
shutdownOnIdleModeConfigured := input.ShutdownOnIdle != nil && *input.ShutdownOnIdle != lab.ShutdownOnIdleModeNone
idleDelayConfigured := input.IdleDelay != nil
if !shutdownOnDisconnectEnabled && !shutdownWhenNotConnectedEnabled && shutdownOnIdleModeConfigured && !idleDelayConfigured {
if !shutdownOnDisconnectEnabled && !shutdownWhenNotConnectedEnabled && !shutdownOnIdleModeConfigured && !idleDelayConfigured {
return []AutoShutdown{}
}

Expand Down
Loading

0 comments on commit f6682eb

Please sign in to comment.