Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto PR: Regenerating the Go SDK (031283c2f51c3aa6cb1b729d6e4343e817e41bf8) #1077

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
111 changes: 111 additions & 0 deletions resource-manager/cdn/2024-02-01/afdcustomdomains/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/afdcustomdomains` Documentation

The `afdcustomdomains` SDK allows for interaction with the Azure Resource Manager Service `cdn` (API Version `2024-02-01`).

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).

### Import Path

```go
import "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/afdcustomdomains"
```


### Client Initialization

```go
client := afdcustomdomains.NewAFDCustomDomainsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
```


### Example Usage: `AFDCustomDomainsClient.Create`

```go
ctx := context.TODO()
id := afdcustomdomains.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileValue", "customDomainValue")

payload := afdcustomdomains.AFDDomain{
// ...
}


if err := client.CreateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
```


### Example Usage: `AFDCustomDomainsClient.Delete`

```go
ctx := context.TODO()
id := afdcustomdomains.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileValue", "customDomainValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
// handle the error
}
```


### Example Usage: `AFDCustomDomainsClient.Get`

```go
ctx := context.TODO()
id := afdcustomdomains.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileValue", "customDomainValue")

read, err := client.Get(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
```


### Example Usage: `AFDCustomDomainsClient.ListByProfile`

```go
ctx := context.TODO()
id := afdcustomdomains.NewProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileValue")

// alternatively `client.ListByProfile(ctx, id)` can be used to do batched pagination
items, err := client.ListByProfileComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```


### Example Usage: `AFDCustomDomainsClient.RefreshValidationToken`

```go
ctx := context.TODO()
id := afdcustomdomains.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileValue", "customDomainValue")

if err := client.RefreshValidationTokenThenPoll(ctx, id); err != nil {
// handle the error
}
```


### Example Usage: `AFDCustomDomainsClient.Update`

```go
ctx := context.TODO()
id := afdcustomdomains.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileValue", "customDomainValue")

payload := afdcustomdomains.AFDDomainUpdateParameters{
// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
```
26 changes: 26 additions & 0 deletions resource-manager/cdn/2024-02-01/afdcustomdomains/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package afdcustomdomains

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type AFDCustomDomainsClient struct {
Client *resourcemanager.Client
}

func NewAFDCustomDomainsClientWithBaseURI(sdkApi sdkEnv.Api) (*AFDCustomDomainsClient, error) {
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "afdcustomdomains", defaultApiVersion)
if err != nil {
return nil, fmt.Errorf("instantiating AFDCustomDomainsClient: %+v", err)
}

return &AFDCustomDomainsClient{
Client: client,
}, nil
}
254 changes: 254 additions & 0 deletions resource-manager/cdn/2024-02-01/afdcustomdomains/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
package afdcustomdomains

import (
"encoding/json"
"fmt"
"strings"
)

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type AfdCertificateType string

const (
AfdCertificateTypeAzureFirstPartyManagedCertificate AfdCertificateType = "AzureFirstPartyManagedCertificate"
AfdCertificateTypeCustomerCertificate AfdCertificateType = "CustomerCertificate"
AfdCertificateTypeManagedCertificate AfdCertificateType = "ManagedCertificate"
)

func PossibleValuesForAfdCertificateType() []string {
return []string{
string(AfdCertificateTypeAzureFirstPartyManagedCertificate),
string(AfdCertificateTypeCustomerCertificate),
string(AfdCertificateTypeManagedCertificate),
}
}

func (s *AfdCertificateType) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseAfdCertificateType(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parseAfdCertificateType(input string) (*AfdCertificateType, error) {
vals := map[string]AfdCertificateType{
"azurefirstpartymanagedcertificate": AfdCertificateTypeAzureFirstPartyManagedCertificate,
"customercertificate": AfdCertificateTypeCustomerCertificate,
"managedcertificate": AfdCertificateTypeManagedCertificate,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := AfdCertificateType(input)
return &out, nil
}

type AfdMinimumTlsVersion string

const (
AfdMinimumTlsVersionTLSOneTwo AfdMinimumTlsVersion = "TLS12"
AfdMinimumTlsVersionTLSOneZero AfdMinimumTlsVersion = "TLS10"
)

func PossibleValuesForAfdMinimumTlsVersion() []string {
return []string{
string(AfdMinimumTlsVersionTLSOneTwo),
string(AfdMinimumTlsVersionTLSOneZero),
}
}

func (s *AfdMinimumTlsVersion) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseAfdMinimumTlsVersion(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parseAfdMinimumTlsVersion(input string) (*AfdMinimumTlsVersion, error) {
vals := map[string]AfdMinimumTlsVersion{
"tls12": AfdMinimumTlsVersionTLSOneTwo,
"tls10": AfdMinimumTlsVersionTLSOneZero,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := AfdMinimumTlsVersion(input)
return &out, nil
}

type AfdProvisioningState string

const (
AfdProvisioningStateCreating AfdProvisioningState = "Creating"
AfdProvisioningStateDeleting AfdProvisioningState = "Deleting"
AfdProvisioningStateFailed AfdProvisioningState = "Failed"
AfdProvisioningStateSucceeded AfdProvisioningState = "Succeeded"
AfdProvisioningStateUpdating AfdProvisioningState = "Updating"
)

func PossibleValuesForAfdProvisioningState() []string {
return []string{
string(AfdProvisioningStateCreating),
string(AfdProvisioningStateDeleting),
string(AfdProvisioningStateFailed),
string(AfdProvisioningStateSucceeded),
string(AfdProvisioningStateUpdating),
}
}

func (s *AfdProvisioningState) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseAfdProvisioningState(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parseAfdProvisioningState(input string) (*AfdProvisioningState, error) {
vals := map[string]AfdProvisioningState{
"creating": AfdProvisioningStateCreating,
"deleting": AfdProvisioningStateDeleting,
"failed": AfdProvisioningStateFailed,
"succeeded": AfdProvisioningStateSucceeded,
"updating": AfdProvisioningStateUpdating,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := AfdProvisioningState(input)
return &out, nil
}

type DeploymentStatus string

const (
DeploymentStatusFailed DeploymentStatus = "Failed"
DeploymentStatusInProgress DeploymentStatus = "InProgress"
DeploymentStatusNotStarted DeploymentStatus = "NotStarted"
DeploymentStatusSucceeded DeploymentStatus = "Succeeded"
)

func PossibleValuesForDeploymentStatus() []string {
return []string{
string(DeploymentStatusFailed),
string(DeploymentStatusInProgress),
string(DeploymentStatusNotStarted),
string(DeploymentStatusSucceeded),
}
}

func (s *DeploymentStatus) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseDeploymentStatus(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parseDeploymentStatus(input string) (*DeploymentStatus, error) {
vals := map[string]DeploymentStatus{
"failed": DeploymentStatusFailed,
"inprogress": DeploymentStatusInProgress,
"notstarted": DeploymentStatusNotStarted,
"succeeded": DeploymentStatusSucceeded,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := DeploymentStatus(input)
return &out, nil
}

type DomainValidationState string

const (
DomainValidationStateApproved DomainValidationState = "Approved"
DomainValidationStateInternalError DomainValidationState = "InternalError"
DomainValidationStatePending DomainValidationState = "Pending"
DomainValidationStatePendingRevalidation DomainValidationState = "PendingRevalidation"
DomainValidationStateRefreshingValidationToken DomainValidationState = "RefreshingValidationToken"
DomainValidationStateRejected DomainValidationState = "Rejected"
DomainValidationStateSubmitting DomainValidationState = "Submitting"
DomainValidationStateTimedOut DomainValidationState = "TimedOut"
DomainValidationStateUnknown DomainValidationState = "Unknown"
)

func PossibleValuesForDomainValidationState() []string {
return []string{
string(DomainValidationStateApproved),
string(DomainValidationStateInternalError),
string(DomainValidationStatePending),
string(DomainValidationStatePendingRevalidation),
string(DomainValidationStateRefreshingValidationToken),
string(DomainValidationStateRejected),
string(DomainValidationStateSubmitting),
string(DomainValidationStateTimedOut),
string(DomainValidationStateUnknown),
}
}

func (s *DomainValidationState) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseDomainValidationState(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parseDomainValidationState(input string) (*DomainValidationState, error) {
vals := map[string]DomainValidationState{
"approved": DomainValidationStateApproved,
"internalerror": DomainValidationStateInternalError,
"pending": DomainValidationStatePending,
"pendingrevalidation": DomainValidationStatePendingRevalidation,
"refreshingvalidationtoken": DomainValidationStateRefreshingValidationToken,
"rejected": DomainValidationStateRejected,
"submitting": DomainValidationStateSubmitting,
"timedout": DomainValidationStateTimedOut,
"unknown": DomainValidationStateUnknown,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := DomainValidationState(input)
return &out, nil
}
Loading
Loading