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 (d0e3575caf72d5938698022641def5a9f580a9c1) #973

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
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
var _ Credential = ManagedIdentityCredential{}

type ManagedIdentityCredential struct {
TypeProperties ManagedIdentityTypeProperties `json:"typeProperties"`
TypeProperties *ManagedIdentityTypeProperties `json:"typeProperties,omitempty"`

// Fields inherited from Credential
Annotations *[]interface{} `json:"annotations,omitempty"`
Expand Down
41 changes: 0 additions & 41 deletions resource-manager/datafactory/2018-06-01/pipelines/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -1203,47 +1203,6 @@ func parseScriptActivityParameterType(input string) (*ScriptActivityParameterTyp
return &out, nil
}

type ScriptType string

const (
ScriptTypeNonQuery ScriptType = "NonQuery"
ScriptTypeQuery ScriptType = "Query"
)

func PossibleValuesForScriptType() []string {
return []string{
string(ScriptTypeNonQuery),
string(ScriptTypeQuery),
}
}

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

func parseScriptType(input string) (*ScriptType, error) {
vals := map[string]ScriptType{
"nonquery": ScriptTypeNonQuery,
"query": ScriptTypeQuery,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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

type SparkConfigurationReferenceType string

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ package pipelines
type ScriptActivityScriptBlock struct {
Parameters *[]ScriptActivityParameter `json:"parameters,omitempty"`
Text interface{} `json:"text"`
Type ScriptType `json:"type"`
Type interface{} `json:"type"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2024-04-01/azurebackupjob` Documentation

The `azurebackupjob` SDK allows for interaction with the Azure Resource Manager Service `dataprotection` (API Version `2024-04-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/dataprotection/2024-04-01/azurebackupjob"
```


### Client Initialization

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


### Example Usage: `AzureBackupJobClient.ExportJobsOperationResultGet`

```go
ctx := context.TODO()
id := azurebackupjob.NewOperationIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultValue", "operationIdValue")

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


### Example Usage: `AzureBackupJobClient.ExportJobsTrigger`

```go
ctx := context.TODO()
id := azurebackupjob.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultValue")

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


### Example Usage: `AzureBackupJobClient.JobsGet`

```go
ctx := context.TODO()
id := azurebackupjob.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultValue", "jobIdValue")

read, err := client.JobsGet(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package azurebackupjob

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 AzureBackupJobClient struct {
Client *resourcemanager.Client
}

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

return &AzureBackupJobClient{
Client: client,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
package azurebackupjob

import (
"fmt"
"strings"

"github.com/hashicorp/go-azure-helpers/resourcemanager/recaser"
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

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

func init() {
recaser.RegisterResourceId(&BackupJobId{})
}

var _ resourceids.ResourceId = &BackupJobId{}

// BackupJobId is a struct representing the Resource ID for a Backup Job
type BackupJobId struct {
SubscriptionId string
ResourceGroupName string
BackupVaultName string
JobId string
}

// NewBackupJobID returns a new BackupJobId struct
func NewBackupJobID(subscriptionId string, resourceGroupName string, backupVaultName string, jobId string) BackupJobId {
return BackupJobId{
SubscriptionId: subscriptionId,
ResourceGroupName: resourceGroupName,
BackupVaultName: backupVaultName,
JobId: jobId,
}
}

// ParseBackupJobID parses 'input' into a BackupJobId
func ParseBackupJobID(input string) (*BackupJobId, error) {
parser := resourceids.NewParserFromResourceIdType(&BackupJobId{})
parsed, err := parser.Parse(input, false)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

id := BackupJobId{}
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

// ParseBackupJobIDInsensitively parses 'input' case-insensitively into a BackupJobId
// note: this method should only be used for API response data and not user input
func ParseBackupJobIDInsensitively(input string) (*BackupJobId, error) {
parser := resourceids.NewParserFromResourceIdType(&BackupJobId{})
parsed, err := parser.Parse(input, true)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

id := BackupJobId{}
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

func (id *BackupJobId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input)
}

if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input)
}

if id.BackupVaultName, ok = input.Parsed["backupVaultName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "backupVaultName", input)
}

if id.JobId, ok = input.Parsed["jobId"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "jobId", input)
}

return nil
}

// ValidateBackupJobID checks that 'input' can be parsed as a Backup Job ID
func ValidateBackupJobID(input interface{}, key string) (warnings []string, errors []error) {
v, ok := input.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected %q to be a string", key))
return
}

if _, err := ParseBackupJobID(v); err != nil {
errors = append(errors, err)
}

return
}

// ID returns the formatted Backup Job ID
func (id BackupJobId) ID() string {
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DataProtection/backupVaults/%s/backupJobs/%s"
return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.BackupVaultName, id.JobId)
}

// Segments returns a slice of Resource ID Segments which comprise this Backup Job ID
func (id BackupJobId) Segments() []resourceids.Segment {
return []resourceids.Segment{
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"),
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"),
resourceids.StaticSegment("staticProviders", "providers", "providers"),
resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"),
resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"),
resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultValue"),
resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"),
resourceids.UserSpecifiedSegment("jobId", "jobIdValue"),
}
}

// String returns a human-readable description of this Backup Job ID
func (id BackupJobId) String() string {
components := []string{
fmt.Sprintf("Subscription: %q", id.SubscriptionId),
fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName),
fmt.Sprintf("Backup Vault Name: %q", id.BackupVaultName),
fmt.Sprintf("Job: %q", id.JobId),
}
return fmt.Sprintf("Backup Job (%s)", strings.Join(components, "\n"))
}
Loading
Loading