-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hc-github-team-tf-azure
committed
Feb 21, 2024
1 parent
4f74876
commit 9de5d17
Showing
1,482 changed files
with
53,358 additions
and
60,850 deletions.
There are no files selected for viewing
22 changes: 15 additions & 7 deletions
22
resource-manager/securityinsights/2021-09-01-preview/actions/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 actions | ||
|
||
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 ActionsClient struct { | ||
Client autorest.Client | ||
baseUri string | ||
Client *resourcemanager.Client | ||
} | ||
|
||
func NewActionsClientWithBaseURI(endpoint string) ActionsClient { | ||
return ActionsClient{ | ||
Client: autorest.NewClientWithUserAgent(userAgent()), | ||
baseUri: endpoint, | ||
func NewActionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ActionsClient, error) { | ||
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "actions", defaultApiVersion) | ||
if err != nil { | ||
return nil, fmt.Errorf("instantiating ActionsClient: %+v", err) | ||
} | ||
|
||
return &ActionsClient{ | ||
Client: client, | ||
}, nil | ||
} |
56 changes: 56 additions & 0 deletions
56
resource-manager/securityinsights/2021-09-01-preview/actions/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,56 @@ | ||
package actions | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
|
||
"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 CreateOrUpdateOperationResponse struct { | ||
HttpResponse *http.Response | ||
OData *odata.OData | ||
Model *ActionResponse | ||
} | ||
|
||
// CreateOrUpdate ... | ||
func (c ActionsClient) CreateOrUpdate(ctx context.Context, id ActionId, input ActionRequest) (result CreateOrUpdateOperationResponse, err error) { | ||
opts := client.RequestOptions{ | ||
ContentType: "application/json; charset=utf-8", | ||
ExpectedStatusCodes: []int{ | ||
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 | ||
} | ||
|
||
if err = resp.Unmarshal(&result.Model); err != nil { | ||
return | ||
} | ||
|
||
return | ||
} |
69 changes: 0 additions & 69 deletions
69
...rce-manager/securityinsights/2021-09-01-preview/actions/method_createorupdate_autorest.go
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
resource-manager/securityinsights/2021-09-01-preview/actions/method_delete.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,47 @@ | ||
package actions | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
|
||
"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 DeleteOperationResponse struct { | ||
HttpResponse *http.Response | ||
OData *odata.OData | ||
} | ||
|
||
// Delete ... | ||
func (c ActionsClient) Delete(ctx context.Context, id ActionId) (result DeleteOperationResponse, err error) { | ||
opts := client.RequestOptions{ | ||
ContentType: "application/json; charset=utf-8", | ||
ExpectedStatusCodes: []int{ | ||
http.StatusNoContent, | ||
http.StatusOK, | ||
}, | ||
HttpMethod: http.MethodDelete, | ||
Path: id.ID(), | ||
} | ||
|
||
req, err := c.Client.NewRequest(ctx, opts) | ||
if 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 | ||
} | ||
|
||
return | ||
} |
66 changes: 0 additions & 66 deletions
66
resource-manager/securityinsights/2021-09-01-preview/actions/method_delete_autorest.go
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
resource-manager/securityinsights/2021-09-01-preview/actions/method_get.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,51 @@ | ||
package actions | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
|
||
"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 GetOperationResponse struct { | ||
HttpResponse *http.Response | ||
OData *odata.OData | ||
Model *ActionResponse | ||
} | ||
|
||
// Get ... | ||
func (c ActionsClient) Get(ctx context.Context, id ActionId) (result GetOperationResponse, err error) { | ||
opts := client.RequestOptions{ | ||
ContentType: "application/json; charset=utf-8", | ||
ExpectedStatusCodes: []int{ | ||
http.StatusOK, | ||
}, | ||
HttpMethod: http.MethodGet, | ||
Path: id.ID(), | ||
} | ||
|
||
req, err := c.Client.NewRequest(ctx, opts) | ||
if 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 | ||
} |
68 changes: 0 additions & 68 deletions
68
resource-manager/securityinsights/2021-09-01-preview/actions/method_get_autorest.go
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.