Skip to content

Commit 7c9b6b8

Browse files
Updating based on 00993dd86 (#1288)
Co-authored-by: hc-github-team-tf-azure <>
1 parent f6d0963 commit 7c9b6b8

File tree

438 files changed

+11368
-3442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

438 files changed

+11368
-3442
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
2+
## `github.com/hashicorp/go-azure-sdk/resource-manager/batch/2024-07-01/application` Documentation
3+
4+
The `application` SDK allows for interaction with Azure Resource Manager `batch` (API Version `2024-07-01`).
5+
6+
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).
7+
8+
### Import Path
9+
10+
```go
11+
import "github.com/hashicorp/go-azure-sdk/resource-manager/batch/2024-07-01/application"
12+
```
13+
14+
15+
### Client Initialization
16+
17+
```go
18+
client := application.NewApplicationClientWithBaseURI("https://management.azure.com")
19+
client.Client.Authorizer = authorizer
20+
```
21+
22+
23+
### Example Usage: `ApplicationClient.Create`
24+
25+
```go
26+
ctx := context.TODO()
27+
id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName")
28+
29+
payload := application.Application{
30+
// ...
31+
}
32+
33+
34+
read, err := client.Create(ctx, id, payload)
35+
if err != nil {
36+
// handle the error
37+
}
38+
if model := read.Model; model != nil {
39+
// do something with the model/response object
40+
}
41+
```
42+
43+
44+
### Example Usage: `ApplicationClient.Delete`
45+
46+
```go
47+
ctx := context.TODO()
48+
id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName")
49+
50+
read, err := client.Delete(ctx, id)
51+
if err != nil {
52+
// handle the error
53+
}
54+
if model := read.Model; model != nil {
55+
// do something with the model/response object
56+
}
57+
```
58+
59+
60+
### Example Usage: `ApplicationClient.Get`
61+
62+
```go
63+
ctx := context.TODO()
64+
id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName")
65+
66+
read, err := client.Get(ctx, id)
67+
if err != nil {
68+
// handle the error
69+
}
70+
if model := read.Model; model != nil {
71+
// do something with the model/response object
72+
}
73+
```
74+
75+
76+
### Example Usage: `ApplicationClient.List`
77+
78+
```go
79+
ctx := context.TODO()
80+
id := application.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName")
81+
82+
// alternatively `client.List(ctx, id, application.DefaultListOperationOptions())` can be used to do batched pagination
83+
items, err := client.ListComplete(ctx, id, application.DefaultListOperationOptions())
84+
if err != nil {
85+
// handle the error
86+
}
87+
for _, item := range items {
88+
// do something
89+
}
90+
```
91+
92+
93+
### Example Usage: `ApplicationClient.Update`
94+
95+
```go
96+
ctx := context.TODO()
97+
id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName")
98+
99+
payload := application.Application{
100+
// ...
101+
}
102+
103+
104+
read, err := client.Update(ctx, id, payload)
105+
if err != nil {
106+
// handle the error
107+
}
108+
if model := read.Model; model != nil {
109+
// do something with the model/response object
110+
}
111+
```

resource-manager/batch/2024-07-01/applications/client.go renamed to resource-manager/batch/2024-07-01/application/client.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package applications
1+
package application
22

33
import (
44
"fmt"
@@ -10,17 +10,17 @@ import (
1010
// Copyright (c) Microsoft Corporation. All rights reserved.
1111
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
1212

13-
type ApplicationsClient struct {
13+
type ApplicationClient struct {
1414
Client *resourcemanager.Client
1515
}
1616

17-
func NewApplicationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationsClient, error) {
18-
client, err := resourcemanager.NewClient(sdkApi, "applications", defaultApiVersion)
17+
func NewApplicationClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationClient, error) {
18+
client, err := resourcemanager.NewClient(sdkApi, "application", defaultApiVersion)
1919
if err != nil {
20-
return nil, fmt.Errorf("instantiating ApplicationsClient: %+v", err)
20+
return nil, fmt.Errorf("instantiating ApplicationClient: %+v", err)
2121
}
2222

23-
return &ApplicationsClient{
23+
return &ApplicationClient{
2424
Client: client,
2525
}, nil
2626
}

resource-manager/batch/2024-07-01/applications/id_application.go renamed to resource-manager/batch/2024-07-01/application/id_application.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package applications
1+
package application
22

33
import (
44
"fmt"

resource-manager/batch/2024-07-01/applications/id_application_test.go renamed to resource-manager/batch/2024-07-01/application/id_application_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package applications
1+
package application
22

33
import (
44
"testing"

resource-manager/batch/2024-07-01/applications/id_batchaccount.go renamed to resource-manager/batch/2024-07-01/application/id_batchaccount.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package applications
1+
package application
22

33
import (
44
"fmt"

resource-manager/batch/2024-07-01/certificates/id_batchaccount_test.go renamed to resource-manager/batch/2024-07-01/application/id_batchaccount_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package certificates
1+
package application
22

33
import (
44
"testing"

resource-manager/batch/2024-07-01/applications/method_applicationcreate.go renamed to resource-manager/batch/2024-07-01/application/method_create.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package applications
1+
package application
22

33
import (
44
"context"
@@ -11,14 +11,14 @@ import (
1111
// Copyright (c) Microsoft Corporation. All rights reserved.
1212
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
1313

14-
type ApplicationCreateOperationResponse struct {
14+
type CreateOperationResponse struct {
1515
HttpResponse *http.Response
1616
OData *odata.OData
1717
Model *Application
1818
}
1919

20-
// ApplicationCreate ...
21-
func (c ApplicationsClient) ApplicationCreate(ctx context.Context, id ApplicationId, input Application) (result ApplicationCreateOperationResponse, err error) {
20+
// Create ...
21+
func (c ApplicationClient) Create(ctx context.Context, id ApplicationId, input Application) (result CreateOperationResponse, err error) {
2222
opts := client.RequestOptions{
2323
ContentType: "application/json; charset=utf-8",
2424
ExpectedStatusCodes: []int{

resource-manager/batch/2024-07-01/applications/method_applicationdelete.go renamed to resource-manager/batch/2024-07-01/application/method_delete.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package applications
1+
package application
22

33
import (
44
"context"
@@ -11,13 +11,13 @@ import (
1111
// Copyright (c) Microsoft Corporation. All rights reserved.
1212
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
1313

14-
type ApplicationDeleteOperationResponse struct {
14+
type DeleteOperationResponse struct {
1515
HttpResponse *http.Response
1616
OData *odata.OData
1717
}
1818

19-
// ApplicationDelete ...
20-
func (c ApplicationsClient) ApplicationDelete(ctx context.Context, id ApplicationId) (result ApplicationDeleteOperationResponse, err error) {
19+
// Delete ...
20+
func (c ApplicationClient) Delete(ctx context.Context, id ApplicationId) (result DeleteOperationResponse, err error) {
2121
opts := client.RequestOptions{
2222
ContentType: "application/json; charset=utf-8",
2323
ExpectedStatusCodes: []int{

resource-manager/batch/2024-07-01/applications/method_applicationget.go renamed to resource-manager/batch/2024-07-01/application/method_get.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package applications
1+
package application
22

33
import (
44
"context"
@@ -11,14 +11,14 @@ import (
1111
// Copyright (c) Microsoft Corporation. All rights reserved.
1212
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
1313

14-
type ApplicationGetOperationResponse struct {
14+
type GetOperationResponse struct {
1515
HttpResponse *http.Response
1616
OData *odata.OData
1717
Model *Application
1818
}
1919

20-
// ApplicationGet ...
21-
func (c ApplicationsClient) ApplicationGet(ctx context.Context, id ApplicationId) (result ApplicationGetOperationResponse, err error) {
20+
// Get ...
21+
func (c ApplicationClient) Get(ctx context.Context, id ApplicationId) (result GetOperationResponse, err error) {
2222
opts := client.RequestOptions{
2323
ContentType: "application/json; charset=utf-8",
2424
ExpectedStatusCodes: []int{

resource-manager/batch/2024-07-01/applications/method_applicationlist.go renamed to resource-manager/batch/2024-07-01/application/method_list.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package applications
1+
package application
22

33
import (
44
"context"
@@ -12,67 +12,67 @@ import (
1212
// Copyright (c) Microsoft Corporation. All rights reserved.
1313
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
1414

15-
type ApplicationListOperationResponse struct {
15+
type ListOperationResponse struct {
1616
HttpResponse *http.Response
1717
OData *odata.OData
1818
Model *[]Application
1919
}
2020

21-
type ApplicationListCompleteResult struct {
21+
type ListCompleteResult struct {
2222
LatestHttpResponse *http.Response
2323
Items []Application
2424
}
2525

26-
type ApplicationListOperationOptions struct {
26+
type ListOperationOptions struct {
2727
Maxresults *int64
2828
}
2929

30-
func DefaultApplicationListOperationOptions() ApplicationListOperationOptions {
31-
return ApplicationListOperationOptions{}
30+
func DefaultListOperationOptions() ListOperationOptions {
31+
return ListOperationOptions{}
3232
}
3333

34-
func (o ApplicationListOperationOptions) ToHeaders() *client.Headers {
34+
func (o ListOperationOptions) ToHeaders() *client.Headers {
3535
out := client.Headers{}
3636

3737
return &out
3838
}
3939

40-
func (o ApplicationListOperationOptions) ToOData() *odata.Query {
40+
func (o ListOperationOptions) ToOData() *odata.Query {
4141
out := odata.Query{}
4242

4343
return &out
4444
}
4545

46-
func (o ApplicationListOperationOptions) ToQuery() *client.QueryParams {
46+
func (o ListOperationOptions) ToQuery() *client.QueryParams {
4747
out := client.QueryParams{}
4848
if o.Maxresults != nil {
4949
out.Append("maxresults", fmt.Sprintf("%v", *o.Maxresults))
5050
}
5151
return &out
5252
}
5353

54-
type ApplicationListCustomPager struct {
54+
type ListCustomPager struct {
5555
NextLink *odata.Link `json:"nextLink"`
5656
}
5757

58-
func (p *ApplicationListCustomPager) NextPageLink() *odata.Link {
58+
func (p *ListCustomPager) NextPageLink() *odata.Link {
5959
defer func() {
6060
p.NextLink = nil
6161
}()
6262

6363
return p.NextLink
6464
}
6565

66-
// ApplicationList ...
67-
func (c ApplicationsClient) ApplicationList(ctx context.Context, id BatchAccountId, options ApplicationListOperationOptions) (result ApplicationListOperationResponse, err error) {
66+
// List ...
67+
func (c ApplicationClient) List(ctx context.Context, id BatchAccountId, options ListOperationOptions) (result ListOperationResponse, err error) {
6868
opts := client.RequestOptions{
6969
ContentType: "application/json; charset=utf-8",
7070
ExpectedStatusCodes: []int{
7171
http.StatusOK,
7272
},
7373
HttpMethod: http.MethodGet,
7474
OptionsObject: options,
75-
Pager: &ApplicationListCustomPager{},
75+
Pager: &ListCustomPager{},
7676
Path: fmt.Sprintf("%s/applications", id.ID()),
7777
}
7878

@@ -103,16 +103,16 @@ func (c ApplicationsClient) ApplicationList(ctx context.Context, id BatchAccount
103103
return
104104
}
105105

106-
// ApplicationListComplete retrieves all the results into a single object
107-
func (c ApplicationsClient) ApplicationListComplete(ctx context.Context, id BatchAccountId, options ApplicationListOperationOptions) (ApplicationListCompleteResult, error) {
108-
return c.ApplicationListCompleteMatchingPredicate(ctx, id, options, ApplicationOperationPredicate{})
106+
// ListComplete retrieves all the results into a single object
107+
func (c ApplicationClient) ListComplete(ctx context.Context, id BatchAccountId, options ListOperationOptions) (ListCompleteResult, error) {
108+
return c.ListCompleteMatchingPredicate(ctx, id, options, ApplicationOperationPredicate{})
109109
}
110110

111-
// ApplicationListCompleteMatchingPredicate retrieves all the results and then applies the predicate
112-
func (c ApplicationsClient) ApplicationListCompleteMatchingPredicate(ctx context.Context, id BatchAccountId, options ApplicationListOperationOptions, predicate ApplicationOperationPredicate) (result ApplicationListCompleteResult, err error) {
111+
// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate
112+
func (c ApplicationClient) ListCompleteMatchingPredicate(ctx context.Context, id BatchAccountId, options ListOperationOptions, predicate ApplicationOperationPredicate) (result ListCompleteResult, err error) {
113113
items := make([]Application, 0)
114114

115-
resp, err := c.ApplicationList(ctx, id, options)
115+
resp, err := c.List(ctx, id, options)
116116
if err != nil {
117117
result.LatestHttpResponse = resp.HttpResponse
118118
err = fmt.Errorf("loading results: %+v", err)
@@ -126,7 +126,7 @@ func (c ApplicationsClient) ApplicationListCompleteMatchingPredicate(ctx context
126126
}
127127
}
128128

129-
result = ApplicationListCompleteResult{
129+
result = ListCompleteResult{
130130
LatestHttpResponse: resp.HttpResponse,
131131
Items: items,
132132
}

0 commit comments

Comments
 (0)