diff --git a/microsoft-graph/approleassignments/beta/approleassignment/client.go b/microsoft-graph/approleassignments/beta/approleassignment/client.go deleted file mode 100644 index ea202e7a380..00000000000 --- a/microsoft-graph/approleassignments/beta/approleassignment/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package approleassignment - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/msgraph" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) HashiCorp Inc. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AppRoleAssignmentClient struct { - Client *msgraph.Client -} - -func NewAppRoleAssignmentClientWithBaseURI(sdkApi sdkEnv.Api) (*AppRoleAssignmentClient, error) { - client, err := msgraph.NewClient(sdkApi, "approleassignment", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AppRoleAssignmentClient: %+v", err) - } - - return &AppRoleAssignmentClient{ - Client: client, - }, nil -} diff --git a/microsoft-graph/approleassignments/beta/approleassignment/method_createapproleassignment.go b/microsoft-graph/approleassignments/beta/approleassignment/method_createapproleassignment.go deleted file mode 100644 index 5e1cbf82198..00000000000 --- a/microsoft-graph/approleassignments/beta/approleassignment/method_createapproleassignment.go +++ /dev/null @@ -1,92 +0,0 @@ -package approleassignment - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/beta" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) HashiCorp Inc. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateAppRoleAssignmentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *beta.AppRoleAssignment -} - -type CreateAppRoleAssignmentOperationOptions struct { - Metadata *odata.Metadata - RetryFunc client.RequestRetryFunc -} - -func DefaultCreateAppRoleAssignmentOperationOptions() CreateAppRoleAssignmentOperationOptions { - return CreateAppRoleAssignmentOperationOptions{} -} - -func (o CreateAppRoleAssignmentOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o CreateAppRoleAssignmentOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - if o.Metadata != nil { - out.Metadata = *o.Metadata - } - return &out -} - -func (o CreateAppRoleAssignmentOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - - return &out -} - -// CreateAppRoleAssignment - Add new entity to appRoleAssignments -func (c AppRoleAssignmentClient) CreateAppRoleAssignment(ctx context.Context, input beta.AppRoleAssignment, options CreateAppRoleAssignmentOperationOptions) (result CreateAppRoleAssignmentOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusCreated, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - OptionsObject: options, - Path: "/appRoleAssignments", - RetryFunc: options.RetryFunc, - } - - 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 - } - - var model beta.AppRoleAssignment - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/microsoft-graph/approleassignments/beta/approleassignment/method_deleteapproleassignment.go b/microsoft-graph/approleassignments/beta/approleassignment/method_deleteapproleassignment.go deleted file mode 100644 index f161f3e3311..00000000000 --- a/microsoft-graph/approleassignments/beta/approleassignment/method_deleteapproleassignment.go +++ /dev/null @@ -1,83 +0,0 @@ -package approleassignment - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/beta" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) HashiCorp Inc. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteAppRoleAssignmentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -type DeleteAppRoleAssignmentOperationOptions struct { - IfMatch *string - Metadata *odata.Metadata - RetryFunc client.RequestRetryFunc -} - -func DefaultDeleteAppRoleAssignmentOperationOptions() DeleteAppRoleAssignmentOperationOptions { - return DeleteAppRoleAssignmentOperationOptions{} -} - -func (o DeleteAppRoleAssignmentOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - if o.IfMatch != nil { - out.Append("If-Match", fmt.Sprintf("%v", *o.IfMatch)) - } - return &out -} - -func (o DeleteAppRoleAssignmentOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - if o.Metadata != nil { - out.Metadata = *o.Metadata - } - return &out -} - -func (o DeleteAppRoleAssignmentOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - - return &out -} - -// DeleteAppRoleAssignment - Delete entity from appRoleAssignments -func (c AppRoleAssignmentClient) DeleteAppRoleAssignment(ctx context.Context, id beta.AppRoleAssignmentId, options DeleteAppRoleAssignmentOperationOptions) (result DeleteAppRoleAssignmentOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - OptionsObject: options, - Path: id.ID(), - RetryFunc: options.RetryFunc, - } - - 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 -} diff --git a/microsoft-graph/approleassignments/beta/approleassignment/method_getapproleassignment.go b/microsoft-graph/approleassignments/beta/approleassignment/method_getapproleassignment.go deleted file mode 100644 index b057bec1cc7..00000000000 --- a/microsoft-graph/approleassignments/beta/approleassignment/method_getapproleassignment.go +++ /dev/null @@ -1,93 +0,0 @@ -package approleassignment - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/beta" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) HashiCorp Inc. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetAppRoleAssignmentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *beta.AppRoleAssignment -} - -type GetAppRoleAssignmentOperationOptions struct { - Expand *odata.Expand - Metadata *odata.Metadata - RetryFunc client.RequestRetryFunc - Select *[]string -} - -func DefaultGetAppRoleAssignmentOperationOptions() GetAppRoleAssignmentOperationOptions { - return GetAppRoleAssignmentOperationOptions{} -} - -func (o GetAppRoleAssignmentOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetAppRoleAssignmentOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - if o.Expand != nil { - out.Expand = *o.Expand - } - if o.Metadata != nil { - out.Metadata = *o.Metadata - } - if o.Select != nil { - out.Select = *o.Select - } - return &out -} - -func (o GetAppRoleAssignmentOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - - return &out -} - -// GetAppRoleAssignment - Get entity from appRoleAssignments by key -func (c AppRoleAssignmentClient) GetAppRoleAssignment(ctx context.Context, id beta.AppRoleAssignmentId, options GetAppRoleAssignmentOperationOptions) (result GetAppRoleAssignmentOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - OptionsObject: options, - Path: id.ID(), - RetryFunc: options.RetryFunc, - } - - 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 - } - - var model beta.AppRoleAssignment - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/microsoft-graph/approleassignments/beta/approleassignment/method_getscount.go b/microsoft-graph/approleassignments/beta/approleassignment/method_getscount.go deleted file mode 100644 index 74ebe70bdcf..00000000000 --- a/microsoft-graph/approleassignments/beta/approleassignment/method_getscount.go +++ /dev/null @@ -1,92 +0,0 @@ -package approleassignment - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) HashiCorp Inc. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetsCountOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]byte -} - -type GetsCountOperationOptions struct { - Filter *string - Metadata *odata.Metadata - RetryFunc client.RequestRetryFunc - Search *string -} - -func DefaultGetsCountOperationOptions() GetsCountOperationOptions { - return GetsCountOperationOptions{} -} - -func (o GetsCountOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetsCountOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - if o.Filter != nil { - out.Filter = *o.Filter - } - if o.Metadata != nil { - out.Metadata = *o.Metadata - } - if o.Search != nil { - out.Search = *o.Search - } - return &out -} - -func (o GetsCountOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - - return &out -} - -// GetsCount - Get the number of the resource -func (c AppRoleAssignmentClient) GetsCount(ctx context.Context, options GetsCountOperationOptions) (result GetsCountOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "text/plain", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - OptionsObject: options, - Path: "/appRoleAssignments/$count", - RetryFunc: options.RetryFunc, - } - - 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 - } - - var model []byte - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/microsoft-graph/approleassignments/beta/approleassignment/method_listapproleassignments.go b/microsoft-graph/approleassignments/beta/approleassignment/method_listapproleassignments.go deleted file mode 100644 index 0c86a4db50a..00000000000 --- a/microsoft-graph/approleassignments/beta/approleassignment/method_listapproleassignments.go +++ /dev/null @@ -1,169 +0,0 @@ -package approleassignment - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/beta" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) HashiCorp Inc. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListAppRoleAssignmentsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]beta.AppRoleAssignment -} - -type ListAppRoleAssignmentsCompleteResult struct { - LatestHttpResponse *http.Response - Items []beta.AppRoleAssignment -} - -type ListAppRoleAssignmentsOperationOptions struct { - Count *bool - Expand *odata.Expand - Filter *string - Metadata *odata.Metadata - OrderBy *odata.OrderBy - RetryFunc client.RequestRetryFunc - Search *string - Select *[]string - Skip *int64 - Top *int64 -} - -func DefaultListAppRoleAssignmentsOperationOptions() ListAppRoleAssignmentsOperationOptions { - return ListAppRoleAssignmentsOperationOptions{} -} - -func (o ListAppRoleAssignmentsOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListAppRoleAssignmentsOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - if o.Count != nil { - out.Count = *o.Count - } - if o.Expand != nil { - out.Expand = *o.Expand - } - if o.Filter != nil { - out.Filter = *o.Filter - } - if o.Metadata != nil { - out.Metadata = *o.Metadata - } - if o.OrderBy != nil { - out.OrderBy = *o.OrderBy - } - if o.Search != nil { - out.Search = *o.Search - } - if o.Select != nil { - out.Select = *o.Select - } - if o.Skip != nil { - out.Skip = int(*o.Skip) - } - if o.Top != nil { - out.Top = int(*o.Top) - } - return &out -} - -func (o ListAppRoleAssignmentsOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - - return &out -} - -type ListAppRoleAssignmentsCustomPager struct { - NextLink *odata.Link `json:"@odata.nextLink"` -} - -func (p *ListAppRoleAssignmentsCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// ListAppRoleAssignments - Get entities from appRoleAssignments -func (c AppRoleAssignmentClient) ListAppRoleAssignments(ctx context.Context, options ListAppRoleAssignmentsOperationOptions) (result ListAppRoleAssignmentsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - OptionsObject: options, - Pager: &ListAppRoleAssignmentsCustomPager{}, - Path: "/appRoleAssignments", - RetryFunc: options.RetryFunc, - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]beta.AppRoleAssignment `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAppRoleAssignmentsComplete retrieves all the results into a single object -func (c AppRoleAssignmentClient) ListAppRoleAssignmentsComplete(ctx context.Context, options ListAppRoleAssignmentsOperationOptions) (ListAppRoleAssignmentsCompleteResult, error) { - return c.ListAppRoleAssignmentsCompleteMatchingPredicate(ctx, options, AppRoleAssignmentOperationPredicate{}) -} - -// ListAppRoleAssignmentsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AppRoleAssignmentClient) ListAppRoleAssignmentsCompleteMatchingPredicate(ctx context.Context, options ListAppRoleAssignmentsOperationOptions, predicate AppRoleAssignmentOperationPredicate) (result ListAppRoleAssignmentsCompleteResult, err error) { - items := make([]beta.AppRoleAssignment, 0) - - resp, err := c.ListAppRoleAssignments(ctx, options) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListAppRoleAssignmentsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/microsoft-graph/approleassignments/beta/approleassignment/method_updateapproleassignment.go b/microsoft-graph/approleassignments/beta/approleassignment/method_updateapproleassignment.go deleted file mode 100644 index f3896fcd48c..00000000000 --- a/microsoft-graph/approleassignments/beta/approleassignment/method_updateapproleassignment.go +++ /dev/null @@ -1,84 +0,0 @@ -package approleassignment - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/beta" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) HashiCorp Inc. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateAppRoleAssignmentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -type UpdateAppRoleAssignmentOperationOptions struct { - Metadata *odata.Metadata - RetryFunc client.RequestRetryFunc -} - -func DefaultUpdateAppRoleAssignmentOperationOptions() UpdateAppRoleAssignmentOperationOptions { - return UpdateAppRoleAssignmentOperationOptions{} -} - -func (o UpdateAppRoleAssignmentOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o UpdateAppRoleAssignmentOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - if o.Metadata != nil { - out.Metadata = *o.Metadata - } - return &out -} - -func (o UpdateAppRoleAssignmentOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - - return &out -} - -// UpdateAppRoleAssignment - Update entity in appRoleAssignments -func (c AppRoleAssignmentClient) UpdateAppRoleAssignment(ctx context.Context, id beta.AppRoleAssignmentId, input beta.AppRoleAssignment, options UpdateAppRoleAssignmentOperationOptions) (result UpdateAppRoleAssignmentOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - OptionsObject: options, - Path: id.ID(), - RetryFunc: options.RetryFunc, - } - - 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 - } - - return -} diff --git a/microsoft-graph/approleassignments/beta/approleassignment/predicates.go b/microsoft-graph/approleassignments/beta/approleassignment/predicates.go deleted file mode 100644 index 95a2484119c..00000000000 --- a/microsoft-graph/approleassignments/beta/approleassignment/predicates.go +++ /dev/null @@ -1,14 +0,0 @@ -package approleassignment - -// Copyright (c) HashiCorp Inc. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -import "github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/beta" - -type AppRoleAssignmentOperationPredicate struct { -} - -func (p AppRoleAssignmentOperationPredicate) Matches(input beta.AppRoleAssignment) bool { - - return true -} diff --git a/microsoft-graph/approleassignments/beta/approleassignment/version.go b/microsoft-graph/approleassignments/beta/approleassignment/version.go deleted file mode 100644 index 3a2cc9d7a49..00000000000 --- a/microsoft-graph/approleassignments/beta/approleassignment/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package approleassignment - -// Copyright (c) HashiCorp Inc. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "beta" - -func userAgent() string { - return "hashicorp/go-azure-sdk/approleassignment/beta" -} diff --git a/microsoft-graph/approleassignments/beta/client.go b/microsoft-graph/approleassignments/beta/client.go deleted file mode 100644 index e537330e03a..00000000000 --- a/microsoft-graph/approleassignments/beta/client.go +++ /dev/null @@ -1,28 +0,0 @@ -package beta - -// Copyright (c) HashiCorp Inc. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/microsoft-graph/approleassignments/beta/approleassignment" - "github.com/hashicorp/go-azure-sdk/sdk/client/msgraph" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - AppRoleAssignment *approleassignment.AppRoleAssignmentClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *msgraph.Client)) (*Client, error) { - appRoleAssignmentClient, err := approleassignment.NewAppRoleAssignmentClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AppRoleAssignment client: %+v", err) - } - configureFunc(appRoleAssignmentClient.Client) - - return &Client{ - AppRoleAssignment: appRoleAssignmentClient, - }, nil -}