diff --git a/build/generate.mk b/build/generate.mk index cac1cb9e4e..73d46ab580 100644 --- a/build/generate.mk +++ b/build/generate.mk @@ -20,7 +20,7 @@ ifeq ($(GOOS),windows) endif .PHONY: generate -generate: generate-genericcliclient generate-rad-corerp-client generate-rad-linkrp-client generate-rad-ucp-client generate-go generate-bicep-types generate-ucp-crd ## Generates all targets. +generate: generate-genericcliclient generate-rad-corerp-client generate-rad-linkrp-client generate-rad-datastoresrp-client generate-rad-messagingrp-client generate-rad-daprrp-client generate-rad-ucp-client generate-go generate-bicep-types generate-ucp-crd ## Generates all targets. .PHONY: generate-cadl-installed generate-cadl-installed: diff --git a/pkg/daprrp/api/v20220315privatepreview/README.md b/pkg/daprrp/api/README.md similarity index 79% rename from pkg/daprrp/api/v20220315privatepreview/README.md rename to pkg/daprrp/api/README.md index 6d1eea4c9f..639ddffa04 100644 --- a/pkg/daprrp/api/v20220315privatepreview/README.md +++ b/pkg/daprrp/api/README.md @@ -34,7 +34,7 @@ These settings apply only when `--tag=dapr-2022-03-15-privatepreview` is specifi ```yaml $(tag) == 'dapr-2022-03-15-privatepreview' input-file: - - ../../../../swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/openapi.json + - ../../../swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/openapi.json modelerfour: treat-type-object-as-anything: false ``` @@ -47,7 +47,7 @@ version: 3.*.* use: "@autorest/go@4.0.0-preview.44" module-version: 0.0.1 file-prefix: zz_generated_ -license-header: MICROSOFT_MIT_NO_VERSION +license-header: "Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information.\nCode generated by Microsoft (R) AutoRest Code Generator.\nChanges may cause incorrect behavior and will be lost if the code is regenerated." azure-arm: true ``` @@ -58,5 +58,5 @@ azure-arm: true These settings apply only when `--tag=dapr-2022-03-15-privatepreview` is specified on the command line. ```yaml $(tag) == 'dapr-2022-03-15-privatepreview' -output-folder: ../v20220315privatepreview +output-folder: ./v20220315privatepreview ``` \ No newline at end of file diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go index d38926bfa0..2fe9f1a685 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. @@ -14,6 +13,20 @@ const ( moduleVersion = "v0.0.1" ) +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string + +const ( + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -34,6 +47,25 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + // ProvisioningState - Provisioning state of the link at the time the operation was called type ProvisioningState string diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go index 81b0512e3b..8453317ffd 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go index 72b09f72fc..07dbcd9282 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go index 0d920e8e68..0b967f0b5b 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go index 6387c524c8..6e522cdc4d 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. @@ -344,6 +343,60 @@ type ErrorResponse struct { Error *ErrorDetail `json:"error,omitempty"` } +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Localized display information for this particular operation. + Display *OperationDisplay `json:"display,omitempty"` + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane +// operations. + IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", +// "Microsoft.Compute/virtualMachines/capture/action" + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" + Origin *Origin `json:"origin,omitempty" azure:"ro"` +} + +// OperationDisplay - Localized display information for this particular operation. +type OperationDisplay struct { + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual +// Machine", "Restart Virtual Machine". + Operation *string `json:"operation,omitempty" azure:"ro"` + + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft +// Compute". + Provider *string `json:"provider,omitempty" azure:"ro"` + + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job +// Schedule Collections". + Resource *string `json:"resource,omitempty" azure:"ro"` +} + +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation `json:"value,omitempty" azure:"ro"` +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + // Recipe - The recipe used to automatically deploy underlying infrastructure for a link type Recipe struct { // REQUIRED; The name of the recipe within the environment to use diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go index 29a7a63aad..1bef2cef92 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. @@ -582,6 +581,119 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Recipe. func (r Recipe) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_operations_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_operations_client.go new file mode 100644 index 0000000000..0a3d4f6185 --- /dev/null +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_operations_client.go @@ -0,0 +1,104 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package v20220315privatepreview + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" +) + +// OperationsClient contains the methods for the Operations group. +// Don't use this type directly, use NewOperationsClient() instead. +type OperationsClient struct { + host string + pl runtime.Pipeline +} + +// NewOperationsClient creates a new instance of OperationsClient with the specified values. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &OperationsClient{ + host: ep, +pl: pl, + } + return client, nil +} + +// NewListPager - List the operations for the provider +// Generated from API version 2022-03-15-privatepreview +// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) (*runtime.Pager[OperationsClientListResponse]) { + return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OperationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OperationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Applications.Dapr/operations" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { + result := OperationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { + return OperationsClientListResponse{}, err + } + return result, nil +} + diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go index 0a26032272..965d7eaec2 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go index 391760c608..8e29783a81 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. @@ -77,3 +76,8 @@ type DaprStateStoreClientListByRootScopeResponse struct { DaprStateStoreResourceListResult } +// OperationsClientListResponse contains the response from method OperationsClient.List. +type OperationsClientListResponse struct { + OperationListResult +} + diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go index 60917a9ace..cea28fe8b6 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/datastoresrp/api/v20220315privatepreview/README.md b/pkg/datastoresrp/api/README.md similarity index 79% rename from pkg/datastoresrp/api/v20220315privatepreview/README.md rename to pkg/datastoresrp/api/README.md index 335a36d705..04cc3c2468 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/README.md +++ b/pkg/datastoresrp/api/README.md @@ -34,7 +34,7 @@ These settings apply only when `--tag=datastores-2022-03-15-privatepreview` is s ```yaml $(tag) == 'datastores-2022-03-15-privatepreview' input-file: - - ../../../../swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/openapi.json + - ../../../swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/openapi.json modelerfour: treat-type-object-as-anything: false ``` @@ -47,7 +47,7 @@ version: 3.*.* use: "@autorest/go@4.0.0-preview.44" module-version: 0.0.1 file-prefix: zz_generated_ -license-header: MICROSOFT_MIT_NO_VERSION +license-header: "Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information.\nCode generated by Microsoft (R) AutoRest Code Generator.\nChanges may cause incorrect behavior and will be lost if the code is regenerated." azure-arm: true ``` @@ -58,5 +58,5 @@ azure-arm: true These settings apply only when `--tag=datastores-2022-03-15-privatepreview` is specified on the command line. ```yaml $(tag) == 'datastores-2022-03-15-privatepreview' -output-folder: ../v20220315privatepreview +output-folder: ./v20220315privatepreview ``` \ No newline at end of file diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go index b58e17762f..2fe9f1a685 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go index 4f5af1522a..2c5f18765a 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go index 6dc544cbd6..4bcb945343 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go index 5ac241b791..ff0ce5a968 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_operations_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_operations_client.go index 58b9492451..12faffca8c 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_operations_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_operations_client.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go index 288004c6e9..ce7c5cbf75 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go index f04335cbf1..04bf2c154f 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go index 681c66910a..0330cdfeac 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go index 1222eac8ba..9985b246cf 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go index 60917a9ace..cea28fe8b6 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/messagingrp/api/v20220315privatepreview/README.md b/pkg/messagingrp/api/README.md similarity index 79% rename from pkg/messagingrp/api/v20220315privatepreview/README.md rename to pkg/messagingrp/api/README.md index 66214f2989..263318771a 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/README.md +++ b/pkg/messagingrp/api/README.md @@ -34,7 +34,7 @@ These settings apply only when `--tag=messaging-2022-03-15-privatepreview` is sp ```yaml $(tag) == 'messaging-2022-03-15-privatepreview' input-file: - - ../../../../swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/openapi.json + - ../../../swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/openapi.json modelerfour: treat-type-object-as-anything: false ``` @@ -47,7 +47,7 @@ version: 3.*.* use: "@autorest/go@4.0.0-preview.44" module-version: 0.0.1 file-prefix: zz_generated_ -license-header: MICROSOFT_MIT_NO_VERSION +license-header: "Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information.\nCode generated by Microsoft (R) AutoRest Code Generator.\nChanges may cause incorrect behavior and will be lost if the code is regenerated." azure-arm: true ``` @@ -58,5 +58,5 @@ azure-arm: true These settings apply only when `--tag=messaging-2022-03-15-privatepreview` is specified on the command line. ```yaml $(tag) == 'messaging-2022-03-15-privatepreview' -output-folder: ../v20220315privatepreview +output-folder: ./v20220315privatepreview ``` \ No newline at end of file diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go index d38926bfa0..2fe9f1a685 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. @@ -14,6 +13,20 @@ const ( moduleVersion = "v0.0.1" ) +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string + +const ( + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -34,6 +47,25 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + // ProvisioningState - Provisioning state of the link at the time the operation was called type ProvisioningState string diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go index d9d3ad1573..dee31f0c48 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. @@ -73,6 +72,60 @@ type ErrorResponse struct { Error *ErrorDetail `json:"error,omitempty"` } +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Localized display information for this particular operation. + Display *OperationDisplay `json:"display,omitempty"` + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane +// operations. + IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", +// "Microsoft.Compute/virtualMachines/capture/action" + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" + Origin *Origin `json:"origin,omitempty" azure:"ro"` +} + +// OperationDisplay - Localized display information for this particular operation. +type OperationDisplay struct { + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual +// Machine", "Restart Virtual Machine". + Operation *string `json:"operation,omitempty" azure:"ro"` + + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft +// Compute". + Provider *string `json:"provider,omitempty" azure:"ro"` + + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job +// Schedule Collections". + Resource *string `json:"resource,omitempty" azure:"ro"` +} + +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation `json:"value,omitempty" azure:"ro"` +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + // RabbitMQListSecretsResult - The secret values for the given RabbitMQQueue resource type RabbitMQListSecretsResult struct { // The connection string used to connect to this RabbitMQ instance diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go index 1a93121b60..19c827af52 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. @@ -191,6 +190,119 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RabbitMQListSecretsResult. func (r RabbitMQListSecretsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_operations_client.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_operations_client.go new file mode 100644 index 0000000000..d7100cd3fe --- /dev/null +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_operations_client.go @@ -0,0 +1,104 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package v20220315privatepreview + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" +) + +// OperationsClient contains the methods for the Operations group. +// Don't use this type directly, use NewOperationsClient() instead. +type OperationsClient struct { + host string + pl runtime.Pipeline +} + +// NewOperationsClient creates a new instance of OperationsClient with the specified values. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &OperationsClient{ + host: ep, +pl: pl, + } + return client, nil +} + +// NewListPager - List the operations for the provider +// Generated from API version 2022-03-15-privatepreview +// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) (*runtime.Pager[OperationsClientListResponse]) { + return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OperationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OperationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Applications.Messaging/operations" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { + result := OperationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { + return OperationsClientListResponse{}, err + } + return result, nil +} + diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go index 44d81faa10..2e0c781887 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go index 82b5d4e723..70178b3461 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go index eeb1f681d8..a030141adf 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go @@ -1,14 +1,18 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT. package v20220315privatepreview +// OperationsClientListResponse contains the response from method OperationsClient.List. +type OperationsClientListResponse struct { + OperationListResult +} + // RabbitMqQueuesClientCreateOrUpdateResponse contains the response from method RabbitMqQueuesClient.CreateOrUpdate. type RabbitMqQueuesClientCreateOrUpdateResponse struct { RabbitMQQueueResource diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go index 60917a9ace..cea28fe8b6 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go @@ -1,8 +1,7 @@ //go:build go1.18 // +build go1.18 -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DO NOT EDIT.