Skip to content

Commit 7c8aed3

Browse files
author
hc-github-team-tf-azure
committed
Updating based on 297d157f0
1 parent 1e4e35b commit 7c8aed3

File tree

11,359 files changed

+749543
-14499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

11,359 files changed

+749543
-14499
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
2+
## `github.com/hashicorp/go-azure-sdk/resource-manager/codesigning/2025-10-13/certificateprofiles` Documentation
3+
4+
The `certificateprofiles` SDK allows for interaction with Azure Resource Manager `codesigning` (API Version `2025-10-13`).
5+
6+
This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs).
7+
8+
### Import Path
9+
10+
```go
11+
import "github.com/hashicorp/go-azure-sdk/resource-manager/codesigning/2025-10-13/certificateprofiles"
12+
```
13+
14+
15+
### Client Initialization
16+
17+
```go
18+
client := certificateprofiles.NewCertificateProfilesClientWithBaseURI("https://management.azure.com")
19+
client.Client.Authorizer = authorizer
20+
```
21+
22+
23+
### Example Usage: `CertificateProfilesClient.Create`
24+
25+
```go
26+
ctx := context.TODO()
27+
id := certificateprofiles.NewCertificateProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "codeSigningAccountName", "certificateProfileName")
28+
29+
payload := certificateprofiles.CertificateProfile{
30+
// ...
31+
}
32+
33+
34+
if err := client.CreateThenPoll(ctx, id, payload); err != nil {
35+
// handle the error
36+
}
37+
```
38+
39+
40+
### Example Usage: `CertificateProfilesClient.Delete`
41+
42+
```go
43+
ctx := context.TODO()
44+
id := certificateprofiles.NewCertificateProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "codeSigningAccountName", "certificateProfileName")
45+
46+
if err := client.DeleteThenPoll(ctx, id); err != nil {
47+
// handle the error
48+
}
49+
```
50+
51+
52+
### Example Usage: `CertificateProfilesClient.Get`
53+
54+
```go
55+
ctx := context.TODO()
56+
id := certificateprofiles.NewCertificateProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "codeSigningAccountName", "certificateProfileName")
57+
58+
read, err := client.Get(ctx, id)
59+
if err != nil {
60+
// handle the error
61+
}
62+
if model := read.Model; model != nil {
63+
// do something with the model/response object
64+
}
65+
```
66+
67+
68+
### Example Usage: `CertificateProfilesClient.ListByCodeSigningAccount`
69+
70+
```go
71+
ctx := context.TODO()
72+
id := certificateprofiles.NewCodeSigningAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "codeSigningAccountName")
73+
74+
// alternatively `client.ListByCodeSigningAccount(ctx, id)` can be used to do batched pagination
75+
items, err := client.ListByCodeSigningAccountComplete(ctx, id)
76+
if err != nil {
77+
// handle the error
78+
}
79+
for _, item := range items {
80+
// do something
81+
}
82+
```
83+
84+
85+
### Example Usage: `CertificateProfilesClient.RevokeCertificate`
86+
87+
```go
88+
ctx := context.TODO()
89+
id := certificateprofiles.NewCertificateProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "codeSigningAccountName", "certificateProfileName")
90+
91+
payload := certificateprofiles.RevokeCertificate{
92+
// ...
93+
}
94+
95+
96+
read, err := client.RevokeCertificate(ctx, id, payload)
97+
if err != nil {
98+
// handle the error
99+
}
100+
if model := read.Model; model != nil {
101+
// do something with the model/response object
102+
}
103+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package certificateprofiles
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
7+
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
8+
)
9+
10+
// Copyright (c) Microsoft Corporation. All rights reserved.
11+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
12+
13+
type CertificateProfilesClient struct {
14+
Client *resourcemanager.Client
15+
}
16+
17+
func NewCertificateProfilesClientWithBaseURI(sdkApi sdkEnv.Api) (*CertificateProfilesClient, error) {
18+
client, err := resourcemanager.NewClient(sdkApi, "certificateprofiles", defaultApiVersion)
19+
if err != nil {
20+
return nil, fmt.Errorf("instantiating CertificateProfilesClient: %+v", err)
21+
}
22+
23+
return &CertificateProfilesClient{
24+
Client: client,
25+
}, nil
26+
}
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
package certificateprofiles
2+
3+
import (
4+
"encoding/json"
5+
"fmt"
6+
"strings"
7+
)
8+
9+
// Copyright (c) Microsoft Corporation. All rights reserved.
10+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
11+
12+
type CertificateProfileStatus string
13+
14+
const (
15+
CertificateProfileStatusActive CertificateProfileStatus = "Active"
16+
CertificateProfileStatusDisabled CertificateProfileStatus = "Disabled"
17+
CertificateProfileStatusSuspended CertificateProfileStatus = "Suspended"
18+
)
19+
20+
func PossibleValuesForCertificateProfileStatus() []string {
21+
return []string{
22+
string(CertificateProfileStatusActive),
23+
string(CertificateProfileStatusDisabled),
24+
string(CertificateProfileStatusSuspended),
25+
}
26+
}
27+
28+
func (s *CertificateProfileStatus) UnmarshalJSON(bytes []byte) error {
29+
var decoded string
30+
if err := json.Unmarshal(bytes, &decoded); err != nil {
31+
return fmt.Errorf("unmarshaling: %+v", err)
32+
}
33+
out, err := parseCertificateProfileStatus(decoded)
34+
if err != nil {
35+
return fmt.Errorf("parsing %q: %+v", decoded, err)
36+
}
37+
*s = *out
38+
return nil
39+
}
40+
41+
func parseCertificateProfileStatus(input string) (*CertificateProfileStatus, error) {
42+
vals := map[string]CertificateProfileStatus{
43+
"active": CertificateProfileStatusActive,
44+
"disabled": CertificateProfileStatusDisabled,
45+
"suspended": CertificateProfileStatusSuspended,
46+
}
47+
if v, ok := vals[strings.ToLower(input)]; ok {
48+
return &v, nil
49+
}
50+
51+
// otherwise presume it's an undefined value and best-effort it
52+
out := CertificateProfileStatus(input)
53+
return &out, nil
54+
}
55+
56+
type CertificateStatus string
57+
58+
const (
59+
CertificateStatusActive CertificateStatus = "Active"
60+
CertificateStatusExpired CertificateStatus = "Expired"
61+
CertificateStatusRevoked CertificateStatus = "Revoked"
62+
)
63+
64+
func PossibleValuesForCertificateStatus() []string {
65+
return []string{
66+
string(CertificateStatusActive),
67+
string(CertificateStatusExpired),
68+
string(CertificateStatusRevoked),
69+
}
70+
}
71+
72+
func (s *CertificateStatus) UnmarshalJSON(bytes []byte) error {
73+
var decoded string
74+
if err := json.Unmarshal(bytes, &decoded); err != nil {
75+
return fmt.Errorf("unmarshaling: %+v", err)
76+
}
77+
out, err := parseCertificateStatus(decoded)
78+
if err != nil {
79+
return fmt.Errorf("parsing %q: %+v", decoded, err)
80+
}
81+
*s = *out
82+
return nil
83+
}
84+
85+
func parseCertificateStatus(input string) (*CertificateStatus, error) {
86+
vals := map[string]CertificateStatus{
87+
"active": CertificateStatusActive,
88+
"expired": CertificateStatusExpired,
89+
"revoked": CertificateStatusRevoked,
90+
}
91+
if v, ok := vals[strings.ToLower(input)]; ok {
92+
return &v, nil
93+
}
94+
95+
// otherwise presume it's an undefined value and best-effort it
96+
out := CertificateStatus(input)
97+
return &out, nil
98+
}
99+
100+
type ProfileType string
101+
102+
const (
103+
ProfileTypePrivateTrust ProfileType = "PrivateTrust"
104+
ProfileTypePrivateTrustCIPolicy ProfileType = "PrivateTrustCIPolicy"
105+
ProfileTypePublicTrust ProfileType = "PublicTrust"
106+
ProfileTypePublicTrustTest ProfileType = "PublicTrustTest"
107+
ProfileTypeVBSEnclave ProfileType = "VBSEnclave"
108+
)
109+
110+
func PossibleValuesForProfileType() []string {
111+
return []string{
112+
string(ProfileTypePrivateTrust),
113+
string(ProfileTypePrivateTrustCIPolicy),
114+
string(ProfileTypePublicTrust),
115+
string(ProfileTypePublicTrustTest),
116+
string(ProfileTypeVBSEnclave),
117+
}
118+
}
119+
120+
func (s *ProfileType) UnmarshalJSON(bytes []byte) error {
121+
var decoded string
122+
if err := json.Unmarshal(bytes, &decoded); err != nil {
123+
return fmt.Errorf("unmarshaling: %+v", err)
124+
}
125+
out, err := parseProfileType(decoded)
126+
if err != nil {
127+
return fmt.Errorf("parsing %q: %+v", decoded, err)
128+
}
129+
*s = *out
130+
return nil
131+
}
132+
133+
func parseProfileType(input string) (*ProfileType, error) {
134+
vals := map[string]ProfileType{
135+
"privatetrust": ProfileTypePrivateTrust,
136+
"privatetrustcipolicy": ProfileTypePrivateTrustCIPolicy,
137+
"publictrust": ProfileTypePublicTrust,
138+
"publictrusttest": ProfileTypePublicTrustTest,
139+
"vbsenclave": ProfileTypeVBSEnclave,
140+
}
141+
if v, ok := vals[strings.ToLower(input)]; ok {
142+
return &v, nil
143+
}
144+
145+
// otherwise presume it's an undefined value and best-effort it
146+
out := ProfileType(input)
147+
return &out, nil
148+
}
149+
150+
type ProvisioningState string
151+
152+
const (
153+
ProvisioningStateAccepted ProvisioningState = "Accepted"
154+
ProvisioningStateCanceled ProvisioningState = "Canceled"
155+
ProvisioningStateDeleting ProvisioningState = "Deleting"
156+
ProvisioningStateFailed ProvisioningState = "Failed"
157+
ProvisioningStateSucceeded ProvisioningState = "Succeeded"
158+
ProvisioningStateUpdating ProvisioningState = "Updating"
159+
)
160+
161+
func PossibleValuesForProvisioningState() []string {
162+
return []string{
163+
string(ProvisioningStateAccepted),
164+
string(ProvisioningStateCanceled),
165+
string(ProvisioningStateDeleting),
166+
string(ProvisioningStateFailed),
167+
string(ProvisioningStateSucceeded),
168+
string(ProvisioningStateUpdating),
169+
}
170+
}
171+
172+
func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error {
173+
var decoded string
174+
if err := json.Unmarshal(bytes, &decoded); err != nil {
175+
return fmt.Errorf("unmarshaling: %+v", err)
176+
}
177+
out, err := parseProvisioningState(decoded)
178+
if err != nil {
179+
return fmt.Errorf("parsing %q: %+v", decoded, err)
180+
}
181+
*s = *out
182+
return nil
183+
}
184+
185+
func parseProvisioningState(input string) (*ProvisioningState, error) {
186+
vals := map[string]ProvisioningState{
187+
"accepted": ProvisioningStateAccepted,
188+
"canceled": ProvisioningStateCanceled,
189+
"deleting": ProvisioningStateDeleting,
190+
"failed": ProvisioningStateFailed,
191+
"succeeded": ProvisioningStateSucceeded,
192+
"updating": ProvisioningStateUpdating,
193+
}
194+
if v, ok := vals[strings.ToLower(input)]; ok {
195+
return &v, nil
196+
}
197+
198+
// otherwise presume it's an undefined value and best-effort it
199+
out := ProvisioningState(input)
200+
return &out, nil
201+
}
202+
203+
type RevocationStatus string
204+
205+
const (
206+
RevocationStatusFailed RevocationStatus = "Failed"
207+
RevocationStatusInProgress RevocationStatus = "InProgress"
208+
RevocationStatusSucceeded RevocationStatus = "Succeeded"
209+
)
210+
211+
func PossibleValuesForRevocationStatus() []string {
212+
return []string{
213+
string(RevocationStatusFailed),
214+
string(RevocationStatusInProgress),
215+
string(RevocationStatusSucceeded),
216+
}
217+
}
218+
219+
func (s *RevocationStatus) UnmarshalJSON(bytes []byte) error {
220+
var decoded string
221+
if err := json.Unmarshal(bytes, &decoded); err != nil {
222+
return fmt.Errorf("unmarshaling: %+v", err)
223+
}
224+
out, err := parseRevocationStatus(decoded)
225+
if err != nil {
226+
return fmt.Errorf("parsing %q: %+v", decoded, err)
227+
}
228+
*s = *out
229+
return nil
230+
}
231+
232+
func parseRevocationStatus(input string) (*RevocationStatus, error) {
233+
vals := map[string]RevocationStatus{
234+
"failed": RevocationStatusFailed,
235+
"inprogress": RevocationStatusInProgress,
236+
"succeeded": RevocationStatusSucceeded,
237+
}
238+
if v, ok := vals[strings.ToLower(input)]; ok {
239+
return &v, nil
240+
}
241+
242+
// otherwise presume it's an undefined value and best-effort it
243+
out := RevocationStatus(input)
244+
return &out, nil
245+
}

0 commit comments

Comments
 (0)