Skip to content

Commit

Permalink
Update containers_job_resource.go
Browse files Browse the repository at this point in the history
  • Loading branch information
JensWalter committed Sep 9, 2024
1 parent 9174e57 commit a95d4d4
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions internal/provider/containers_job_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type containersJobResource struct {
Name types.String `tfsdk:"name"`
ContainerImage types.String `tfsdk:"container_image"`
ContainerPullUser types.String `tfsdk:"container_pull_user"`
ContainerPullPwd types.String `tfsdk:"container_pull_pwd""`
ContainerPullPwd types.String `tfsdk:"container_pull_pwd"`
ScheduleType types.String `tfsdk:"schedule_type"`
ScheduleRepeat types.String `tfsdk:"schedule_repeat"`
ScheduleCron types.String `tfsdk:"schedule_cron"`
Expand All @@ -36,16 +36,15 @@ type containersJobResource struct {
}

type containersJobResponse struct {
Id string `json:"id"`
Name string `json:"name"`
ContainerImage string `json:"containerImage"`
ContainerPullUser string `json:"containerPullUser"`
ContainerPullPwd string `json:"containerPullPwd"`
ScheduleType string `json:"scheduleType"`
ScheduleRepeat string `json:"scheduleRepeat"`
ScheduleCron string `json:"scheduleCron"`
ScheduleCostOptimzation string `json:"scheduleCostOptimzation"`
api_key string
Id string `json:"id"`
Name string `json:"name"`
ContainerImage string `json:"containerImage"`
ContainerPullUser *string `json:"containerPullUser"`
ContainerPullPwd *string `json:"containerPullPwd"`
ScheduleType string `json:"scheduleType"`
ScheduleRepeat *string `json:"scheduleRepeat"`
ScheduleCron *string `json:"scheduleCron"`
ScheduleCostOptimzation *string `json:"scheduleCostOptimzation"`
}

type createJobRequest struct {
Expand Down Expand Up @@ -163,12 +162,12 @@ func (d *containersJobResource) Create(ctx context.Context, req resource.CreateR
plan.Id = types.StringValue(jobResponse.Id)
plan.Name = types.StringValue(jobResponse.Name)
plan.ContainerImage = types.StringValue(jobResponse.ContainerImage)
plan.ContainerPullUser = types.StringValue(jobResponse.ContainerPullUser)
plan.ContainerPullPwd = types.StringValue(jobResponse.ContainerPullPwd)
plan.ContainerPullUser = types.StringPointerValue(jobResponse.ContainerPullUser)
plan.ContainerPullPwd = types.StringPointerValue(jobResponse.ContainerPullPwd)
plan.ScheduleType = types.StringValue(jobResponse.ScheduleType)
plan.ScheduleRepeat = types.StringValue(jobResponse.ScheduleRepeat)
plan.ScheduleCron = types.StringValue(jobResponse.ScheduleCron)
plan.ScheduleCostOptimzation = types.StringValue(jobResponse.ScheduleCostOptimzation)
plan.ScheduleRepeat = types.StringPointerValue(jobResponse.ScheduleRepeat)
plan.ScheduleCron = types.StringPointerValue(jobResponse.ScheduleCron)
plan.ScheduleCostOptimzation = types.StringPointerValue(jobResponse.ScheduleCostOptimzation)

diags = resp.State.Set(ctx, plan)
resp.Diagnostics.Append(diags...)
Expand Down Expand Up @@ -300,12 +299,12 @@ func (d *containersJobResource) Update(ctx context.Context, req resource.UpdateR
plan.Id = types.StringValue(jobResponse.Id)
plan.Name = types.StringValue(jobResponse.Name)
plan.ContainerImage = types.StringValue(jobResponse.ContainerImage)
plan.ContainerPullUser = types.StringValue(jobResponse.ContainerPullUser)
plan.ContainerPullPwd = types.StringValue(jobResponse.ContainerPullPwd)
plan.ContainerPullUser = types.StringPointerValue(jobResponse.ContainerPullUser)
plan.ContainerPullPwd = types.StringPointerValue(jobResponse.ContainerPullPwd)
plan.ScheduleType = types.StringValue(jobResponse.ScheduleType)
plan.ScheduleRepeat = types.StringValue(jobResponse.ScheduleRepeat)
plan.ScheduleCron = types.StringValue(jobResponse.ScheduleCron)
plan.ScheduleCostOptimzation = types.StringValue(jobResponse.ScheduleCostOptimzation)
plan.ScheduleRepeat = types.StringPointerValue(jobResponse.ScheduleRepeat)
plan.ScheduleCron = types.StringPointerValue(jobResponse.ScheduleCron)
plan.ScheduleCostOptimzation = types.StringPointerValue(jobResponse.ScheduleCostOptimzation)

diags = resp.State.Set(ctx, plan)
resp.Diagnostics.Append(diags...)
Expand Down

0 comments on commit a95d4d4

Please sign in to comment.