Skip to content

Commit

Permalink
changes from GoLand
Browse files Browse the repository at this point in the history
  • Loading branch information
Taimoor Ahmad committed Jan 21, 2024
1 parent 504cdd3 commit 511e334
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 63 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ website/node_modules
.idea
*.iml
*.test
*.iml

website/vendor

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Contributing

1. [About this document](#about-this-document)
3. [Getting the code](#getting-the-code)
4. [Setting up an environment](#setting-up-an-environment)
5. [Local development](#local-development)
7. [Submitting a Pull Request](#submitting-a-pull-request)
2. [Getting the code](#getting-the-code)
3. [Setting up an environment](#setup-a-terraform-workspace)
4. [Local development](#setting-up-an-environment-for-local-development)
5. [Submitting a Pull Request](#submitting-a-pull-request)

## About this document

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<a href="https://github.com/OpsLevel/terraform-provider-opslevel/blob/main/LICENSE" alt="License">
<img src="https://img.shields.io/github/license/OpsLevel/terraform-provider-opslevel.svg" /></a>
<a href="http://golang.org" alt="Made With Go">
<a href="https://go.dev" alt="Made With Go">
<img src="https://img.shields.io/github/go-mod/go-version/OpsLevel/terraform-provider-opslevel" /></a>
<a href="https://GitHub.com/OpsLevel/terraform-provider-opslevel/releases/" alt="Release">
<img src="https://img.shields.io/github/v/release/OpsLevel/terraform-provider-opslevel?include_prereleases" /></a>
Expand Down
8 changes: 1 addition & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.21

require (
github.com/hashicorp/terraform-plugin-sdk v1.17.2
github.com/mitchellh/mapstructure v1.5.0
github.com/opslevel/opslevel-go/v2024 v2024.1.13
github.com/rs/zerolog v1.31.0
)
Expand Down Expand Up @@ -40,7 +41,6 @@ require (
github.com/gosimple/slug v1.13.1 // indirect
github.com/gosimple/unidecode v1.0.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.7.3 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
Expand All @@ -50,11 +50,7 @@ require (
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.4.0 // indirect
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/hashicorp/terraform-exec v0.17.2 // indirect
github.com/hashicorp/terraform-json v0.14.0 // indirect
github.com/hashicorp/terraform-plugin-docs v0.13.0 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/hasura/go-graphql-client v0.10.2 // indirect
Expand All @@ -70,13 +66,11 @@ require (
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/opslevel/moredefaults v0.0.0-20240112142637-078c8ff8ba9c // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/relvacode/iso8601 v1.3.0 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
Expand Down
23 changes: 0 additions & 23 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBa
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
Expand Down Expand Up @@ -288,12 +286,8 @@ github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aev
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0=
github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw=
github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
Expand Down Expand Up @@ -429,7 +423,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down Expand Up @@ -459,13 +452,10 @@ github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hc-install v0.4.0 h1:cZkRFr1WVa0Ty6x5fTvL1TuO1flul231rWkGH92oYYk=
github.com/hashicorp/hc-install v0.4.0/go.mod h1:5d155H8EC5ewegao9A4PUTMNPZaq+TbOzkJJZ4vrXeI=
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws=
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90=
Expand All @@ -477,13 +467,7 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 h1:Pc5TCv9mbxFN6UVX0LH6CpQrdTM5YjbVI2w15237Pjk=
github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A=
github.com/hashicorp/terraform-exec v0.13.3/go.mod h1:SSg6lbUsVB3DmFyCPjBPklqf6EYGX0TlQ6QTxOlikDU=
github.com/hashicorp/terraform-exec v0.17.2 h1:EU7i3Fh7vDUI9nNRdMATCEfnm9axzTnad8zszYZ73Go=
github.com/hashicorp/terraform-exec v0.17.2/go.mod h1:tuIbsL2l4MlwwIZx9HPM+LOV9vVyEfBYu2GsO1uH3/8=
github.com/hashicorp/terraform-json v0.10.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE=
github.com/hashicorp/terraform-json v0.14.0 h1:sh9iZ1Y8IFJLx+xQiKHGud6/TSUCM0N8e17dKDpqV7s=
github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM=
github.com/hashicorp/terraform-plugin-docs v0.13.0 h1:6e+VIWsVGb6jYJewfzq2ok2smPzZrt1Wlm9koLeKazY=
github.com/hashicorp/terraform-plugin-docs v0.13.0/go.mod h1:W0oCmHAjIlTHBbvtppWHe8fLfZ2BznQbuv8+UD8OucQ=
github.com/hashicorp/terraform-plugin-sdk v1.17.2 h1:V7DUR3yBWFrVB9z3ddpY7kiYVSsq4NYR67NiTs93NQo=
github.com/hashicorp/terraform-plugin-sdk v1.17.2/go.mod h1:wkvldbraEMkz23NxkkAsFS88A1R9eUiooiaUZyS6TLw=
github.com/hashicorp/terraform-plugin-test/v2 v2.2.1/go.mod h1:eZ9JL3O69Cb71Skn6OhHyj17sLmHRb+H6VrDcJjKrYU=
Expand Down Expand Up @@ -541,7 +525,6 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
Expand Down Expand Up @@ -614,9 +597,6 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
Expand Down Expand Up @@ -673,7 +653,6 @@ github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE
github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
github.com/zclconf/go-cty v1.8.2/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA=
github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI=
Expand Down Expand Up @@ -702,7 +681,6 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
Expand Down Expand Up @@ -894,7 +872,6 @@ golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
12 changes: 6 additions & 6 deletions opslevel/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func expandPredicateUpdate(d *schema.ResourceData, key string) *opslevel.Predica
}

func flattenPredicate(input *opslevel.Predicate) []map[string]string {
output := []map[string]string{}
output := make([]map[string]string, 0)

Check warning on line 203 in opslevel/common.go

View check run for this annotation

Codecov / codecov/patch

opslevel/common.go#L203

Added line #L203 was not covered by tests
if input != nil {
output = append(output, map[string]string{
"type": string(input.Type),
Expand Down Expand Up @@ -305,23 +305,23 @@ func flattenTag(tag opslevel.Tag) string {
}

func flattenTagArray(tags []opslevel.Tag) []string {
output := []string{}
output := make([]string, 0)

Check warning on line 308 in opslevel/common.go

View check run for this annotation

Codecov / codecov/patch

opslevel/common.go#L308

Added line #L308 was not covered by tests
for _, tag := range tags {
output = append(output, flattenTag(tag))
}
return output
}

func flattenServiceRepositoriesArray(repositories *opslevel.ServiceRepositoryConnection) []string {
output := []string{}
output := make([]string, 0)

Check warning on line 316 in opslevel/common.go

View check run for this annotation

Codecov / codecov/patch

opslevel/common.go#L316

Added line #L316 was not covered by tests
for _, rep := range repositories.Edges {
output = append(output, string(rep.Node.Id))
}
return output
}

func mapMembershipsArray(members *opslevel.TeamMembershipConnection) []map[string]string {
output := []map[string]string{}
output := make([]map[string]string, 0)

Check warning on line 324 in opslevel/common.go

View check run for this annotation

Codecov / codecov/patch

opslevel/common.go#L324

Added line #L324 was not covered by tests
for _, membership := range members.Nodes {
asMap := make(map[string]string)
asMap["email"] = membership.User.Email
Expand All @@ -332,7 +332,7 @@ func mapMembershipsArray(members *opslevel.TeamMembershipConnection) []map[strin
}

func mapServiceProperties(properties *opslevel.ServicePropertiesConnection) []map[string]any {
output := []map[string]any{}
output := make([]map[string]any, 0)

Check warning on line 335 in opslevel/common.go

View check run for this annotation

Codecov / codecov/patch

opslevel/common.go#L335

Added line #L335 was not covered by tests
for _, property := range properties.Nodes {
asMap := make(map[string]any)
asMap["definition"] = string(property.Definition.Id)
Expand All @@ -348,7 +348,7 @@ func mapServiceProperties(properties *opslevel.ServicePropertiesConnection) []ma
}

func flattenTeamsArray(teams *opslevel.TeamConnection) []string {
output := []string{}
output := make([]string, 0)

Check warning on line 351 in opslevel/common.go

View check run for this annotation

Codecov / codecov/patch

opslevel/common.go#L351

Added line #L351 was not covered by tests
for _, team := range teams.Nodes {
output = append(output, team.Alias)
}
Expand Down
4 changes: 2 additions & 2 deletions opslevel/resource_opslevel_check_custom_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func resourceCheckCustomEventCreate(d *schema.ResourceData, client *opslevel.Cli
input := opslevel.NewCheckCreateInputTypeOf[opslevel.CheckCustomEventCreateInput](checkCreateInput)

input.IntegrationId = *opslevel.NewID(d.Get("integration").(string))
input.PassPending = opslevel.Bool(d.Get("pass_pending").(bool))
input.PassPending = opslevel.RefTo(d.Get("pass_pending").(bool))

Check warning on line 58 in opslevel/resource_opslevel_check_custom_event.go

View check run for this annotation

Codecov / codecov/patch

opslevel/resource_opslevel_check_custom_event.go#L58

Added line #L58 was not covered by tests
input.ServiceSelector = d.Get("service_selector").(string)
input.SuccessCondition = d.Get("success_condition").(string)
input.ResultMessage = opslevel.RefOf(d.Get("message").(string))
Expand Down Expand Up @@ -114,7 +114,7 @@ func resourceCheckCustomEventUpdate(d *schema.ResourceData, client *opslevel.Cli
if d.HasChange("integration") {
input.IntegrationId = opslevel.NewID(d.Get("integration").(string))
}
input.PassPending = opslevel.Bool(d.Get("pass_pending").(bool))
input.PassPending = opslevel.RefTo(d.Get("pass_pending").(bool))

Check warning on line 117 in opslevel/resource_opslevel_check_custom_event.go

View check run for this annotation

Codecov / codecov/patch

opslevel/resource_opslevel_check_custom_event.go#L117

Added line #L117 was not covered by tests
if d.HasChange("service_selector") {
input.ServiceSelector = opslevel.RefOf(d.Get("service_selector").(string))
}
Expand Down
2 changes: 1 addition & 1 deletion opslevel/resource_opslevel_check_has_recent_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func resourceCheckHasRecentDeployUpdate(d *schema.ResourceData, client *opslevel
checkUpdateInput := getCheckUpdateInputFrom(d)
input := opslevel.NewCheckUpdateInputTypeOf[opslevel.CheckHasRecentDeployUpdateInput](checkUpdateInput)
if d.HasChange("days") {
input.Days = opslevel.NewInt(d.Get("days").(int))
input.Days = opslevel.RefTo(d.Get("days").(int))

Check warning on line 65 in opslevel/resource_opslevel_check_has_recent_deploy.go

View check run for this annotation

Codecov / codecov/patch

opslevel/resource_opslevel_check_has_recent_deploy.go#L65

Added line #L65 was not covered by tests
}

_, err := client.UpdateCheckHasRecentDeploy(*input)
Expand Down
2 changes: 1 addition & 1 deletion opslevel/resource_opslevel_check_manual.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func expandUpdateFrequencyOnUpdate(d *schema.ResourceData, key string) *opslevel
}

func flattenUpdateFrequency(input *opslevel.ManualCheckFrequency) []map[string]interface{} {
output := []map[string]interface{}{}
output := make([]map[string]interface{}, 0)

Check warning on line 87 in opslevel/resource_opslevel_check_manual.go

View check run for this annotation

Codecov / codecov/patch

opslevel/resource_opslevel_check_manual.go#L87

Added line #L87 was not covered by tests
if input != nil {
output = append(output, map[string]interface{}{
"starting_data": input.StartingDate.Format(time.RFC3339),
Expand Down
2 changes: 1 addition & 1 deletion opslevel/resource_opslevel_check_repository_grep.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func resourceCheckRepositoryGrepCreate(d *schema.ResourceData, client *opslevel.
fileContentsPredicate := expandPredicate(d, "file_contents_predicate")
if fileContentsPredicate == nil {
input.FileContentsPredicate = opslevel.PredicateInput{
Type: opslevel.PredicateTypeEnum("exists"),
Type: "exists",

Check warning on line 48 in opslevel/resource_opslevel_check_repository_grep.go

View check run for this annotation

Codecov / codecov/patch

opslevel/resource_opslevel_check_repository_grep.go#L48

Added line #L48 was not covered by tests
}
}

Expand Down
4 changes: 2 additions & 2 deletions opslevel/resource_opslevel_check_service_ownership.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func resourceCheckServiceOwnershipCreate(d *schema.ResourceData, client *opsleve
checkCreateInput := getCheckCreateInputFrom(d)
input := opslevel.NewCheckCreateInputTypeOf[opslevel.CheckServiceOwnershipCreateInput](checkCreateInput)

input.RequireContactMethod = opslevel.Bool(d.Get("require_contact_method").(bool))
input.RequireContactMethod = opslevel.RefTo(d.Get("require_contact_method").(bool))

Check warning on line 48 in opslevel/resource_opslevel_check_service_ownership.go

View check run for this annotation

Codecov / codecov/patch

opslevel/resource_opslevel_check_service_ownership.go#L48

Added line #L48 was not covered by tests
if value, ok := d.GetOk("contact_method"); ok {
contactMethod := opslevel.ContactType(value.(string))
input.ContactMethod = opslevel.RefOf(string(contactMethod))
Expand Down Expand Up @@ -104,7 +104,7 @@ func resourceCheckServiceOwnershipRead(d *schema.ResourceData, client *opslevel.
func resourceCheckServiceOwnershipUpdate(d *schema.ResourceData, client *opslevel.Client) error {
checkUpdateInput := getCheckUpdateInputFrom(d)
input := opslevel.NewCheckUpdateInputTypeOf[opslevel.CheckServiceOwnershipUpdateInput](checkUpdateInput)
input.RequireContactMethod = opslevel.Bool(d.Get("require_contact_method").(bool))
input.RequireContactMethod = opslevel.RefTo(d.Get("require_contact_method").(bool))

Check warning on line 107 in opslevel/resource_opslevel_check_service_ownership.go

View check run for this annotation

Codecov / codecov/patch

opslevel/resource_opslevel_check_service_ownership.go#L107

Added line #L107 was not covered by tests

if d.HasChange("contact_method") {
contactMethod := opslevel.ContactType(d.Get("contact_method").(string))
Expand Down
4 changes: 2 additions & 2 deletions opslevel/resource_opslevel_integration_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func resourceIntegrationAWSCreate(d *schema.ResourceData, client *opslevel.Clien
Name: opslevel.RefOf(d.Get("name").(string)),
IAMRole: opslevel.RefOf(d.Get("iam_role").(string)),
ExternalID: opslevel.RefOf(d.Get("external_id").(string)),
OwnershipTagOverride: opslevel.Bool(d.Get("ownership_tag_overrides").(bool)),
OwnershipTagOverride: opslevel.RefTo(d.Get("ownership_tag_overrides").(bool)),

Check warning on line 64 in opslevel/resource_opslevel_integration_aws.go

View check run for this annotation

Codecov / codecov/patch

opslevel/resource_opslevel_integration_aws.go#L64

Added line #L64 was not covered by tests
}

input.OwnershipTagKeys = getStringArray(d, "ownership_tag_keys")
Expand Down Expand Up @@ -106,7 +106,7 @@ func resourceIntegrationAWSUpdate(d *schema.ResourceData, client *opslevel.Clien
Name: opslevel.RefOf(d.Get("name").(string)),
IAMRole: opslevel.RefOf(d.Get("iam_role").(string)),
ExternalID: opslevel.RefOf(d.Get("external_id").(string)),
OwnershipTagOverride: opslevel.Bool(d.Get("ownership_tag_overrides").(bool)),
OwnershipTagOverride: opslevel.RefTo(d.Get("ownership_tag_overrides").(bool)),

Check warning on line 109 in opslevel/resource_opslevel_integration_aws.go

View check run for this annotation

Codecov / codecov/patch

opslevel/resource_opslevel_integration_aws.go#L109

Added line #L109 was not covered by tests
}

input.OwnershipTagKeys = getStringArray(d, "ownership_tag_keys")
Expand Down
1 change: 1 addition & 0 deletions opslevel/resource_opslevel_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func resourceRepositoryUpdate(d *schema.ResourceData, client *opslevel.Client) e
return resourceRepositoryRead(d, client)
}

//goland:noinspection GoUnusedParameter
func resourceRepositoryDelete(d *schema.ResourceData, client *opslevel.Client) error {
// No API call to make because the repository is not able to be deleted
d.SetId("")
Expand Down
Loading

0 comments on commit 511e334

Please sign in to comment.