Update SDK dependency (#177)
* Update dependencies * Update dependencies * Update dependencies * Update dependencies --------- Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
parent
506d1afdc2
commit
c7effac5c7
62 changed files with 382 additions and 382 deletions
|
|
@ -330,7 +330,7 @@ func testAccCheckArgusDestroy(s *terraform.State) error {
|
|||
instancesToDestroy = append(instancesToDestroy, instanceId)
|
||||
}
|
||||
|
||||
instancesResp, err := client.GetInstances(ctx, testutil.ProjectId).Execute()
|
||||
instancesResp, err := client.ListInstances(ctx, testutil.ProjectId).Execute()
|
||||
if err != nil {
|
||||
return fmt.Errorf("getting instancesResp: %w", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ func (r *credentialResource) Create(ctx context.Context, req resource.CreateRequ
|
|||
projectId := model.ProjectId.ValueString()
|
||||
instanceId := model.InstanceId.ValueString()
|
||||
|
||||
got, err := r.client.CreateCredential(ctx, instanceId, projectId).Execute()
|
||||
got, err := r.client.CreateCredentials(ctx, instanceId, projectId).Execute()
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error creating credential", fmt.Sprintf("Calling API: %v", err))
|
||||
return
|
||||
|
|
@ -167,7 +167,7 @@ func (r *credentialResource) Create(ctx context.Context, req resource.CreateRequ
|
|||
tflog.Info(ctx, "Argus credential created")
|
||||
}
|
||||
|
||||
func mapFields(r *argus.Credential, model *Model) error {
|
||||
func mapFields(r *argus.Credentials, model *Model) error {
|
||||
if r == nil {
|
||||
return fmt.Errorf("response input is nil")
|
||||
}
|
||||
|
|
@ -206,7 +206,7 @@ func (r *credentialResource) Read(ctx context.Context, req resource.ReadRequest,
|
|||
projectId := model.ProjectId.ValueString()
|
||||
instanceId := model.InstanceId.ValueString()
|
||||
userName := model.Username.ValueString()
|
||||
_, err := r.client.GetCredential(ctx, instanceId, projectId, userName).Execute()
|
||||
_, err := r.client.GetCredentials(ctx, instanceId, projectId, userName).Execute()
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error reading credential", fmt.Sprintf("Calling API: %v", err))
|
||||
return
|
||||
|
|
@ -236,7 +236,7 @@ func (r *credentialResource) Delete(ctx context.Context, req resource.DeleteRequ
|
|||
projectId := model.ProjectId.ValueString()
|
||||
instanceId := model.InstanceId.ValueString()
|
||||
userName := model.Username.ValueString()
|
||||
_, err := r.client.DeleteCredential(ctx, instanceId, projectId, userName).Execute()
|
||||
_, err := r.client.DeleteCredentials(ctx, instanceId, projectId, userName).Execute()
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting credential", fmt.Sprintf("Calling API: %v", err))
|
||||
return
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@ import (
|
|||
func TestMapFields(t *testing.T) {
|
||||
tests := []struct {
|
||||
description string
|
||||
input *argus.Credential
|
||||
input *argus.Credentials
|
||||
expected Model
|
||||
isValid bool
|
||||
}{
|
||||
{
|
||||
"ok",
|
||||
&argus.Credential{
|
||||
&argus.Credentials{
|
||||
Username: utils.Ptr("username"),
|
||||
Password: utils.Ptr("password"),
|
||||
},
|
||||
|
|
@ -39,7 +39,7 @@ func TestMapFields(t *testing.T) {
|
|||
},
|
||||
{
|
||||
"response_fields_nil_fail",
|
||||
&argus.Credential{
|
||||
&argus.Credentials{
|
||||
Password: nil,
|
||||
Username: nil,
|
||||
},
|
||||
|
|
@ -48,7 +48,7 @@ func TestMapFields(t *testing.T) {
|
|||
},
|
||||
{
|
||||
"no_resource_id",
|
||||
&argus.Credential{},
|
||||
&argus.Credentials{},
|
||||
Model{},
|
||||
false,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ func (r *instanceResource) ImportState(ctx context.Context, req resource.ImportS
|
|||
tflog.Info(ctx, "Argus instance state imported")
|
||||
}
|
||||
|
||||
func mapFields(ctx context.Context, r *argus.InstanceResponse, model *Model) error {
|
||||
func mapFields(ctx context.Context, r *argus.GetInstanceResponse, model *Model) error {
|
||||
if r == nil {
|
||||
return fmt.Errorf("response input is nil")
|
||||
}
|
||||
|
|
@ -540,7 +540,7 @@ func toUpdatePayload(model *Model) (*argus.UpdateInstancePayload, error) {
|
|||
|
||||
func (r *instanceResource) loadPlanId(ctx context.Context, model *Model) error {
|
||||
projectId := model.ProjectId.ValueString()
|
||||
res, err := r.client.GetPlans(ctx, projectId).Execute()
|
||||
res, err := r.client.ListPlans(ctx, projectId).Execute()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ import (
|
|||
func TestMapFields(t *testing.T) {
|
||||
tests := []struct {
|
||||
description string
|
||||
input *argus.InstanceResponse
|
||||
input *argus.GetInstanceResponse
|
||||
expected Model
|
||||
isValid bool
|
||||
}{
|
||||
{
|
||||
"default_ok",
|
||||
&argus.InstanceResponse{
|
||||
&argus.GetInstanceResponse{
|
||||
Id: utils.Ptr("iid"),
|
||||
},
|
||||
Model{
|
||||
|
|
@ -37,7 +37,7 @@ func TestMapFields(t *testing.T) {
|
|||
},
|
||||
{
|
||||
"values_ok",
|
||||
&argus.InstanceResponse{
|
||||
&argus.GetInstanceResponse{
|
||||
Id: utils.Ptr("iid"),
|
||||
Name: utils.Ptr("name"),
|
||||
PlanName: utils.Ptr("plan1"),
|
||||
|
|
@ -57,7 +57,7 @@ func TestMapFields(t *testing.T) {
|
|||
},
|
||||
{
|
||||
"nullable_fields_ok",
|
||||
&argus.InstanceResponse{
|
||||
&argus.GetInstanceResponse{
|
||||
Id: utils.Ptr("iid"),
|
||||
Name: nil,
|
||||
},
|
||||
|
|
@ -80,7 +80,7 @@ func TestMapFields(t *testing.T) {
|
|||
},
|
||||
{
|
||||
"no_resource_id",
|
||||
&argus.InstanceResponse{},
|
||||
&argus.GetInstanceResponse{},
|
||||
Model{},
|
||||
false,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue