Skip to content

Commit

Permalink
Don't actually need company uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
danafallon committed Aug 6, 2024
1 parent 77fa127 commit 90f6d98
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion docs/resources/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Artie Deployment resource

### Read-Only

- `company_uuid` (String)
- `uuid` (String)

<a id="nestedatt--destination_config"></a>
Expand Down
1 change: 0 additions & 1 deletion docs/resources/destination.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Artie Destination resource

### Read-Only

- `company_uuid` (String)
- `ssh_tunnel_uuid` (String)
- `uuid` (String)

Expand Down
6 changes: 3 additions & 3 deletions internal/provider/deployment_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func (r *DeploymentResource) Schema(ctx context.Context, req resource.SchemaRequ
resp.Schema = schema.Schema{
MarkdownDescription: "Artie Deployment resource",
Attributes: map[string]schema.Attribute{
"uuid": schema.StringAttribute{Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}},
"company_uuid": schema.StringAttribute{Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}},
"uuid": schema.StringAttribute{Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}},
// "company_uuid": schema.StringAttribute{Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}},
"name": schema.StringAttribute{Required: true},
"status": schema.StringAttribute{Computed: true, Optional: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}},
"destination_uuid": schema.StringAttribute{Computed: true, Optional: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}},
Expand Down Expand Up @@ -167,7 +167,7 @@ func (r *DeploymentResource) Create(ctx context.Context, req resource.CreateRequ
// from the API response of the newly created deployment
model := models.DeploymentResourceToAPIModel(data)
model.UUID = deployment.UUID
model.CompanyUUID = deployment.CompanyUUID
// model.CompanyUUID = deployment.CompanyUUID
model.Status = deployment.Status

// Second API request: update the newly created deployment
Expand Down
1 change: 0 additions & 1 deletion internal/provider/destination_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func (r *DestinationResource) Schema(ctx context.Context, req resource.SchemaReq
MarkdownDescription: "Artie Destination resource",
Attributes: map[string]schema.Attribute{
"uuid": schema.StringAttribute{Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}},
"company_uuid": schema.StringAttribute{Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}},
"ssh_tunnel_uuid": schema.StringAttribute{Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}},
"type": schema.StringAttribute{Required: true},
"label": schema.StringAttribute{Optional: true},
Expand Down
1 change: 0 additions & 1 deletion internal/provider/models/deployment_api_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ type DeploymentAPIResponse struct {

type DeploymentAPIModel struct {
UUID string `json:"uuid"`
CompanyUUID string `json:"companyUUID"`
Name string `json:"name"`
Status string `json:"status"`
DestinationUUID string `json:"destinationUUID"`
Expand Down
1 change: 0 additions & 1 deletion internal/provider/models/deployment_resource_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const (

type DeploymentResourceModel struct {
UUID types.String `tfsdk:"uuid"`
CompanyUUID types.String `tfsdk:"company_uuid"`
Name types.String `tfsdk:"name"`
Status types.String `tfsdk:"status"`
DestinationUUID types.String `tfsdk:"destination_uuid"`
Expand Down
1 change: 0 additions & 1 deletion internal/provider/models/destination_api_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package models

type DestinationAPIModel struct {
UUID string `json:"uuid"`
CompanyUUID string `json:"companyUUID"`
Type string `json:"name"`
Label string `json:"label"`
SSHTunnelUUID string `json:"sshTunnelUUID"`
Expand Down
1 change: 0 additions & 1 deletion internal/provider/models/destination_resource_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const (

type DestinationResourceModel struct {
UUID types.String `tfsdk:"uuid"`
CompanyUUID types.String `tfsdk:"company_uuid"`
SSHTunnelUUID types.String `tfsdk:"ssh_tunnel_uuid"`
Type types.String `tfsdk:"type"`
Label types.String `tfsdk:"label"`
Expand Down
2 changes: 0 additions & 2 deletions internal/provider/models/translate_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

func DeploymentAPIToResourceModel(apiModel DeploymentAPIModel, resourceModel *DeploymentResourceModel) {
resourceModel.UUID = types.StringValue(apiModel.UUID)
resourceModel.CompanyUUID = types.StringValue(apiModel.CompanyUUID)
resourceModel.Name = types.StringValue(apiModel.Name)
resourceModel.Status = types.StringValue(apiModel.Status)
resourceModel.DestinationUUID = types.StringValue(apiModel.DestinationUUID)
Expand Down Expand Up @@ -75,7 +74,6 @@ func DeploymentResourceToAPIModel(resourceModel DeploymentResourceModel) Deploym

apiModel := DeploymentAPIModel{
UUID: resourceModel.UUID.ValueString(),
CompanyUUID: resourceModel.CompanyUUID.ValueString(),
Name: resourceModel.Name.ValueString(),
Status: resourceModel.Status.ValueString(),
DestinationUUID: resourceModel.DestinationUUID.ValueString(),
Expand Down
2 changes: 0 additions & 2 deletions internal/provider/models/translate_destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

func DestinationAPIToResourceModel(apiModel DestinationAPIModel, resourceModel *DestinationResourceModel) {
resourceModel.UUID = types.StringValue(apiModel.UUID)
resourceModel.CompanyUUID = types.StringValue(apiModel.CompanyUUID)
resourceModel.Type = types.StringValue(apiModel.Type)
resourceModel.Label = types.StringValue(apiModel.Label)
resourceModel.SSHTunnelUUID = types.StringValue(apiModel.SSHTunnelUUID)
Expand Down Expand Up @@ -45,7 +44,6 @@ func DestinationResourceToAPIModel(resourceModel DestinationResourceModel) Desti
}
apiModel := DestinationAPIModel{
UUID: resourceModel.UUID.ValueString(),
CompanyUUID: resourceModel.CompanyUUID.ValueString(),
Type: resourceModel.Type.ValueString(),
Label: resourceModel.Label.ValueString(),
SSHTunnelUUID: sshTunnelUUID,
Expand Down

0 comments on commit 90f6d98

Please sign in to comment.