Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Grafana client to commit 861284d1ba83 #1405

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/go-openapi/strfmt v0.22.2
github.com/grafana/amixr-api-go-client v0.0.11
github.com/grafana/grafana-com-public-clients/go/gcom v0.0.0-20240301205126-15b8e07d4a10
github.com/grafana/grafana-openapi-client-go v0.0.0-20240131162504-9263d72bd697
github.com/grafana/grafana-openapi-client-go v0.0.0-20240306142804-861284d1ba83
github.com/grafana/machine-learning-go-client v0.5.0
github.com/grafana/slo-openapi-client/go v0.0.0-20240112175006-de02e75b9d73
github.com/grafana/synthetic-monitoring-agent v0.21.0
Expand Down Expand Up @@ -47,8 +47,8 @@ require (
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/loads v0.21.5 // indirect
github.com/go-openapi/spec v0.20.14 // indirect
github.com/go-openapi/swag v0.22.9 // indirect
github.com/go-openapi/validate v0.23.0 // indirect
github.com/go-openapi/swag v0.22.10 // indirect
github.com/go-openapi/validate v0.23.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ github.com/go-openapi/strfmt v0.22.2 h1:DPYOrm6gexCfZZfXUaXFS4+Jw6HAaIIG0SZ5630f
github.com/go-openapi/strfmt v0.22.2/go.mod h1:HB/b7TCm91rno75Dembc1dFW/0FPLk5CEXsoF9ReNc4=
github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE=
github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE=
github.com/go-openapi/swag v0.22.10 h1:4y86NVn7Z2yYd6pfS4Z+Nyh3aAUL3Nul+LMbhFKy0gA=
github.com/go-openapi/swag v0.22.10/go.mod h1:Cnn8BYtRlx6BNE3DPN86f/xkapGIcLWzh3CLEb4C1jI=
github.com/go-openapi/validate v0.23.0 h1:2l7PJLzCis4YUGEoW6eoQw3WhyM65WSIcjX6SQnlfDw=
github.com/go-openapi/validate v0.23.0/go.mod h1:EeiAZ5bmpSIOJV1WLfyYF9qp/B1ZgSaEpHTJHtN5cbE=
github.com/go-openapi/validate v0.23.1 h1:3YlF+7NP/pKpaZrSxB88oeVbIuCYlWPGKVMWvPcBMYw=
github.com/go-openapi/validate v0.23.1/go.mod h1:DYvS/pv2Y65SE4hB6Tx+kFC+gS9sPKbqYbY1iwG6z7k=
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand All @@ -100,6 +104,8 @@ github.com/grafana/grafana-com-public-clients/go/gcom v0.0.0-20240301205126-15b8
github.com/grafana/grafana-com-public-clients/go/gcom v0.0.0-20240301205126-15b8e07d4a10/go.mod h1:6sYY1qgwYfSDNQhKQA0tar8Oc38cIGfyqwejhxoOsPs=
github.com/grafana/grafana-openapi-client-go v0.0.0-20240131162504-9263d72bd697 h1:pqQoKCVWXVtPwgCjFcCtuWiElkSNv1a97uUjiYEUl0k=
github.com/grafana/grafana-openapi-client-go v0.0.0-20240131162504-9263d72bd697/go.mod h1:EapKj5Z1OKDssvRofVwD8XEuJtZUaysLWPFFM2QoK0Q=
github.com/grafana/grafana-openapi-client-go v0.0.0-20240306142804-861284d1ba83 h1:n5vecnZOTpRAZu7rIyNmg54k860JPvAuMvnz2AYQD0E=
github.com/grafana/grafana-openapi-client-go v0.0.0-20240306142804-861284d1ba83/go.mod h1:FiVsMOTtVuo/Ajmt1efuk3/KmDpFQ3qMurQf7e6HwQg=
github.com/grafana/machine-learning-go-client v0.5.0 h1:Q1K+MPSy8vfMm2jsk3WQ7O77cGr2fM5hxwtPSoPc5NU=
github.com/grafana/machine-learning-go-client v0.5.0/go.mod h1:QFfZz8NkqVF8++skjkKQXJEZfpCYd8S0yTWJUpsLLTA=
github.com/grafana/slo-openapi-client/go v0.0.0-20240112175006-de02e75b9d73 h1:E5vAeB5q1H3BVeNhtd1dI8RubucJdPwpx/ElNtKD3ls=
Expand Down
16 changes: 8 additions & 8 deletions internal/resources/grafana/resource_alerting_mute_timing.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func suppressMonthDiff(k, oldValue, newValue string, d *schema.ResourceData) boo
return oldNormalized == newNormalized
}

func packIntervals(nts []*models.TimeInterval) []interface{} {
func packIntervals(nts []*models.TimeIntervalItem) []interface{} {
if nts == nil {
return nil
}
Expand Down Expand Up @@ -240,14 +240,14 @@ func packIntervals(nts []*models.TimeInterval) []interface{} {
return intervals
}

func unpackIntervals(raw []interface{}) []*models.TimeInterval {
func unpackIntervals(raw []interface{}) []*models.TimeIntervalItem {
if raw == nil {
return nil
}

result := make([]*models.TimeInterval, len(raw))
result := make([]*models.TimeIntervalItem, len(raw))
for i, r := range raw {
interval := models.TimeInterval{}
interval := models.TimeIntervalItem{}

block := map[string]interface{}{}
if r != nil {
Expand All @@ -256,7 +256,7 @@ func unpackIntervals(raw []interface{}) []*models.TimeInterval {

if vals, ok := block["times"]; ok && vals != nil {
vals := vals.([]interface{})
interval.Times = make([]*models.TimeIntervalRange, len(vals))
interval.Times = make([]*models.TimeIntervalTimeRange, len(vals))
for i := range vals {
interval.Times[i] = unpackTimeRange(vals[i])
}
Expand Down Expand Up @@ -284,16 +284,16 @@ func unpackIntervals(raw []interface{}) []*models.TimeInterval {
return result
}

func packTimeRange(time *models.TimeIntervalRange) interface{} {
func packTimeRange(time *models.TimeIntervalTimeRange) interface{} {
return map[string]string{
"start": time.StartTime,
"end": time.EndTime,
}
}

func unpackTimeRange(raw interface{}) *models.TimeIntervalRange {
func unpackTimeRange(raw interface{}) *models.TimeIntervalTimeRange {
vals := raw.(map[string]interface{})
return &models.TimeIntervalRange{
return &models.TimeIntervalTimeRange{
StartTime: vals["start"].(string),
EndTime: vals["end"].(string),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestAccMuteTiming_AllTime(t *testing.T) {
testutils.CheckOSSTestsEnabled(t, ">9.0.0")

var mt models.MuteTimeInterval
name := "My Mute Timing"
name := "My-Mute-Timing"

resource.ParallelTest(t, resource.TestCase{
ProviderFactories: testutils.ProviderFactories,
Expand Down
2 changes: 1 addition & 1 deletion internal/resources/grafana/resource_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func createUser(meta interface{}, user string) (int64, error) {
Name: user,
Login: user,
Email: user,
Password: pass,
Password: models.Password(pass),
}
resp, err := client.AdminUsers.AdminCreateUser(&u)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/resources/grafana/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func CreateUser(ctx context.Context, d *schema.ResourceData, meta interface{}) d
Email: d.Get("email").(string),
Name: d.Get("name").(string),
Login: d.Get("login").(string),
Password: d.Get("password").(string),
Password: models.Password(d.Get("password").(string)),
}
resp, err := client.AdminUsers.AdminCreateUser(&user)
if err != nil {
Expand Down Expand Up @@ -123,7 +123,7 @@ func UpdateUser(ctx context.Context, d *schema.ResourceData, meta interface{}) d
return diag.FromErr(err)
}
if d.HasChange("password") {
f := models.AdminUpdateUserPasswordForm{Password: d.Get("password").(string)}
f := models.AdminUpdateUserPasswordForm{Password: models.Password(d.Get("password").(string))}
if _, err = client.AdminUsers.AdminUpdateUserPassword(id, &f); err != nil {
return diag.FromErr(err)
}
Expand Down
Loading