Skip to content

Commit

Permalink
New waypoint service and models no longer have the v2 suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryEstberg committed Feb 20, 2025
1 parent 9979bde commit 8906e2c
Show file tree
Hide file tree
Showing 14 changed files with 133 additions and 133 deletions.
8 changes: 4 additions & 4 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ import (
cloud_vault_secrets "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-secrets/stable/2023-11-28/client"
"github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-secrets/stable/2023-11-28/client/secret_service"

cloud_waypoint_v2 "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/client"
waypoint_service_v2 "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/client/waypoint_service"
cloud_waypoint "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/client"
"github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/client/waypoint_service"

cloud_log_service "github.com/hashicorp/hcp-sdk-go/clients/cloud-log-service/preview/2021-03-30/client"
"github.com/hashicorp/hcp-sdk-go/clients/cloud-log-service/preview/2021-03-30/client/log_service"
Expand Down Expand Up @@ -87,7 +87,7 @@ type Client struct {
Groups groups_service.ClientService
Vault vault_service.ClientService
VaultSecrets secret_service.ClientService
Waypoint waypoint_service_v2.ClientService
Waypoint waypoint_service.ClientService
Webhook webhook_service.ClientService
LogService log_service.ClientService
LogStreamingService streaming_service.ClientService
Expand Down Expand Up @@ -179,7 +179,7 @@ func NewClient(config ClientConfig) (*Client, error) {
Groups: cloud_iam.New(httpClient, nil).GroupsService,
Vault: cloud_vault.New(httpClient, nil).VaultService,
VaultSecrets: cloud_vault_secrets.New(httpClient, nil).SecretService,
Waypoint: cloud_waypoint_v2.New(httpClient, nil).WaypointService,
Waypoint: cloud_waypoint.New(httpClient, nil).WaypointService,
LogService: cloud_log_service.New(httpClient, nil).LogService,
LogStreamingService: cloud_log_service.New(httpClient, nil).StreamingService,
Webhook: cloud_webhook.New(httpClient, nil).WebhookService,
Expand Down
44 changes: 22 additions & 22 deletions internal/clients/waypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"context"

sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models"
waypoint_service_v2 "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/client/waypoint_service"
waypoint_models_v2 "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
"github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/client/waypoint_service"
waypoint_models "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
)

// GetAction will retrieve an Action using the provided ID by default
// or by name if the ID is not provided
func GetAction(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, actionID string, actionName string) (*waypoint_models_v2.HashicorpCloudWaypointActionConfig, error) {
params := &waypoint_service_v2.WaypointServiceGetActionConfigParams{
func GetAction(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, actionID string, actionName string) (*waypoint_models.HashicorpCloudWaypointActionConfig, error) {
params := &waypoint_service.WaypointServiceGetActionConfigParams{
ActionID: &actionID,
ActionName: &actionName,
NamespaceLocationOrganizationID: loc.OrganizationID,
Expand All @@ -29,8 +29,8 @@ func GetAction(ctx context.Context, client *Client, loc *sharedmodels.HashicorpC
}

// GetApplicationTemplateByName will retrieve a template by name
func GetApplicationTemplateByName(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, appName string) (*waypoint_models_v2.HashicorpCloudWaypointApplicationTemplate, error) {
params := &waypoint_service_v2.WaypointServiceGetApplicationTemplate2Params{
func GetApplicationTemplateByName(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, appName string) (*waypoint_models.HashicorpCloudWaypointApplicationTemplate, error) {
params := &waypoint_service.WaypointServiceGetApplicationTemplate2Params{
ApplicationTemplateName: appName,
NamespaceLocationOrganizationID: loc.OrganizationID,
NamespaceLocationProjectID: loc.ProjectID,
Expand All @@ -44,8 +44,8 @@ func GetApplicationTemplateByName(ctx context.Context, client *Client, loc *shar
}

// GetApplicationTemplateByID will retrieve a template by ID
func GetApplicationTemplateByID(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, appID string) (*waypoint_models_v2.HashicorpCloudWaypointApplicationTemplate, error) {
params := &waypoint_service_v2.WaypointServiceGetApplicationTemplateParams{
func GetApplicationTemplateByID(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, appID string) (*waypoint_models.HashicorpCloudWaypointApplicationTemplate, error) {
params := &waypoint_service.WaypointServiceGetApplicationTemplateParams{
ApplicationTemplateID: appID,
NamespaceLocationOrganizationID: loc.OrganizationID,
NamespaceLocationProjectID: loc.ProjectID,
Expand All @@ -59,8 +59,8 @@ func GetApplicationTemplateByID(ctx context.Context, client *Client, loc *shared
}

// GetAddOnDefinitionByName will retrieve an add-on definition by name
func GetAddOnDefinitionByName(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, defName string) (*waypoint_models_v2.HashicorpCloudWaypointAddOnDefinition, error) {
params := &waypoint_service_v2.WaypointServiceGetAddOnDefinition2Params{
func GetAddOnDefinitionByName(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, defName string) (*waypoint_models.HashicorpCloudWaypointAddOnDefinition, error) {
params := &waypoint_service.WaypointServiceGetAddOnDefinition2Params{
AddOnDefinitionName: defName,
NamespaceLocationOrganizationID: loc.OrganizationID,
NamespaceLocationProjectID: loc.ProjectID,
Expand All @@ -74,8 +74,8 @@ func GetAddOnDefinitionByName(ctx context.Context, client *Client, loc *sharedmo
}

// GetAddOnDefinitionByID will retrieve an add-on definition by ID
func GetAddOnDefinitionByID(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, defID string) (*waypoint_models_v2.HashicorpCloudWaypointAddOnDefinition, error) {
params := &waypoint_service_v2.WaypointServiceGetAddOnDefinitionParams{
func GetAddOnDefinitionByID(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, defID string) (*waypoint_models.HashicorpCloudWaypointAddOnDefinition, error) {
params := &waypoint_service.WaypointServiceGetAddOnDefinitionParams{
AddOnDefinitionID: defID,
NamespaceLocationOrganizationID: loc.OrganizationID,
NamespaceLocationProjectID: loc.ProjectID,
Expand All @@ -89,8 +89,8 @@ func GetAddOnDefinitionByID(ctx context.Context, client *Client, loc *sharedmode
}

// GetApplicationByName will retrieve an application by name
func GetApplicationByName(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, appName string) (*waypoint_models_v2.HashicorpCloudWaypointApplication, error) {
params := &waypoint_service_v2.WaypointServiceGetApplication2Params{
func GetApplicationByName(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, appName string) (*waypoint_models.HashicorpCloudWaypointApplication, error) {
params := &waypoint_service.WaypointServiceGetApplication2Params{
ApplicationName: appName,
NamespaceLocationOrganizationID: loc.OrganizationID,
NamespaceLocationProjectID: loc.ProjectID,
Expand All @@ -104,8 +104,8 @@ func GetApplicationByName(ctx context.Context, client *Client, loc *sharedmodels
}

// GetApplicationByID will retrieve an application by ID
func GetApplicationByID(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, appID string) (*waypoint_models_v2.HashicorpCloudWaypointApplication, error) {
params := &waypoint_service_v2.WaypointServiceGetApplicationParams{
func GetApplicationByID(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, appID string) (*waypoint_models.HashicorpCloudWaypointApplication, error) {
params := &waypoint_service.WaypointServiceGetApplicationParams{
ApplicationID: appID,
NamespaceLocationOrganizationID: loc.OrganizationID,
NamespaceLocationProjectID: loc.ProjectID,
Expand All @@ -119,8 +119,8 @@ func GetApplicationByID(ctx context.Context, client *Client, loc *sharedmodels.H
}

// GetAddOnByName will retrieve an add-on by name
func GetAddOnByName(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, defName string) (*waypoint_models_v2.HashicorpCloudWaypointAddOn, error) {
params := &waypoint_service_v2.WaypointServiceGetAddOn2Params{
func GetAddOnByName(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, defName string) (*waypoint_models.HashicorpCloudWaypointAddOn, error) {
params := &waypoint_service.WaypointServiceGetAddOn2Params{
AddOnName: defName,
NamespaceLocationOrganizationID: loc.OrganizationID,
NamespaceLocationProjectID: loc.ProjectID,
Expand All @@ -134,8 +134,8 @@ func GetAddOnByName(ctx context.Context, client *Client, loc *sharedmodels.Hashi
}

// GetAddOnByID will retrieve an add-on by ID
func GetAddOnByID(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, defID string) (*waypoint_models_v2.HashicorpCloudWaypointAddOn, error) {
params := &waypoint_service_v2.WaypointServiceGetAddOnParams{
func GetAddOnByID(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, defID string) (*waypoint_models.HashicorpCloudWaypointAddOn, error) {
params := &waypoint_service.WaypointServiceGetAddOnParams{
AddOnID: defID,
NamespaceLocationOrganizationID: loc.OrganizationID,
NamespaceLocationProjectID: loc.ProjectID,
Expand All @@ -148,8 +148,8 @@ func GetAddOnByID(ctx context.Context, client *Client, loc *sharedmodels.Hashico
return getResp.GetPayload().AddOn, nil
}

func GetInputVariables(ctx context.Context, client *Client, workspaceName string, loc *sharedmodels.HashicorpCloudLocationLocation) ([]*waypoint_models_v2.HashicorpCloudWaypointInputVariable, error) {
params := &waypoint_service_v2.WaypointServiceGetTFRunStatusParams{
func GetInputVariables(ctx context.Context, client *Client, workspaceName string, loc *sharedmodels.HashicorpCloudLocationLocation) ([]*waypoint_models.HashicorpCloudWaypointInputVariable, error) {
params := &waypoint_service.WaypointServiceGetTFRunStatusParams{
WorkspaceName: workspaceName,
NamespaceLocationOrganizationID: loc.OrganizationID,
NamespaceLocationProjectID: loc.ProjectID,
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/waypoint/data_source_waypoint_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"

sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models"
waypoint_models_v2 "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
waypoint_models "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
"github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
Expand Down Expand Up @@ -142,7 +142,7 @@ func (d *DataSourceAction) Read(ctx context.Context, req datasource.ReadRequest,
ProjectID: projectID,
}

var actionModel *waypoint_models_v2.HashicorpCloudWaypointActionConfig
var actionModel *waypoint_models.HashicorpCloudWaypointActionConfig
var err error

actionModel, err = clients.GetAction(ctx, client, loc, data.ID.ValueString(), data.Name.ValueString())
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/waypoint/data_source_waypoint_add_on.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"

sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models"
waypoint_models_v2 "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
waypoint_models "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
"github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
Expand Down Expand Up @@ -214,7 +214,7 @@ func (d *DataSourceAddOn) Read(ctx context.Context, req datasource.ReadRequest,
ProjectID: client.Config.ProjectID,
}

var addOn *waypoint_models_v2.HashicorpCloudWaypointAddOn
var addOn *waypoint_models.HashicorpCloudWaypointAddOn
var err error

if state.ID.IsNull() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"

sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models"
waypoint_models_v2 "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
waypoint_models "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
"github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
Expand Down Expand Up @@ -198,7 +198,7 @@ func (d *DataSourceAddOnDefinition) Read(ctx context.Context, req datasource.Rea
ProjectID: projectID,
}

var definition *waypoint_models_v2.HashicorpCloudWaypointAddOnDefinition
var definition *waypoint_models.HashicorpCloudWaypointAddOnDefinition
var err error

if state.ID.IsNull() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"

sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models"
waypoint_models_v2 "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
waypoint_models "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
"github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
Expand Down Expand Up @@ -190,7 +190,7 @@ func (d *DataSourceApplication) Read(ctx context.Context, req datasource.ReadReq
ProjectID: projectID,
}

var application *waypoint_models_v2.HashicorpCloudWaypointApplication
var application *waypoint_models.HashicorpCloudWaypointApplication
var err error

if data.ID.IsNull() {
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/waypoint/data_source_waypoint_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"

sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models"
waypoint_models_v2 "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
waypoint_models "github.com/hashicorp/hcp-sdk-go/clients/cloud-waypoint-service/preview/2024-11-22/models"
"github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
Expand Down Expand Up @@ -198,7 +198,7 @@ func (d *DataSourceTemplate) Read(ctx context.Context, req datasource.ReadReques
ProjectID: projectID,
}

var appTemplate *waypoint_models_v2.HashicorpCloudWaypointApplicationTemplate
var appTemplate *waypoint_models.HashicorpCloudWaypointApplicationTemplate
var err error

if data.ID.IsNull() {
Expand Down
Loading

0 comments on commit 8906e2c

Please sign in to comment.