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

New Resource: azurerm_lab_service_schedule #19977

Merged
merged 12 commits into from
Jan 17, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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