Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
111 changes: 111 additions & 0 deletions resource-manager/batch/2024-07-01/application/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/batch/2024-07-01/application` Documentation

The `application` SDK allows for interaction with Azure Resource Manager `batch` (API Version `2024-07-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/batch/2024-07-01/application"
```


### Client Initialization

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


### Example Usage: `ApplicationClient.Create`

```go
ctx := context.TODO()
id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName")

payload := application.Application{
// ...
}


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


### Example Usage: `ApplicationClient.Delete`

```go
ctx := context.TODO()
id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName")

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


### Example Usage: `ApplicationClient.Get`

```go
ctx := context.TODO()
id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName")

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: `ApplicationClient.List`

```go
ctx := context.TODO()
id := application.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName")

// alternatively `client.List(ctx, id, application.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, application.DefaultListOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```


### Example Usage: `ApplicationClient.Update`

```go
ctx := context.TODO()
id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName")

payload := application.Application{
// ...
}


read, err := client.Update(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
@@ -1,4 +1,4 @@
package applications
package application

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

type ApplicationsClient struct {
type ApplicationClient struct {
Client *resourcemanager.Client
}

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

return &ApplicationsClient{
return &ApplicationClient{
Client: client,
}, nil
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package certificates
package application

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

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

type ApplicationCreateOperationResponse struct {
type CreateOperationResponse struct {
HttpResponse *http.Response
OData *odata.OData
Model *Application
}

// ApplicationCreate ...
func (c ApplicationsClient) ApplicationCreate(ctx context.Context, id ApplicationId, input Application) (result ApplicationCreateOperationResponse, err error) {
// Create ...
func (c ApplicationClient) Create(ctx context.Context, id ApplicationId, input Application) (result CreateOperationResponse, err error) {
opts := client.RequestOptions{
ContentType: "application/json; charset=utf-8",
ExpectedStatusCodes: []int{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

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

type ApplicationDeleteOperationResponse struct {
type DeleteOperationResponse struct {
HttpResponse *http.Response
OData *odata.OData
}

// ApplicationDelete ...
func (c ApplicationsClient) ApplicationDelete(ctx context.Context, id ApplicationId) (result ApplicationDeleteOperationResponse, err error) {
// Delete ...
func (c ApplicationClient) Delete(ctx context.Context, id ApplicationId) (result DeleteOperationResponse, err error) {
opts := client.RequestOptions{
ContentType: "application/json; charset=utf-8",
ExpectedStatusCodes: []int{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

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

type ApplicationGetOperationResponse struct {
type GetOperationResponse struct {
HttpResponse *http.Response
OData *odata.OData
Model *Application
}

// ApplicationGet ...
func (c ApplicationsClient) ApplicationGet(ctx context.Context, id ApplicationId) (result ApplicationGetOperationResponse, err error) {
// Get ...
func (c ApplicationClient) Get(ctx context.Context, id ApplicationId) (result GetOperationResponse, err error) {
opts := client.RequestOptions{
ContentType: "application/json; charset=utf-8",
ExpectedStatusCodes: []int{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

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

type ApplicationListOperationResponse struct {
type ListOperationResponse struct {
HttpResponse *http.Response
OData *odata.OData
Model *[]Application
}

type ApplicationListCompleteResult struct {
type ListCompleteResult struct {
LatestHttpResponse *http.Response
Items []Application
}

type ApplicationListOperationOptions struct {
type ListOperationOptions struct {
Maxresults *int64
}

func DefaultApplicationListOperationOptions() ApplicationListOperationOptions {
return ApplicationListOperationOptions{}
func DefaultListOperationOptions() ListOperationOptions {
return ListOperationOptions{}
}

func (o ApplicationListOperationOptions) ToHeaders() *client.Headers {
func (o ListOperationOptions) ToHeaders() *client.Headers {
out := client.Headers{}

return &out
}

func (o ApplicationListOperationOptions) ToOData() *odata.Query {
func (o ListOperationOptions) ToOData() *odata.Query {
out := odata.Query{}

return &out
}

func (o ApplicationListOperationOptions) ToQuery() *client.QueryParams {
func (o ListOperationOptions) ToQuery() *client.QueryParams {
out := client.QueryParams{}
if o.Maxresults != nil {
out.Append("maxresults", fmt.Sprintf("%v", *o.Maxresults))
}
return &out
}

type ApplicationListCustomPager struct {
type ListCustomPager struct {
NextLink *odata.Link `json:"nextLink"`
}

func (p *ApplicationListCustomPager) NextPageLink() *odata.Link {
func (p *ListCustomPager) NextPageLink() *odata.Link {
defer func() {
p.NextLink = nil
}()

return p.NextLink
}

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

Expand Down Expand Up @@ -103,16 +103,16 @@ func (c ApplicationsClient) ApplicationList(ctx context.Context, id BatchAccount
return
}

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

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

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

result = ApplicationListCompleteResult{
result = ListCompleteResult{
LatestHttpResponse: resp.HttpResponse,
Items: items,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

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

type ApplicationUpdateOperationResponse struct {
type UpdateOperationResponse struct {
HttpResponse *http.Response
OData *odata.OData
Model *Application
}

// ApplicationUpdate ...
func (c ApplicationsClient) ApplicationUpdate(ctx context.Context, id ApplicationId, input Application) (result ApplicationUpdateOperationResponse, err error) {
// Update ...
func (c ApplicationClient) Update(ctx context.Context, id ApplicationId, input Application) (result UpdateOperationResponse, err error) {
opts := client.RequestOptions{
ContentType: "application/json; charset=utf-8",
ExpectedStatusCodes: []int{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package applications
package application

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