From 9499a1a3cd520dcd43629da4957b0abece8e393e Mon Sep 17 00:00:00 2001 From: Tobias <5702338+T0biii@users.noreply.github.com> Date: Thu, 5 Sep 2024 07:11:23 +0000 Subject: [PATCH] `bastionhosts` - upgrade api version from `2023-11-01` to `2024-01-01` --- .../network/bastion_host_data_source.go | 2 +- .../services/network/bastion_host_resource.go | 2 +- .../network/bastion_host_resource_test.go | 2 +- internal/services/network/client/client.go | 11 +- .../network/2024-01-01/bastionhosts/README.md | 234 ++++++++++++++++++ .../network/2024-01-01/bastionhosts/client.go | 26 ++ .../2024-01-01/bastionhosts/constants.go | 186 ++++++++++++++ .../2024-01-01/bastionhosts/id_bastionhost.go | 130 ++++++++++ .../bastionhosts/method_createorupdate.go | 75 ++++++ .../2024-01-01/bastionhosts/method_delete.go | 71 ++++++ .../method_deletebastionshareablelink.go | 74 ++++++ ...ethod_deletebastionshareablelinkbytoken.go | 73 ++++++ .../method_disconnectactivesessions.go | 105 ++++++++ .../2024-01-01/bastionhosts/method_get.go | 54 ++++ .../bastionhosts/method_getactivesessions.go | 89 +++++++ .../method_getbastionshareablelink.go | 105 ++++++++ .../2024-01-01/bastionhosts/method_list.go | 106 ++++++++ .../method_listbyresourcegroup.go | 106 ++++++++ .../method_putbastionshareablelink.go | 93 +++++++ .../bastionhosts/method_updatetags.go | 75 ++++++ .../model_bastionactivesession.go | 18 ++ .../bastionhosts/model_bastionhost.go | 20 ++ .../model_bastionhostipconfiguration.go | 12 + ...tionhostipconfigurationpropertiesformat.go | 11 + .../model_bastionhostpropertiesformat.go | 20 ++ ..._bastionhostpropertiesformatnetworkacls.go | 8 + .../bastionhosts/model_bastionsessionstate.go | 10 + .../model_bastionshareablelink.go | 11 + .../model_bastionshareablelinklistrequest.go | 8 + ...el_bastionshareablelinktokenlistrequest.go | 8 + .../2024-01-01/bastionhosts/model_iprule.go | 8 + .../2024-01-01/bastionhosts/model_resource.go | 12 + .../bastionhosts/model_sessionids.go | 8 + .../2024-01-01/bastionhosts/model_sku.go | 8 + .../bastionhosts/model_subresource.go | 8 + .../bastionhosts/model_tagsobject.go | 8 + .../2024-01-01/bastionhosts/predicates.go | 141 +++++++++++ .../2024-01-01/bastionhosts/version.go | 12 + vendor/modules.txt | 1 + 39 files changed, 1947 insertions(+), 4 deletions(-) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/id_bastionhost.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_deletebastionshareablelink.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_deletebastionshareablelinkbytoken.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_disconnectactivesessions.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_getactivesessions.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_getbastionshareablelink.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_listbyresourcegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_putbastionshareablelink.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_updatetags.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionactivesession.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhost.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostipconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostpropertiesformat.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionsessionstate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelink.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelinklistrequest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelinktokenlistrequest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_iprule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_resource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_sessionids.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_sku.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_subresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_tagsobject.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/version.go diff --git a/internal/services/network/bastion_host_data_source.go b/internal/services/network/bastion_host_data_source.go index f2674329990f5..3e0550af95c48 100644 --- a/internal/services/network/bastion_host_data_source.go +++ b/internal/services/network/bastion_host_data_source.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-11-01/bastionhosts" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" diff --git a/internal/services/network/bastion_host_resource.go b/internal/services/network/bastion_host_resource.go index 1196e59c85ed1..51c8af2fdc33e 100644 --- a/internal/services/network/bastion_host_resource.go +++ b/internal/services/network/bastion_host_resource.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-11-01/bastionhosts" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" diff --git a/internal/services/network/bastion_host_resource_test.go b/internal/services/network/bastion_host_resource_test.go index e5633634f3da8..e881a56544d28 100644 --- a/internal/services/network/bastion_host_resource_test.go +++ b/internal/services/network/bastion_host_resource_test.go @@ -8,7 +8,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-11-01/bastionhosts" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts" "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" diff --git a/internal/services/network/client/client.go b/internal/services/network/client/client.go index 4d49aa9d91688..29b136f7daad0 100644 --- a/internal/services/network/client/client.go +++ b/internal/services/network/client/client.go @@ -6,6 +6,7 @@ package client import ( "fmt" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts" "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/networkinterfaces" "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/vmsspublicipaddresses" network_2023_11_01 "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-11-01" @@ -15,13 +16,20 @@ import ( type Client struct { *network_2023_11_01.Client - + + BastionHostsClient *bastionhosts.BastionHostsClient // VMSS Data Source requires the Network Interfaces and VMSSPublicIpAddresses client from `2023-09-01` for the `ListVirtualMachineScaleSetVMNetworkInterfacesComplete` method NetworkInterfacesClient *networkinterfaces.NetworkInterfacesClient VMSSPublicIPAddressesClient *vmsspublicipaddresses.VMSSPublicIPAddressesClient } func NewClient(o *common.ClientOptions) (*Client, error) { + BastionHostsClient, err := bastionhosts.NewBastionHostsClientWithBaseURI(o.Environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building Bastion Client: %+v", err) + } + o.Configure(BastionHostsClient.Client, o.Authorizers.ResourceManager) + NetworkInterfacesClient, err := networkinterfaces.NewNetworkInterfacesClientWithBaseURI(o.Environment.ResourceManager) if err != nil { return nil, fmt.Errorf("building Network Interfaces Client: %+v", err) @@ -42,6 +50,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) { } return &Client{ + BastionHostsClient: BastionHostsClient, NetworkInterfacesClient: NetworkInterfacesClient, VMSSPublicIPAddressesClient: VMSSPublicIPAddressesClient, Client: client, diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/README.md new file mode 100644 index 0000000000000..88400c89ff97a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/README.md @@ -0,0 +1,234 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts` Documentation + +The `bastionhosts` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2024-01-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-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts" +``` + + +### Client Initialization + +```go +client := bastionhosts.NewBastionHostsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `BastionHostsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.BastionHost{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BastionHostsClient.Delete` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `BastionHostsClient.DeleteBastionShareableLink` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.BastionShareableLinkListRequest{ + // ... +} + + +if err := client.DeleteBastionShareableLinkThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BastionHostsClient.DeleteBastionShareableLinkByToken` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.BastionShareableLinkTokenListRequest{ + // ... +} + + +if err := client.DeleteBastionShareableLinkByTokenThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BastionHostsClient.DisconnectActiveSessions` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.SessionIds{ + // ... +} + + +// alternatively `client.DisconnectActiveSessions(ctx, id, payload)` can be used to do batched pagination +items, err := client.DisconnectActiveSessionsComplete(ctx, id, payload) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionHostsClient.Get` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +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: `BastionHostsClient.GetActiveSessions` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +// alternatively `client.GetActiveSessions(ctx, id)` can be used to do batched pagination +items, err := client.GetActiveSessionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionHostsClient.GetBastionShareableLink` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.BastionShareableLinkListRequest{ + // ... +} + + +// alternatively `client.GetBastionShareableLink(ctx, id, payload)` can be used to do batched pagination +items, err := client.GetBastionShareableLinkComplete(ctx, id, payload) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionHostsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionHostsClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionHostsClient.PutBastionShareableLink` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.BastionShareableLinkListRequest{ + // ... +} + + +// alternatively `client.PutBastionShareableLink(ctx, id, payload)` can be used to do batched pagination +items, err := client.PutBastionShareableLinkComplete(ctx, id, payload) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionHostsClient.UpdateTags` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.TagsObject{ + // ... +} + + +if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/client.go new file mode 100644 index 0000000000000..95e06c7f523df --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/client.go @@ -0,0 +1,26 @@ +package bastionhosts + +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 BastionHostsClient struct { + Client *resourcemanager.Client +} + +func NewBastionHostsClientWithBaseURI(sdkApi sdkEnv.Api) (*BastionHostsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bastionhosts", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating BastionHostsClient: %+v", err) + } + + return &BastionHostsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/constants.go new file mode 100644 index 0000000000000..3822668195b53 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/constants.go @@ -0,0 +1,186 @@ +package bastionhosts + +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 BastionConnectProtocol string + +const ( + BastionConnectProtocolRDP BastionConnectProtocol = "RDP" + BastionConnectProtocolSSH BastionConnectProtocol = "SSH" +) + +func PossibleValuesForBastionConnectProtocol() []string { + return []string{ + string(BastionConnectProtocolRDP), + string(BastionConnectProtocolSSH), + } +} + +func (s *BastionConnectProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBastionConnectProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBastionConnectProtocol(input string) (*BastionConnectProtocol, error) { + vals := map[string]BastionConnectProtocol{ + "rdp": BastionConnectProtocolRDP, + "ssh": BastionConnectProtocolSSH, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BastionConnectProtocol(input) + return &out, nil +} + +type BastionHostSkuName string + +const ( + BastionHostSkuNameBasic BastionHostSkuName = "Basic" + BastionHostSkuNameDeveloper BastionHostSkuName = "Developer" + BastionHostSkuNamePremium BastionHostSkuName = "Premium" + BastionHostSkuNameStandard BastionHostSkuName = "Standard" +) + +func PossibleValuesForBastionHostSkuName() []string { + return []string{ + string(BastionHostSkuNameBasic), + string(BastionHostSkuNameDeveloper), + string(BastionHostSkuNamePremium), + string(BastionHostSkuNameStandard), + } +} + +func (s *BastionHostSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBastionHostSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBastionHostSkuName(input string) (*BastionHostSkuName, error) { + vals := map[string]BastionHostSkuName{ + "basic": BastionHostSkuNameBasic, + "developer": BastionHostSkuNameDeveloper, + "premium": BastionHostSkuNamePremium, + "standard": BastionHostSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BastionHostSkuName(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +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{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + 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 +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/id_bastionhost.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/id_bastionhost.go new file mode 100644 index 0000000000000..66012e2eda558 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/id_bastionhost.go @@ -0,0 +1,130 @@ +package bastionhosts + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&BastionHostId{}) +} + +var _ resourceids.ResourceId = &BastionHostId{} + +// BastionHostId is a struct representing the Resource ID for a Bastion Host +type BastionHostId struct { + SubscriptionId string + ResourceGroupName string + BastionHostName string +} + +// NewBastionHostID returns a new BastionHostId struct +func NewBastionHostID(subscriptionId string, resourceGroupName string, bastionHostName string) BastionHostId { + return BastionHostId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + BastionHostName: bastionHostName, + } +} + +// ParseBastionHostID parses 'input' into a BastionHostId +func ParseBastionHostID(input string) (*BastionHostId, error) { + parser := resourceids.NewParserFromResourceIdType(&BastionHostId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BastionHostId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBastionHostIDInsensitively parses 'input' case-insensitively into a BastionHostId +// note: this method should only be used for API response data and not user input +func ParseBastionHostIDInsensitively(input string) (*BastionHostId, error) { + parser := resourceids.NewParserFromResourceIdType(&BastionHostId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BastionHostId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BastionHostId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.BastionHostName, ok = input.Parsed["bastionHostName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "bastionHostName", input) + } + + return nil +} + +// ValidateBastionHostID checks that 'input' can be parsed as a Bastion Host ID +func ValidateBastionHostID(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 := ParseBastionHostID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Bastion Host ID +func (id BastionHostId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/bastionHosts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.BastionHostName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Bastion Host ID +func (id BastionHostId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("staticBastionHosts", "bastionHosts", "bastionHosts"), + resourceids.UserSpecifiedSegment("bastionHostName", "bastionHostValue"), + } +} + +// String returns a human-readable description of this Bastion Host ID +func (id BastionHostId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Bastion Host Name: %q", id.BastionHostName), + } + return fmt.Sprintf("Bastion Host (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_createorupdate.go new file mode 100644 index 0000000000000..fe735012d1ff6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_createorupdate.go @@ -0,0 +1,75 @@ +package bastionhosts + +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 CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *BastionHost +} + +// CreateOrUpdate ... +func (c BastionHostsClient) CreateOrUpdate(ctx context.Context, id BastionHostId, input BastionHost) (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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c BastionHostsClient) CreateOrUpdateThenPoll(ctx context.Context, id BastionHostId, input BastionHost) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_delete.go new file mode 100644 index 0000000000000..5eebbeeeed388 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_delete.go @@ -0,0 +1,71 @@ +package bastionhosts + +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 DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c BastionHostsClient) Delete(ctx context.Context, id BastionHostId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c BastionHostsClient) DeleteThenPoll(ctx context.Context, id BastionHostId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_deletebastionshareablelink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_deletebastionshareablelink.go new file mode 100644 index 0000000000000..24694223a115a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_deletebastionshareablelink.go @@ -0,0 +1,74 @@ +package bastionhosts + +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 DeleteBastionShareableLinkOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteBastionShareableLink ... +func (c BastionHostsClient) DeleteBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result DeleteBastionShareableLinkOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/deleteShareableLinks", 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 +} + +// DeleteBastionShareableLinkThenPoll performs DeleteBastionShareableLink then polls until it's completed +func (c BastionHostsClient) DeleteBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error { + result, err := c.DeleteBastionShareableLink(ctx, id, input) + if err != nil { + return fmt.Errorf("performing DeleteBastionShareableLink: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteBastionShareableLink: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_deletebastionshareablelinkbytoken.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_deletebastionshareablelinkbytoken.go new file mode 100644 index 0000000000000..dd4a99222c92b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_deletebastionshareablelinkbytoken.go @@ -0,0 +1,73 @@ +package bastionhosts + +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 DeleteBastionShareableLinkByTokenOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteBastionShareableLinkByToken ... +func (c BastionHostsClient) DeleteBastionShareableLinkByToken(ctx context.Context, id BastionHostId, input BastionShareableLinkTokenListRequest) (result DeleteBastionShareableLinkByTokenOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/deleteShareableLinksByToken", 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 +} + +// DeleteBastionShareableLinkByTokenThenPoll performs DeleteBastionShareableLinkByToken then polls until it's completed +func (c BastionHostsClient) DeleteBastionShareableLinkByTokenThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkTokenListRequest) error { + result, err := c.DeleteBastionShareableLinkByToken(ctx, id, input) + if err != nil { + return fmt.Errorf("performing DeleteBastionShareableLinkByToken: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteBastionShareableLinkByToken: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_disconnectactivesessions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_disconnectactivesessions.go new file mode 100644 index 0000000000000..b5bf326b6c2dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_disconnectactivesessions.go @@ -0,0 +1,105 @@ +package bastionhosts + +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 DisconnectActiveSessionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]BastionSessionState +} + +type DisconnectActiveSessionsCompleteResult struct { + LatestHttpResponse *http.Response + Items []BastionSessionState +} + +type DisconnectActiveSessionsCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *DisconnectActiveSessionsCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// DisconnectActiveSessions ... +func (c BastionHostsClient) DisconnectActiveSessions(ctx context.Context, id BastionHostId, input SessionIds) (result DisconnectActiveSessionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Pager: &DisconnectActiveSessionsCustomPager{}, + Path: fmt.Sprintf("%s/disconnectActiveSessions", 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 *[]BastionSessionState `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// DisconnectActiveSessionsComplete retrieves all the results into a single object +func (c BastionHostsClient) DisconnectActiveSessionsComplete(ctx context.Context, id BastionHostId, input SessionIds) (DisconnectActiveSessionsCompleteResult, error) { + return c.DisconnectActiveSessionsCompleteMatchingPredicate(ctx, id, input, BastionSessionStateOperationPredicate{}) +} + +// DisconnectActiveSessionsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c BastionHostsClient) DisconnectActiveSessionsCompleteMatchingPredicate(ctx context.Context, id BastionHostId, input SessionIds, predicate BastionSessionStateOperationPredicate) (result DisconnectActiveSessionsCompleteResult, err error) { + items := make([]BastionSessionState, 0) + + resp, err := c.DisconnectActiveSessions(ctx, id, input) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = DisconnectActiveSessionsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_get.go new file mode 100644 index 0000000000000..71b1a85a45fad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_get.go @@ -0,0 +1,54 @@ +package bastionhosts + +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 *BastionHost +} + +// Get ... +func (c BastionHostsClient) Get(ctx context.Context, id BastionHostId) (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 + } + + var model BastionHost + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_getactivesessions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_getactivesessions.go new file mode 100644 index 0000000000000..ef9274ebcca3b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_getactivesessions.go @@ -0,0 +1,89 @@ +package bastionhosts + +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 GetActiveSessionsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *[]BastionActiveSession +} + +type GetActiveSessionsCompleteResult struct { + LatestHttpResponse *http.Response + Items []BastionActiveSession +} + +type GetActiveSessionsCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *GetActiveSessionsCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// GetActiveSessions ... +func (c BastionHostsClient) GetActiveSessions(ctx context.Context, id BastionHostId) (result GetActiveSessionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Pager: &GetActiveSessionsCustomPager{}, + Path: fmt.Sprintf("%s/getActiveSessions", 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// GetActiveSessionsThenPoll performs GetActiveSessions then polls until it's completed +func (c BastionHostsClient) GetActiveSessionsThenPoll(ctx context.Context, id BastionHostId) error { + result, err := c.GetActiveSessions(ctx, id) + if err != nil { + return fmt.Errorf("performing GetActiveSessions: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after GetActiveSessions: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_getbastionshareablelink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_getbastionshareablelink.go new file mode 100644 index 0000000000000..c259811919990 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_getbastionshareablelink.go @@ -0,0 +1,105 @@ +package bastionhosts + +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 GetBastionShareableLinkOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]BastionShareableLink +} + +type GetBastionShareableLinkCompleteResult struct { + LatestHttpResponse *http.Response + Items []BastionShareableLink +} + +type GetBastionShareableLinkCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *GetBastionShareableLinkCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// GetBastionShareableLink ... +func (c BastionHostsClient) GetBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result GetBastionShareableLinkOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Pager: &GetBastionShareableLinkCustomPager{}, + Path: fmt.Sprintf("%s/getShareableLinks", 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 *[]BastionShareableLink `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetBastionShareableLinkComplete retrieves all the results into a single object +func (c BastionHostsClient) GetBastionShareableLinkComplete(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (GetBastionShareableLinkCompleteResult, error) { + return c.GetBastionShareableLinkCompleteMatchingPredicate(ctx, id, input, BastionShareableLinkOperationPredicate{}) +} + +// GetBastionShareableLinkCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c BastionHostsClient) GetBastionShareableLinkCompleteMatchingPredicate(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest, predicate BastionShareableLinkOperationPredicate) (result GetBastionShareableLinkCompleteResult, err error) { + items := make([]BastionShareableLink, 0) + + resp, err := c.GetBastionShareableLink(ctx, id, input) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = GetBastionShareableLinkCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_list.go new file mode 100644 index 0000000000000..1503bda851397 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_list.go @@ -0,0 +1,106 @@ +package bastionhosts + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "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 ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]BastionHost +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []BastionHost +} + +type ListCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// List ... +func (c BastionHostsClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListCustomPager{}, + Path: fmt.Sprintf("%s/providers/Microsoft.Network/bastionHosts", 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 *[]BastionHost `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c BastionHostsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, BastionHostOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c BastionHostsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate BastionHostOperationPredicate) (result ListCompleteResult, err error) { + items := make([]BastionHost, 0) + + resp, err := c.List(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_listbyresourcegroup.go new file mode 100644 index 0000000000000..9be179204d2fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_listbyresourcegroup.go @@ -0,0 +1,106 @@ +package bastionhosts + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "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 ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]BastionHost +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []BastionHost +} + +type ListByResourceGroupCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByResourceGroupCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByResourceGroup ... +func (c BastionHostsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByResourceGroupCustomPager{}, + Path: fmt.Sprintf("%s/providers/Microsoft.Network/bastionHosts", 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 *[]BastionHost `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByResourceGroupComplete retrieves all the results into a single object +func (c BastionHostsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, BastionHostOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c BastionHostsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate BastionHostOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]BastionHost, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_putbastionshareablelink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_putbastionshareablelink.go new file mode 100644 index 0000000000000..f0a53697d665b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_putbastionshareablelink.go @@ -0,0 +1,93 @@ +package bastionhosts + +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 PutBastionShareableLinkOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *[]BastionShareableLink +} + +type PutBastionShareableLinkCompleteResult struct { + LatestHttpResponse *http.Response + Items []BastionShareableLink +} + +type PutBastionShareableLinkCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *PutBastionShareableLinkCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// PutBastionShareableLink ... +func (c BastionHostsClient) PutBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result PutBastionShareableLinkOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Pager: &PutBastionShareableLinkCustomPager{}, + Path: fmt.Sprintf("%s/createShareableLinks", 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 +} + +// PutBastionShareableLinkThenPoll performs PutBastionShareableLink then polls until it's completed +func (c BastionHostsClient) PutBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error { + result, err := c.PutBastionShareableLink(ctx, id, input) + if err != nil { + return fmt.Errorf("performing PutBastionShareableLink: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after PutBastionShareableLink: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_updatetags.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_updatetags.go new file mode 100644 index 0000000000000..697efefb0c865 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/method_updatetags.go @@ -0,0 +1,75 @@ +package bastionhosts + +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 UpdateTagsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *BastionHost +} + +// UpdateTags ... +func (c BastionHostsClient) UpdateTags(ctx context.Context, id BastionHostId, input TagsObject) (result UpdateTagsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateTagsThenPoll performs UpdateTags then polls until it's completed +func (c BastionHostsClient) UpdateTagsThenPoll(ctx context.Context, id BastionHostId, input TagsObject) error { + result, err := c.UpdateTags(ctx, id, input) + if err != nil { + return fmt.Errorf("performing UpdateTags: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after UpdateTags: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionactivesession.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionactivesession.go new file mode 100644 index 0000000000000..4f5fe8c844eb6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionactivesession.go @@ -0,0 +1,18 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionActiveSession struct { + Protocol *BastionConnectProtocol `json:"protocol,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` + SessionDurationInMins *float64 `json:"sessionDurationInMins,omitempty"` + SessionId *string `json:"sessionId,omitempty"` + StartTime *interface{} `json:"startTime,omitempty"` + TargetHostName *string `json:"targetHostName,omitempty"` + TargetIPAddress *string `json:"targetIpAddress,omitempty"` + TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` + TargetResourceId *string `json:"targetResourceId,omitempty"` + TargetSubscriptionId *string `json:"targetSubscriptionId,omitempty"` + UserName *string `json:"userName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhost.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhost.go new file mode 100644 index 0000000000000..cdd1feb92cf9e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhost.go @@ -0,0 +1,20 @@ +package bastionhosts + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionHost struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *BastionHostPropertiesFormat `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostipconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostipconfiguration.go new file mode 100644 index 0000000000000..efda704773cc6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostipconfiguration.go @@ -0,0 +1,12 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionHostIPConfiguration struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *BastionHostIPConfigurationPropertiesFormat `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go new file mode 100644 index 0000000000000..34d950723a146 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go @@ -0,0 +1,11 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionHostIPConfigurationPropertiesFormat struct { + PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + PublicIPAddress SubResource `json:"publicIPAddress"` + Subnet SubResource `json:"subnet"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostpropertiesformat.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostpropertiesformat.go new file mode 100644 index 0000000000000..d45d86671abcf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostpropertiesformat.go @@ -0,0 +1,20 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionHostPropertiesFormat struct { + DisableCopyPaste *bool `json:"disableCopyPaste,omitempty"` + DnsName *string `json:"dnsName,omitempty"` + EnableFileCopy *bool `json:"enableFileCopy,omitempty"` + EnableIPConnect *bool `json:"enableIpConnect,omitempty"` + EnableKerberos *bool `json:"enableKerberos,omitempty"` + EnableSessionRecording *bool `json:"enableSessionRecording,omitempty"` + EnableShareableLink *bool `json:"enableShareableLink,omitempty"` + EnableTunneling *bool `json:"enableTunneling,omitempty"` + IPConfigurations *[]BastionHostIPConfiguration `json:"ipConfigurations,omitempty"` + NetworkAcls *BastionHostPropertiesFormatNetworkAcls `json:"networkAcls,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ScaleUnits *int64 `json:"scaleUnits,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go new file mode 100644 index 0000000000000..f217ff8d9ae82 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go @@ -0,0 +1,8 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionHostPropertiesFormatNetworkAcls struct { + IPRules *[]IPRule `json:"ipRules,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionsessionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionsessionstate.go new file mode 100644 index 0000000000000..f60a5f77620ae --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionsessionstate.go @@ -0,0 +1,10 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionSessionState struct { + Message *string `json:"message,omitempty"` + SessionId *string `json:"sessionId,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelink.go new file mode 100644 index 0000000000000..4da004b8f536f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelink.go @@ -0,0 +1,11 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionShareableLink struct { + Bsl *string `json:"bsl,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + Message *string `json:"message,omitempty"` + VM Resource `json:"vm"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelinklistrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelinklistrequest.go new file mode 100644 index 0000000000000..925995fca6417 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelinklistrequest.go @@ -0,0 +1,8 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionShareableLinkListRequest struct { + VMs *[]BastionShareableLink `json:"vms,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelinktokenlistrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelinktokenlistrequest.go new file mode 100644 index 0000000000000..0b7aa54ce711c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_bastionshareablelinktokenlistrequest.go @@ -0,0 +1,8 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionShareableLinkTokenListRequest struct { + Tokens *[]string `json:"tokens,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_iprule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_iprule.go new file mode 100644 index 0000000000000..a54a84aac8e6c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_iprule.go @@ -0,0 +1,8 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPRule struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_resource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_resource.go new file mode 100644 index 0000000000000..17e7756ce3c05 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_resource.go @@ -0,0 +1,12 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Resource struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,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/network/2024-01-01/bastionhosts/model_sessionids.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_sessionids.go new file mode 100644 index 0000000000000..a74e44a3ebde9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_sessionids.go @@ -0,0 +1,8 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SessionIds struct { + SessionIds *[]string `json:"sessionIds,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_sku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_sku.go new file mode 100644 index 0000000000000..1a8a8749a4642 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_sku.go @@ -0,0 +1,8 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Sku struct { + Name *BastionHostSkuName `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_subresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_subresource.go new file mode 100644 index 0000000000000..7a0a23a149a7a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_subresource.go @@ -0,0 +1,8 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubResource struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_tagsobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_tagsobject.go new file mode 100644 index 0000000000000..73566b88f0be1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/model_tagsobject.go @@ -0,0 +1,8 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TagsObject struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/predicates.go new file mode 100644 index 0000000000000..3c3835a32d082 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/predicates.go @@ -0,0 +1,141 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionActiveSessionOperationPredicate struct { + ResourceType *string + SessionDurationInMins *float64 + SessionId *string + StartTime *interface{} + TargetHostName *string + TargetIPAddress *string + TargetResourceGroup *string + TargetResourceId *string + TargetSubscriptionId *string + UserName *string +} + +func (p BastionActiveSessionOperationPredicate) Matches(input BastionActiveSession) bool { + + if p.ResourceType != nil && (input.ResourceType == nil || *p.ResourceType != *input.ResourceType) { + return false + } + + if p.SessionDurationInMins != nil && (input.SessionDurationInMins == nil || *p.SessionDurationInMins != *input.SessionDurationInMins) { + return false + } + + if p.SessionId != nil && (input.SessionId == nil || *p.SessionId != *input.SessionId) { + return false + } + + if p.StartTime != nil && (input.StartTime == nil || *p.StartTime != *input.StartTime) { + return false + } + + if p.TargetHostName != nil && (input.TargetHostName == nil || *p.TargetHostName != *input.TargetHostName) { + return false + } + + if p.TargetIPAddress != nil && (input.TargetIPAddress == nil || *p.TargetIPAddress != *input.TargetIPAddress) { + return false + } + + if p.TargetResourceGroup != nil && (input.TargetResourceGroup == nil || *p.TargetResourceGroup != *input.TargetResourceGroup) { + return false + } + + if p.TargetResourceId != nil && (input.TargetResourceId == nil || *p.TargetResourceId != *input.TargetResourceId) { + return false + } + + if p.TargetSubscriptionId != nil && (input.TargetSubscriptionId == nil || *p.TargetSubscriptionId != *input.TargetSubscriptionId) { + return false + } + + if p.UserName != nil && (input.UserName == nil || *p.UserName != *input.UserName) { + return false + } + + return true +} + +type BastionHostOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p BastionHostOperationPredicate) Matches(input BastionHost) 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 +} + +type BastionSessionStateOperationPredicate struct { + Message *string + SessionId *string + State *string +} + +func (p BastionSessionStateOperationPredicate) Matches(input BastionSessionState) bool { + + if p.Message != nil && (input.Message == nil || *p.Message != *input.Message) { + return false + } + + if p.SessionId != nil && (input.SessionId == nil || *p.SessionId != *input.SessionId) { + return false + } + + if p.State != nil && (input.State == nil || *p.State != *input.State) { + return false + } + + return true +} + +type BastionShareableLinkOperationPredicate struct { + Bsl *string + CreatedAt *string + Message *string +} + +func (p BastionShareableLinkOperationPredicate) Matches(input BastionShareableLink) bool { + + if p.Bsl != nil && (input.Bsl == nil || *p.Bsl != *input.Bsl) { + return false + } + + if p.CreatedAt != nil && (input.CreatedAt == nil || *p.CreatedAt != *input.CreatedAt) { + return false + } + + if p.Message != nil && (input.Message == nil || *p.Message != *input.Message) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/version.go new file mode 100644 index 0000000000000..34627770e6da3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts/version.go @@ -0,0 +1,12 @@ +package bastionhosts + +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 = "2024-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/bastionhosts/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index fbd256e954480..8901cda8480cd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -849,6 +849,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-11-01/vpnserverc github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-11-01/vpnsites github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-11-01/webapplicationfirewallpolicies github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-11-01/webcategories +github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-01-01/bastionhosts github.com/hashicorp/go-azure-sdk/resource-manager/networkfunction/2022-11-01/azuretrafficcollectors github.com/hashicorp/go-azure-sdk/resource-manager/networkfunction/2022-11-01/collectorpolicies github.com/hashicorp/go-azure-sdk/resource-manager/newrelic/2022-07-01/monitors