Skip to content

Commit

Permalink
Bump client api version to 2024-05-13-00 (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
anekkanti authored Oct 3, 2024
1 parent 09c4790 commit 086f429
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (

const TemporalCloudAPIVersionHeader = "temporal-cloud-api-version"

var TemporalCloudAPIVersion = "2023-10-01-00"
var TemporalCloudAPIVersion = "2024-05-13-00"

// Client is a client for the Temporal Cloud API.
type Client struct {
Expand Down
30 changes: 18 additions & 12 deletions internal/provider/namespace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,19 @@ func (r *namespaceResource) Create(ctx context.Context, req resource.CreateReque
return
}
}
mtls := &namespacev1.MtlsAuthSpec{}
if plan.AcceptedClientCA.ValueString() != "" {
mtls.Enabled = true
mtls.AcceptedClientCa = plan.AcceptedClientCA.ValueString()
mtls.CertificateFilters = certFilters
}
svcResp, err := r.client.CloudService().CreateNamespace(ctx, &cloudservicev1.CreateNamespaceRequest{
Spec: &namespacev1.NamespaceSpec{
Name: plan.Name.ValueString(),
Regions: regions,
RetentionDays: int32(plan.RetentionDays.ValueInt64()),
MtlsAuth: &namespacev1.MtlsAuthSpec{
AcceptedClientCa: plan.AcceptedClientCA.ValueString(),
CertificateFilters: certFilters,
},
CodecServer: codecServer,
MtlsAuth: mtls,
CodecServer: codecServer,
},
})
if err != nil {
Expand Down Expand Up @@ -360,16 +363,19 @@ func (r *namespaceResource) Update(ctx context.Context, req resource.UpdateReque
if resp.Diagnostics.HasError() {
return
}
mtls := &namespacev1.MtlsAuthSpec{}
if plan.AcceptedClientCA.ValueString() != "" {
mtls.Enabled = true
mtls.AcceptedClientCa = plan.AcceptedClientCA.ValueString()
mtls.CertificateFilters = certFilters
}
svcResp, err := r.client.CloudService().UpdateNamespace(ctx, &cloudservicev1.UpdateNamespaceRequest{
Namespace: plan.ID.ValueString(),
Spec: &namespacev1.NamespaceSpec{
Name: plan.Name.ValueString(),
Regions: regions,
RetentionDays: int32(plan.RetentionDays.ValueInt64()),
MtlsAuth: &namespacev1.MtlsAuthSpec{
AcceptedClientCa: plan.AcceptedClientCA.ValueString(),
CertificateFilters: certFilters,
},
Name: plan.Name.ValueString(),
Regions: regions,
RetentionDays: int32(plan.RetentionDays.ValueInt64()),
MtlsAuth: mtls,
CodecServer: codecServer,
CustomSearchAttributes: currentNs.GetNamespace().GetSpec().GetCustomSearchAttributes(),
},
Expand Down
10 changes: 5 additions & 5 deletions internal/provider/namespace_search_attribute_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ PEM
resource "temporalcloud_namespace_search_attribute" "custom_search_attribute" {
namespace_id = temporalcloud_namespace.terraform.id
name = "%s"
type = "Text"
type = "text"
}
resource "temporalcloud_namespace_search_attribute" "custom_search_attribute2" {
namespace_id = temporalcloud_namespace.terraform.id
name = "CustomSearchAttribute2"
type = "Text"
type = "text"
}
resource "temporalcloud_namespace_search_attribute" "custom_search_attribute3" {
namespace_id = temporalcloud_namespace.terraform.id
name = "CustomSearchAttribute3"
type = "Text"
type = "text"
}`, name, saName)
}

Expand Down Expand Up @@ -102,7 +102,7 @@ PEM
resource "temporalcloud_namespace_search_attribute" "custom_search_attribute" {
namespace_id = temporalcloud_namespace.terraform.id
name = "%s"
type = "Text"
type = "text"
}
`, name, saName)
}
Expand Down Expand Up @@ -159,7 +159,7 @@ PEM
resource "temporalcloud_namespace_search_attribute" "custom_search_attribute" {
namespace_id = temporalcloud_namespace.terraform.id
name = "CustomSearchAttribute"
type = "Text"
type = "text"
}
`, name, retentionDays)
}
Expand Down

0 comments on commit 086f429

Please sign in to comment.