@@ -32,7 +32,6 @@ func UsageToString(u *key_manager.KeyUsage) string {
3232 return ""
3333}
3434
35- // ExtractRegionAndKeyID parses an ID of the form "region/key_id" and returns the region and key ID.
3635func ExtractRegionAndKeyID (id string ) (scw.Region , string , error ) {
3736 parts := strings .SplitN (id , "/" , 2 )
3837 if len (parts ) != 2 {
@@ -53,7 +52,6 @@ func newKeyManagerAPI(d *schema.ResourceData, m any) (*key_manager.API, scw.Regi
5352 return api , region , nil
5453}
5554
56- // NewKeyManagerAPIWithRegionAndID returns a Key Manager API client, region, and key ID from meta and a composite ID.
5755func NewKeyManagerAPIWithRegionAndID (m any , id string ) (* key_manager.API , scw.Region , string , error ) {
5856 region , keyID , err := ExtractRegionAndKeyID (id )
5957 if err != nil {
@@ -65,9 +63,7 @@ func NewKeyManagerAPIWithRegionAndID(m any, id string) (*key_manager.API, scw.Re
6563 return client , region , keyID , nil
6664}
6765
68- // ExpandKeyUsage converts a usage string to a *key_manager.KeyUsage struct for API requests.
6966func ExpandKeyUsage (usage string ) * key_manager.KeyUsage {
70- // You can extend this switch if you want to support more algorithms in the future
7167 switch usage {
7268 case "symmetric_encryption" :
7369 alg := key_manager .KeyAlgorithmSymmetricEncryptionAes256Gcm
@@ -86,7 +82,6 @@ func ExpandKeyUsage(usage string) *key_manager.KeyUsage {
8682 }
8783}
8884
89- // ExpandKeyRotationPolicy converts a Terraform rotation_policy value to a *key_manager.KeyRotationPolicy.
9085func ExpandKeyRotationPolicy (v any ) (* key_manager.KeyRotationPolicy , error ) {
9186 list , ok := v .([]any )
9287 if ! ok || len (list ) == 0 {
@@ -113,7 +108,6 @@ func ExpandKeyRotationPolicy(v any) (*key_manager.KeyRotationPolicy, error) {
113108 }, nil
114109}
115110
116- // FlattenKeyRotationPolicy converts a *key_manager.KeyRotationPolicy to a []map[string]any for Terraform.
117111func FlattenKeyRotationPolicy (rp * key_manager.KeyRotationPolicy ) []map [string ]any {
118112 if rp == nil {
119113 return nil
0 commit comments