Skip to content

Commit 321db48

Browse files
author
hc-github-team-tf-azure
committed
Updating based on 53c62d4be
1 parent 43c6ffb commit 321db48

File tree

51 files changed

+2399
-71
lines changed

Some content is hidden

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

51 files changed

+2399
-71
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package approleassignment
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/hashicorp/go-azure-sdk/sdk/client/msgraph"
7+
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
8+
)
9+
10+
// Copyright (c) HashiCorp Inc. All rights reserved.
11+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
12+
13+
type AppRoleAssignmentClient struct {
14+
Client *msgraph.Client
15+
}
16+
17+
func NewAppRoleAssignmentClientWithBaseURI(sdkApi sdkEnv.Api) (*AppRoleAssignmentClient, error) {
18+
client, err := msgraph.NewClient(sdkApi, "approleassignment", defaultApiVersion)
19+
if err != nil {
20+
return nil, fmt.Errorf("instantiating AppRoleAssignmentClient: %+v", err)
21+
}
22+
23+
return &AppRoleAssignmentClient{
24+
Client: client,
25+
}, nil
26+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package approleassignment
2+
3+
import (
4+
"context"
5+
"net/http"
6+
7+
"github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/beta"
8+
"github.com/hashicorp/go-azure-sdk/sdk/client"
9+
"github.com/hashicorp/go-azure-sdk/sdk/odata"
10+
)
11+
12+
// Copyright (c) HashiCorp Inc. All rights reserved.
13+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
14+
15+
type CreateAppRoleAssignmentOperationResponse struct {
16+
HttpResponse *http.Response
17+
OData *odata.OData
18+
Model *beta.AppRoleAssignment
19+
}
20+
21+
type CreateAppRoleAssignmentOperationOptions struct {
22+
Metadata *odata.Metadata
23+
RetryFunc client.RequestRetryFunc
24+
}
25+
26+
func DefaultCreateAppRoleAssignmentOperationOptions() CreateAppRoleAssignmentOperationOptions {
27+
return CreateAppRoleAssignmentOperationOptions{}
28+
}
29+
30+
func (o CreateAppRoleAssignmentOperationOptions) ToHeaders() *client.Headers {
31+
out := client.Headers{}
32+
33+
return &out
34+
}
35+
36+
func (o CreateAppRoleAssignmentOperationOptions) ToOData() *odata.Query {
37+
out := odata.Query{}
38+
if o.Metadata != nil {
39+
out.Metadata = *o.Metadata
40+
}
41+
return &out
42+
}
43+
44+
func (o CreateAppRoleAssignmentOperationOptions) ToQuery() *client.QueryParams {
45+
out := client.QueryParams{}
46+
47+
return &out
48+
}
49+
50+
// CreateAppRoleAssignment - Add new entity to appRoleAssignments
51+
func (c AppRoleAssignmentClient) CreateAppRoleAssignment(ctx context.Context, input beta.AppRoleAssignment, options CreateAppRoleAssignmentOperationOptions) (result CreateAppRoleAssignmentOperationResponse, err error) {
52+
opts := client.RequestOptions{
53+
ContentType: "application/json; charset=utf-8",
54+
ExpectedStatusCodes: []int{
55+
http.StatusAccepted,
56+
http.StatusCreated,
57+
http.StatusNoContent,
58+
http.StatusOK,
59+
},
60+
HttpMethod: http.MethodPost,
61+
OptionsObject: options,
62+
Path: "/appRoleAssignments",
63+
RetryFunc: options.RetryFunc,
64+
}
65+
66+
req, err := c.Client.NewRequest(ctx, opts)
67+
if err != nil {
68+
return
69+
}
70+
71+
if err = req.Marshal(input); err != nil {
72+
return
73+
}
74+
75+
var resp *client.Response
76+
resp, err = req.Execute(ctx)
77+
if resp != nil {
78+
result.OData = resp.OData
79+
result.HttpResponse = resp.Response
80+
}
81+
if err != nil {
82+
return
83+
}
84+
85+
var model beta.AppRoleAssignment
86+
result.Model = &model
87+
if err = resp.Unmarshal(result.Model); err != nil {
88+
return
89+
}
90+
91+
return
92+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
package approleassignment
2+
3+
import (
4+
"context"
5+
"fmt"
6+
"net/http"
7+
8+
"github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/beta"
9+
"github.com/hashicorp/go-azure-sdk/sdk/client"
10+
"github.com/hashicorp/go-azure-sdk/sdk/odata"
11+
)
12+
13+
// Copyright (c) HashiCorp Inc. All rights reserved.
14+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
15+
16+
type DeleteAppRoleAssignmentOperationResponse struct {
17+
HttpResponse *http.Response
18+
OData *odata.OData
19+
}
20+
21+
type DeleteAppRoleAssignmentOperationOptions struct {
22+
IfMatch *string
23+
Metadata *odata.Metadata
24+
RetryFunc client.RequestRetryFunc
25+
}
26+
27+
func DefaultDeleteAppRoleAssignmentOperationOptions() DeleteAppRoleAssignmentOperationOptions {
28+
return DeleteAppRoleAssignmentOperationOptions{}
29+
}
30+
31+
func (o DeleteAppRoleAssignmentOperationOptions) ToHeaders() *client.Headers {
32+
out := client.Headers{}
33+
if o.IfMatch != nil {
34+
out.Append("If-Match", fmt.Sprintf("%v", *o.IfMatch))
35+
}
36+
return &out
37+
}
38+
39+
func (o DeleteAppRoleAssignmentOperationOptions) ToOData() *odata.Query {
40+
out := odata.Query{}
41+
if o.Metadata != nil {
42+
out.Metadata = *o.Metadata
43+
}
44+
return &out
45+
}
46+
47+
func (o DeleteAppRoleAssignmentOperationOptions) ToQuery() *client.QueryParams {
48+
out := client.QueryParams{}
49+
50+
return &out
51+
}
52+
53+
// DeleteAppRoleAssignment - Delete entity from appRoleAssignments
54+
func (c AppRoleAssignmentClient) DeleteAppRoleAssignment(ctx context.Context, id beta.AppRoleAssignmentId, options DeleteAppRoleAssignmentOperationOptions) (result DeleteAppRoleAssignmentOperationResponse, err error) {
55+
opts := client.RequestOptions{
56+
ContentType: "application/json; charset=utf-8",
57+
ExpectedStatusCodes: []int{
58+
http.StatusNoContent,
59+
http.StatusOK,
60+
},
61+
HttpMethod: http.MethodDelete,
62+
OptionsObject: options,
63+
Path: id.ID(),
64+
RetryFunc: options.RetryFunc,
65+
}
66+
67+
req, err := c.Client.NewRequest(ctx, opts)
68+
if err != nil {
69+
return
70+
}
71+
72+
var resp *client.Response
73+
resp, err = req.Execute(ctx)
74+
if resp != nil {
75+
result.OData = resp.OData
76+
result.HttpResponse = resp.Response
77+
}
78+
if err != nil {
79+
return
80+
}
81+
82+
return
83+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
package approleassignment
2+
3+
import (
4+
"context"
5+
"net/http"
6+
7+
"github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/beta"
8+
"github.com/hashicorp/go-azure-sdk/sdk/client"
9+
"github.com/hashicorp/go-azure-sdk/sdk/odata"
10+
)
11+
12+
// Copyright (c) HashiCorp Inc. All rights reserved.
13+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
14+
15+
type GetAppRoleAssignmentOperationResponse struct {
16+
HttpResponse *http.Response
17+
OData *odata.OData
18+
Model *beta.AppRoleAssignment
19+
}
20+
21+
type GetAppRoleAssignmentOperationOptions struct {
22+
Expand *odata.Expand
23+
Metadata *odata.Metadata
24+
RetryFunc client.RequestRetryFunc
25+
Select *[]string
26+
}
27+
28+
func DefaultGetAppRoleAssignmentOperationOptions() GetAppRoleAssignmentOperationOptions {
29+
return GetAppRoleAssignmentOperationOptions{}
30+
}
31+
32+
func (o GetAppRoleAssignmentOperationOptions) ToHeaders() *client.Headers {
33+
out := client.Headers{}
34+
35+
return &out
36+
}
37+
38+
func (o GetAppRoleAssignmentOperationOptions) ToOData() *odata.Query {
39+
out := odata.Query{}
40+
if o.Expand != nil {
41+
out.Expand = *o.Expand
42+
}
43+
if o.Metadata != nil {
44+
out.Metadata = *o.Metadata
45+
}
46+
if o.Select != nil {
47+
out.Select = *o.Select
48+
}
49+
return &out
50+
}
51+
52+
func (o GetAppRoleAssignmentOperationOptions) ToQuery() *client.QueryParams {
53+
out := client.QueryParams{}
54+
55+
return &out
56+
}
57+
58+
// GetAppRoleAssignment - Get entity from appRoleAssignments by key
59+
func (c AppRoleAssignmentClient) GetAppRoleAssignment(ctx context.Context, id beta.AppRoleAssignmentId, options GetAppRoleAssignmentOperationOptions) (result GetAppRoleAssignmentOperationResponse, err error) {
60+
opts := client.RequestOptions{
61+
ContentType: "application/json; charset=utf-8",
62+
ExpectedStatusCodes: []int{
63+
http.StatusOK,
64+
},
65+
HttpMethod: http.MethodGet,
66+
OptionsObject: options,
67+
Path: id.ID(),
68+
RetryFunc: options.RetryFunc,
69+
}
70+
71+
req, err := c.Client.NewRequest(ctx, opts)
72+
if err != nil {
73+
return
74+
}
75+
76+
var resp *client.Response
77+
resp, err = req.Execute(ctx)
78+
if resp != nil {
79+
result.OData = resp.OData
80+
result.HttpResponse = resp.Response
81+
}
82+
if err != nil {
83+
return
84+
}
85+
86+
var model beta.AppRoleAssignment
87+
result.Model = &model
88+
if err = resp.Unmarshal(result.Model); err != nil {
89+
return
90+
}
91+
92+
return
93+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package approleassignment
2+
3+
import (
4+
"context"
5+
"net/http"
6+
7+
"github.com/hashicorp/go-azure-sdk/sdk/client"
8+
"github.com/hashicorp/go-azure-sdk/sdk/odata"
9+
)
10+
11+
// Copyright (c) HashiCorp Inc. All rights reserved.
12+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
13+
14+
type GetsCountOperationResponse struct {
15+
HttpResponse *http.Response
16+
OData *odata.OData
17+
Model *[]byte
18+
}
19+
20+
type GetsCountOperationOptions struct {
21+
Filter *string
22+
Metadata *odata.Metadata
23+
RetryFunc client.RequestRetryFunc
24+
Search *string
25+
}
26+
27+
func DefaultGetsCountOperationOptions() GetsCountOperationOptions {
28+
return GetsCountOperationOptions{}
29+
}
30+
31+
func (o GetsCountOperationOptions) ToHeaders() *client.Headers {
32+
out := client.Headers{}
33+
34+
return &out
35+
}
36+
37+
func (o GetsCountOperationOptions) ToOData() *odata.Query {
38+
out := odata.Query{}
39+
if o.Filter != nil {
40+
out.Filter = *o.Filter
41+
}
42+
if o.Metadata != nil {
43+
out.Metadata = *o.Metadata
44+
}
45+
if o.Search != nil {
46+
out.Search = *o.Search
47+
}
48+
return &out
49+
}
50+
51+
func (o GetsCountOperationOptions) ToQuery() *client.QueryParams {
52+
out := client.QueryParams{}
53+
54+
return &out
55+
}
56+
57+
// GetsCount - Get the number of the resource
58+
func (c AppRoleAssignmentClient) GetsCount(ctx context.Context, options GetsCountOperationOptions) (result GetsCountOperationResponse, err error) {
59+
opts := client.RequestOptions{
60+
ContentType: "text/plain",
61+
ExpectedStatusCodes: []int{
62+
http.StatusOK,
63+
},
64+
HttpMethod: http.MethodGet,
65+
OptionsObject: options,
66+
Path: "/appRoleAssignments/$count",
67+
RetryFunc: options.RetryFunc,
68+
}
69+
70+
req, err := c.Client.NewRequest(ctx, opts)
71+
if err != nil {
72+
return
73+
}
74+
75+
var resp *client.Response
76+
resp, err = req.Execute(ctx)
77+
if resp != nil {
78+
result.OData = resp.OData
79+
result.HttpResponse = resp.Response
80+
}
81+
if err != nil {
82+
return
83+
}
84+
85+
var model []byte
86+
result.Model = &model
87+
if err = resp.Unmarshal(result.Model); err != nil {
88+
return
89+
}
90+
91+
return
92+
}

0 commit comments

Comments
 (0)