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 (0c0c6c1065861ed894721f5200b2f493aafc582a) #595

Merged
merged 1 commit into from
Aug 2, 2023
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/checknameavailability` Documentation

The `checknameavailability` SDK allows for interaction with the Azure Resource Manager Service `mysql` (API Version `2017-12-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/mysql/2017-12-01/checknameavailability"
```


### Client Initialization

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


### Example Usage: `CheckNameAvailabilityClient.Execute`

```go
ctx := context.TODO()
id := checknameavailability.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

payload := checknameavailability.NameAvailabilityRequest{
// ...
}


read, err := client.Execute(ctx, id, payload)
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 checknameavailability

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

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

return &CheckNameAvailabilityClient{
Client: client,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package checknameavailability

import (
"context"
"fmt"
"net/http"

"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"github.com/hashicorp/go-azure-sdk/sdk/client"
"github.com/hashicorp/go-azure-sdk/sdk/odata"
)

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

type ExecuteOperationResponse struct {
HttpResponse *http.Response
OData *odata.OData
Model *NameAvailability
}

// Execute ...
func (c CheckNameAvailabilityClient) Execute(ctx context.Context, id commonids.SubscriptionId, input NameAvailabilityRequest) (result ExecuteOperationResponse, err error) {
opts := client.RequestOptions{
ContentType: "application/json; charset=utf-8",
ExpectedStatusCodes: []int{
http.StatusOK,
},
HttpMethod: http.MethodPost,
Path: fmt.Sprintf("%s/providers/Microsoft.DBforMySQL/checkNameAvailability", id.ID()),
}

req, err := c.Client.NewRequest(ctx, opts)
if err != nil {
return
}

if err = req.Marshal(input); err != nil {
return
}

var resp *client.Response
resp, err = req.Execute(ctx)
if resp != nil {
result.OData = resp.OData
result.HttpResponse = resp.Response
}
if err != nil {
return
}

if err = resp.Unmarshal(&result.Model); err != nil {
return
}

return
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package checknameavailability

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

type NameAvailability struct {
Message *string `json:"message,omitempty"`
NameAvailable *bool `json:"nameAvailable,omitempty"`
Reason *string `json:"reason,omitempty"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package checknameavailability

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

type NameAvailabilityRequest struct {
Name string `json:"name"`
Type *string `json:"type,omitempty"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package checknameavailability

import "fmt"

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

const defaultApiVersion = "2017-12-01"

func userAgent() string {
return fmt.Sprintf("hashicorp/go-azure-sdk/checknameavailability/%s", defaultApiVersion)
}
154 changes: 154 additions & 0 deletions resource-manager/mysql/2017-12-01/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
package v2017_12_01

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

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/checknameavailability"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/configurations"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/configurationsupdate"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/databases"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/firewallrules"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/locationbasedperformancetier"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/logfiles"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/recoverableservers"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/replicas"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/serveradministrators"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/serverbasedperformancetier"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/serverrestart"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/servers"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/serversecurityalertpolicies"
"github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/virtualnetworkrules"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

type Client struct {
CheckNameAvailability *checknameavailability.CheckNameAvailabilityClient
Configurations *configurations.ConfigurationsClient
ConfigurationsUpdate *configurationsupdate.ConfigurationsUpdateClient
Databases *databases.DatabasesClient
FirewallRules *firewallrules.FirewallRulesClient
LocationBasedPerformanceTier *locationbasedperformancetier.LocationBasedPerformanceTierClient
LogFiles *logfiles.LogFilesClient
RecoverableServers *recoverableservers.RecoverableServersClient
Replicas *replicas.ReplicasClient
ServerAdministrators *serveradministrators.ServerAdministratorsClient
ServerBasedPerformanceTier *serverbasedperformancetier.ServerBasedPerformanceTierClient
ServerRestart *serverrestart.ServerRestartClient
ServerSecurityAlertPolicies *serversecurityalertpolicies.ServerSecurityAlertPoliciesClient
Servers *servers.ServersClient
VirtualNetworkRules *virtualnetworkrules.VirtualNetworkRulesClient
}

func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) {
checkNameAvailabilityClient, err := checknameavailability.NewCheckNameAvailabilityClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building CheckNameAvailability client: %+v", err)
}
configureFunc(checkNameAvailabilityClient.Client)

configurationsClient, err := configurations.NewConfigurationsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Configurations client: %+v", err)
}
configureFunc(configurationsClient.Client)

configurationsUpdateClient, err := configurationsupdate.NewConfigurationsUpdateClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ConfigurationsUpdate client: %+v", err)
}
configureFunc(configurationsUpdateClient.Client)

databasesClient, err := databases.NewDatabasesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Databases client: %+v", err)
}
configureFunc(databasesClient.Client)

firewallRulesClient, err := firewallrules.NewFirewallRulesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building FirewallRules client: %+v", err)
}
configureFunc(firewallRulesClient.Client)

locationBasedPerformanceTierClient, err := locationbasedperformancetier.NewLocationBasedPerformanceTierClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building LocationBasedPerformanceTier client: %+v", err)
}
configureFunc(locationBasedPerformanceTierClient.Client)

logFilesClient, err := logfiles.NewLogFilesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building LogFiles client: %+v", err)
}
configureFunc(logFilesClient.Client)

recoverableServersClient, err := recoverableservers.NewRecoverableServersClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building RecoverableServers client: %+v", err)
}
configureFunc(recoverableServersClient.Client)

replicasClient, err := replicas.NewReplicasClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Replicas client: %+v", err)
}
configureFunc(replicasClient.Client)

serverAdministratorsClient, err := serveradministrators.NewServerAdministratorsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ServerAdministrators client: %+v", err)
}
configureFunc(serverAdministratorsClient.Client)

serverBasedPerformanceTierClient, err := serverbasedperformancetier.NewServerBasedPerformanceTierClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ServerBasedPerformanceTier client: %+v", err)
}
configureFunc(serverBasedPerformanceTierClient.Client)

serverRestartClient, err := serverrestart.NewServerRestartClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ServerRestart client: %+v", err)
}
configureFunc(serverRestartClient.Client)

serverSecurityAlertPoliciesClient, err := serversecurityalertpolicies.NewServerSecurityAlertPoliciesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ServerSecurityAlertPolicies client: %+v", err)
}
configureFunc(serverSecurityAlertPoliciesClient.Client)

serversClient, err := servers.NewServersClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Servers client: %+v", err)
}
configureFunc(serversClient.Client)

virtualNetworkRulesClient, err := virtualnetworkrules.NewVirtualNetworkRulesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VirtualNetworkRules client: %+v", err)
}
configureFunc(virtualNetworkRulesClient.Client)

return &Client{
CheckNameAvailability: checkNameAvailabilityClient,
Configurations: configurationsClient,
ConfigurationsUpdate: configurationsUpdateClient,
Databases: databasesClient,
FirewallRules: firewallRulesClient,
LocationBasedPerformanceTier: locationBasedPerformanceTierClient,
LogFiles: logFilesClient,
RecoverableServers: recoverableServersClient,
Replicas: replicasClient,
ServerAdministrators: serverAdministratorsClient,
ServerBasedPerformanceTier: serverBasedPerformanceTierClient,
ServerRestart: serverRestartClient,
ServerSecurityAlertPolicies: serverSecurityAlertPoliciesClient,
Servers: serversClient,
VirtualNetworkRules: virtualNetworkRulesClient,
}, nil
}
69 changes: 69 additions & 0 deletions resource-manager/mysql/2017-12-01/configurations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/mysql/2017-12-01/configurations` Documentation

The `configurations` SDK allows for interaction with the Azure Resource Manager Service `mysql` (API Version `2017-12-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/mysql/2017-12-01/configurations"
```


### Client Initialization

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


### Example Usage: `ConfigurationsClient.CreateOrUpdate`

```go
ctx := context.TODO()
id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "configurationValue")

payload := configurations.Configuration{
// ...
}


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


### Example Usage: `ConfigurationsClient.Get`

```go
ctx := context.TODO()
id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "configurationValue")

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: `ConfigurationsClient.ListByServer`

```go
ctx := context.TODO()
id := configurations.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue")

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