-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #806 from hashicorp/auto-pr/88f296ec7
Auto PR: Regenerating the Go SDK (e7deff4)
- Loading branch information
Showing
338 changed files
with
11,718 additions
and
11,892 deletions.
There are no files selected for viewing
22 changes: 15 additions & 7 deletions
22
resource-manager/kusto/2023-05-02/attacheddatabaseconfigurations/client.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
package attacheddatabaseconfigurations | ||
|
||
import "github.com/Azure/go-autorest/autorest" | ||
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 AttachedDatabaseConfigurationsClient struct { | ||
Client autorest.Client | ||
baseUri string | ||
Client *resourcemanager.Client | ||
} | ||
|
||
func NewAttachedDatabaseConfigurationsClientWithBaseURI(endpoint string) AttachedDatabaseConfigurationsClient { | ||
return AttachedDatabaseConfigurationsClient{ | ||
Client: autorest.NewClientWithUserAgent(userAgent()), | ||
baseUri: endpoint, | ||
func NewAttachedDatabaseConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*AttachedDatabaseConfigurationsClient, error) { | ||
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "attacheddatabaseconfigurations", defaultApiVersion) | ||
if err != nil { | ||
return nil, fmt.Errorf("instantiating AttachedDatabaseConfigurationsClient: %+v", err) | ||
} | ||
|
||
return &AttachedDatabaseConfigurationsClient{ | ||
Client: client, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...e-manager/kusto/2023-05-02/attacheddatabaseconfigurations/method_checknameavailability.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package attacheddatabaseconfigurations | ||
|
||
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 CheckNameAvailabilityOperationResponse struct { | ||
HttpResponse *http.Response | ||
OData *odata.OData | ||
Model *CheckNameResult | ||
} | ||
|
||
// CheckNameAvailability ... | ||
func (c AttachedDatabaseConfigurationsClient) CheckNameAvailability(ctx context.Context, id commonids.KustoClusterId, input AttachedDatabaseConfigurationsCheckNameRequest) (result CheckNameAvailabilityOperationResponse, err error) { | ||
opts := client.RequestOptions{ | ||
ContentType: "application/json; charset=utf-8", | ||
ExpectedStatusCodes: []int{ | ||
http.StatusOK, | ||
}, | ||
HttpMethod: http.MethodPost, | ||
Path: fmt.Sprintf("%s/attachedDatabaseConfigurationCheckNameAvailability", 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 | ||
} |
71 changes: 0 additions & 71 deletions
71
.../kusto/2023-05-02/attacheddatabaseconfigurations/method_checknameavailability_autorest.go
This file was deleted.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
resource-manager/kusto/2023-05-02/attacheddatabaseconfigurations/method_createorupdate.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package attacheddatabaseconfigurations | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"net/http" | ||
|
||
"github.com/hashicorp/go-azure-sdk/sdk/client" | ||
"github.com/hashicorp/go-azure-sdk/sdk/client/pollers" | ||
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" | ||
"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 CreateOrUpdateOperationResponse struct { | ||
Poller pollers.Poller | ||
HttpResponse *http.Response | ||
OData *odata.OData | ||
} | ||
|
||
// CreateOrUpdate ... | ||
func (c AttachedDatabaseConfigurationsClient) CreateOrUpdate(ctx context.Context, id AttachedDatabaseConfigurationId, input AttachedDatabaseConfiguration) (result CreateOrUpdateOperationResponse, err error) { | ||
opts := client.RequestOptions{ | ||
ContentType: "application/json; charset=utf-8", | ||
ExpectedStatusCodes: []int{ | ||
http.StatusAccepted, | ||
http.StatusCreated, | ||
http.StatusOK, | ||
}, | ||
HttpMethod: http.MethodPut, | ||
Path: 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 | ||
} | ||
|
||
result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) | ||
if err != nil { | ||
return | ||
} | ||
|
||
return | ||
} | ||
|
||
// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed | ||
func (c AttachedDatabaseConfigurationsClient) CreateOrUpdateThenPoll(ctx context.Context, id AttachedDatabaseConfigurationId, input AttachedDatabaseConfiguration) error { | ||
result, err := c.CreateOrUpdate(ctx, id, input) | ||
if err != nil { | ||
return fmt.Errorf("performing CreateOrUpdate: %+v", err) | ||
} | ||
|
||
if err := result.Poller.PollUntilDone(ctx); err != nil { | ||
return fmt.Errorf("polling after CreateOrUpdate: %+v", err) | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.